From 5b585ffececd383e7376cd560bfd970ea182c110 Mon Sep 17 00:00:00 2001 From: Xiaogang Date: Fri, 1 Dec 2023 13:53:53 +0800 Subject: [PATCH] Use autorest.powershell to generate SDK for Az.Network (#23590) * Generate SDK for network with autorest.powershell * Redo migration based on API 06-01 --- .../ConnectionMonitorOperation.cs | 8 +- .../AdminRuleCollectionsOperations.cs | 583 +-- ...dminRuleCollectionsOperationsExtensions.cs | 643 ++- .../Generated/AdminRulesOperations.cs | 591 +-- .../AdminRulesOperationsExtensions.cs | 695 ++-- ...wayPrivateEndpointConnectionsOperations.cs | 547 +-- ...EndpointConnectionsOperationsExtensions.cs | 586 ++- ...onGatewayPrivateLinkResourcesOperations.cs | 211 +- ...rivateLinkResourcesOperationsExtensions.cs | 149 +- ...wayWafDynamicManifestsDefaultOperations.cs | 125 +- ...micManifestsDefaultOperationsExtensions.cs | 76 +- ...ionGatewayWafDynamicManifestsOperations.cs | 208 +- ...WafDynamicManifestsOperationsExtensions.cs | 137 +- .../ApplicationGatewaysOperations.cs | 2024 ++++++---- ...ApplicationGatewaysOperationsExtensions.cs | 1917 +++++---- .../ApplicationSecurityGroupsOperations.cs | 834 ++-- ...ationSecurityGroupsOperationsExtensions.cs | 703 ++-- .../AvailableDelegationsOperations.cs | 208 +- ...vailableDelegationsOperationsExtensions.cs | 145 +- .../AvailableEndpointServicesOperations.cs | 208 +- ...bleEndpointServicesOperationsExtensions.cs | 137 +- ...AvailablePrivateEndpointTypesOperations.cs | 391 +- ...rivateEndpointTypesOperationsExtensions.cs | 287 +- ...lableResourceGroupDelegationsOperations.cs | 211 +- ...rceGroupDelegationsOperationsExtensions.cs | 157 +- .../AvailableServiceAliasesOperations.cs | 391 +- ...lableServiceAliasesOperationsExtensions.cs | 271 +- .../AzureFirewallFqdnTagsOperations.cs | 205 +- ...ureFirewallFqdnTagsOperationsExtensions.cs | 125 +- .../Generated/AzureFirewallsOperations.cs | 1093 ++--- .../AzureFirewallsOperationsExtensions.cs | 1120 +++--- .../Generated/BastionHostsOperations.cs | 845 ++-- .../BastionHostsOperationsExtensions.cs | 778 ++-- .../BgpServiceCommunitiesOperations.cs | 205 +- ...pServiceCommunitiesOperationsExtensions.cs | 125 +- .../ConfigurationPolicyGroupsOperations.cs | 556 +-- ...urationPolicyGroupsOperationsExtensions.cs | 602 ++- .../Generated/ConnectionMonitorsOperations.cs | 902 +++-- .../ConnectionMonitorsOperationsExtensions.cs | 1148 +++--- .../ConnectivityConfigurationsOperations.cs | 576 +-- ...ivityConfigurationsOperationsExtensions.cs | 597 ++- .../Generated/CustomIPPrefixesOperations.cs | 833 ++-- .../CustomIPPrefixesOperationsExtensions.cs | 711 ++-- .../Generated/DdosCustomPoliciesOperations.cs | 481 ++- .../DdosCustomPoliciesOperationsExtensions.cs | 471 +-- .../DdosProtectionPlansOperations.cs | 838 ++-- ...DdosProtectionPlansOperationsExtensions.cs | 703 ++-- .../DefaultSecurityRulesOperations.cs | 314 +- ...efaultSecurityRulesOperationsExtensions.cs | 234 +- .../Generated/DscpConfigurationOperations.cs | 718 ++-- .../DscpConfigurationOperationsExtensions.cs | 620 ++- ...essRouteCircuitAuthorizationsOperations.cs | 556 +-- ...rcuitAuthorizationsOperationsExtensions.cs | 594 ++- ...xpressRouteCircuitConnectionsOperations.cs | 571 +-- ...eCircuitConnectionsOperationsExtensions.cs | 686 ++-- .../ExpressRouteCircuitPeeringsOperations.cs | 558 +-- ...outeCircuitPeeringsOperationsExtensions.cs | 586 ++- .../ExpressRouteCircuitsOperations.cs | 1392 ++++--- ...xpressRouteCircuitsOperationsExtensions.cs | 1567 ++++---- .../ExpressRouteConnectionsOperations.cs | 478 ++- ...essRouteConnectionsOperationsExtensions.cs | 529 ++- ...sRouteCrossConnectionPeeringsOperations.cs | 558 +-- ...sConnectionPeeringsOperationsExtensions.cs | 586 ++- .../ExpressRouteCrossConnectionsOperations.cs | 1081 ++--- ...uteCrossConnectionsOperationsExtensions.cs | 1163 +++--- .../ExpressRouteGatewaysOperations.cs | 682 ++-- ...xpressRouteGatewaysOperationsExtensions.cs | 672 ++-- .../Generated/ExpressRouteLinksOperations.cs | 314 +- .../ExpressRouteLinksOperationsExtensions.cs | 242 +- ...xpressRoutePortAuthorizationsOperations.cs | 553 +-- ...ePortAuthorizationsOperationsExtensions.cs | 586 ++- .../ExpressRoutePortsLocationsOperations.cs | 302 +- ...RoutePortsLocationsOperationsExtensions.cs | 206 +- .../Generated/ExpressRoutePortsOperations.cs | 944 +++-- .../ExpressRoutePortsOperationsExtensions.cs | 782 ++-- ...essRouteProviderPortsLocationOperations.cs | 125 +- ...oviderPortsLocationOperationsExtensions.cs | 80 +- .../ExpressRouteServiceProvidersOperations.cs | 205 +- ...uteServiceProvidersOperationsExtensions.cs | 125 +- .../Generated/FirewallPoliciesOperations.cs | 836 ++-- .../FirewallPoliciesOperationsExtensions.cs | 711 ++-- ...icyIdpsSignaturesFilterValuesOperations.cs | 142 +- ...naturesFilterValuesOperationsExtensions.cs | 92 +- .../FirewallPolicyIdpsSignaturesOperations.cs | 147 +- ...olicyIdpsSignaturesOperationsExtensions.cs | 96 +- ...PolicyIdpsSignaturesOverridesOperations.cs | 461 ++- ...SignaturesOverridesOperationsExtensions.cs | 323 +- ...allPolicyRuleCollectionGroupsOperations.cs | 558 +-- ...uleCollectionGroupsOperationsExtensions.cs | 586 ++- .../Generated/FlowLogsOperations.cs | 650 +-- .../Generated/FlowLogsOperationsExtensions.cs | 673 ++-- .../Generated/HubRouteTablesOperations.cs | 556 +-- .../HubRouteTablesOperationsExtensions.cs | 590 ++- .../HubVirtualNetworkConnectionsOperations.cs | 556 +-- ...lNetworkConnectionsOperationsExtensions.cs | 590 ++- .../IAdminRuleCollectionsOperations.cs | 127 +- .../Generated/IAdminRulesOperations.cs | 117 +- ...wayPrivateEndpointConnectionsOperations.cs | 94 +- ...onGatewayPrivateLinkResourcesOperations.cs | 34 +- ...wayWafDynamicManifestsDefaultOperations.cs | 25 +- ...ionGatewayWafDynamicManifestsOperations.cs | 34 +- .../IApplicationGatewaysOperations.cs | 308 +- .../IApplicationSecurityGroupsOperations.cs | 116 +- .../IAvailableDelegationsOperations.cs | 44 +- .../IAvailableEndpointServicesOperations.cs | 34 +- ...AvailablePrivateEndpointTypesOperations.cs | 72 +- ...lableResourceGroupDelegationsOperations.cs | 44 +- .../IAvailableServiceAliasesOperations.cs | 64 +- .../IAzureFirewallFqdnTagsOperations.cs | 34 +- .../Generated/IAzureFirewallsOperations.cs | 167 +- .../Generated/IBastionHostsOperations.cs | 115 +- .../IBgpServiceCommunitiesOperations.cs | 34 +- .../IConfigurationPolicyGroupsOperations.cs | 91 +- .../IConnectionMonitorsOperations.cs | 181 +- .../IConnectivityConfigurationsOperations.cs | 132 +- .../Generated/ICustomIPPrefixesOperations.cs | 112 +- .../IDdosCustomPoliciesOperations.cs | 70 +- .../IDdosProtectionPlansOperations.cs | 109 +- .../IDefaultSecurityRulesOperations.cs | 43 +- .../Generated/IDscpConfigurationOperations.cs | 103 +- ...essRouteCircuitAuthorizationsOperations.cs | 98 +- ...xpressRouteCircuitConnectionsOperations.cs | 114 +- .../IExpressRouteCircuitPeeringsOperations.cs | 99 +- .../IExpressRouteCircuitsOperations.cs | 211 +- .../IExpressRouteConnectionsOperations.cs | 80 +- ...sRouteCrossConnectionPeeringsOperations.cs | 93 +- ...IExpressRouteCrossConnectionsOperations.cs | 181 +- .../IExpressRouteGatewaysOperations.cs | 113 +- .../Generated/IExpressRouteLinksOperations.cs | 45 +- ...xpressRoutePortAuthorizationsOperations.cs | 94 +- .../IExpressRoutePortsLocationsOperations.cs | 64 +- .../Generated/IExpressRoutePortsOperations.cs | 132 +- ...essRouteProviderPortsLocationOperations.cs | 27 +- ...IExpressRouteServiceProvidersOperations.cs | 34 +- .../Generated/IFirewallPoliciesOperations.cs | 112 +- ...icyIdpsSignaturesFilterValuesOperations.cs | 30 +- ...IFirewallPolicyIdpsSignaturesOperations.cs | 31 +- ...PolicyIdpsSignaturesOverridesOperations.cs | 74 +- ...allPolicyRuleCollectionGroupsOperations.cs | 85 +- .../Generated/IFlowLogsOperations.cs | 110 +- .../Generated/IHubRouteTablesOperations.cs | 89 +- ...IHubVirtualNetworkConnectionsOperations.cs | 95 +- .../Generated/IInboundNatRulesOperations.cs | 85 +- .../IInboundSecurityRuleOperations.cs | 52 +- .../Generated/IIpAllocationsOperations.cs | 116 +- .../Generated/IIpGroupsOperations.cs | 134 +- ...adBalancerBackendAddressPoolsOperations.cs | 87 +- ...ancerFrontendIPConfigurationsOperations.cs | 43 +- ...oadBalancerLoadBalancingRulesOperations.cs | 43 +- ...LoadBalancerNetworkInterfacesOperations.cs | 34 +- .../ILoadBalancerOutboundRulesOperations.cs | 43 +- .../ILoadBalancerProbesOperations.cs | 43 +- .../Generated/ILoadBalancersOperations.cs | 157 +- .../ILocalNetworkGatewaysOperations.cs | 94 +- ...roupNetworkManagerConnectionsOperations.cs | 88 +- .../Generated/INatGatewaysOperations.cs | 106 +- .../Generated/INatRulesOperations.cs | 89 +- .../Generated/INetworkGroupsOperations.cs | 109 +- ...workInterfaceIPConfigurationsOperations.cs | 43 +- ...NetworkInterfaceLoadBalancersOperations.cs | 34 +- ...orkInterfaceTapConfigurationsOperations.cs | 91 +- .../Generated/INetworkInterfacesOperations.cs | 300 +- .../Generated/INetworkManagementClient.cs | 726 ++-- .../INetworkManagerCommitsOperations.cs | 46 +- ...etworkManagerDeploymentStatusOperations.cs | 36 +- .../Generated/INetworkManagersOperations.cs | 147 +- .../Generated/INetworkProfilesOperations.cs | 100 +- .../INetworkSecurityGroupsOperations.cs | 116 +- ...rkVirtualApplianceConnectionsOperations.cs | 95 +- .../INetworkVirtualAppliancesOperations.cs | 112 +- .../Generated/INetworkWatchersOperations.cs | 491 +-- .../Generated/IOperations.cs | 34 +- .../Generated/IP2sVpnGatewaysOperations.cs | 289 +- .../Generated/IPacketCapturesOperations.cs | 129 +- ...xpressRouteCircuitConnectionsOperations.cs | 58 +- .../IPrivateDnsZoneGroupsOperations.cs | 98 +- .../Generated/IPrivateEndpointsOperations.cs | 127 +- .../IPrivateLinkServicesOperations.cs | 320 +- .../Generated/IPublicIPAddressesOperations.cs | 256 +- .../Generated/IPublicIPPrefixesOperations.cs | 112 +- .../IResourceNavigationLinksOperations.cs | 25 +- .../Generated/IRouteFilterRulesOperations.cs | 85 +- .../Generated/IRouteFiltersOperations.cs | 106 +- .../Generated/IRouteMapsOperations.cs | 97 +- .../Generated/IRouteTablesOperations.cs | 106 +- .../Generated/IRoutesOperations.cs | 79 +- .../Generated/IRoutingIntentOperations.cs | 91 +- .../Generated/IScopeConnectionsOperations.cs | 82 +- .../ISecurityAdminConfigurationsOperations.cs | 112 +- .../ISecurityPartnerProvidersOperations.cs | 114 +- .../Generated/ISecurityRulesOperations.cs | 85 +- .../IServiceAssociationLinksOperations.cs | 25 +- .../IServiceEndpointPoliciesOperations.cs | 109 +- ...viceEndpointPolicyDefinitionsOperations.cs | 100 +- .../IServiceTagInformationOperations.cs | 42 +- .../Generated/IServiceTagsOperations.cs | 33 +- .../Generated/IStaticMembersOperations.cs | 79 +- .../Generated/ISubnetsOperations.cs | 127 +- ...tionNetworkManagerConnectionsOperations.cs | 79 +- .../Generated/IUsagesOperations.cs | 34 +- .../Generated/IVipSwapOperations.cs | 76 +- .../IVirtualApplianceSitesOperations.cs | 97 +- .../IVirtualApplianceSkusOperations.cs | 43 +- .../IVirtualHubBgpConnectionOperations.cs | 71 +- .../IVirtualHubBgpConnectionsOperations.cs | 86 +- .../IVirtualHubIpConfigurationOperations.cs | 93 +- .../IVirtualHubRouteTableV2sOperations.cs | 103 +- .../Generated/IVirtualHubsOperations.cs | 218 +- ...tualNetworkGatewayConnectionsOperations.cs | 365 +- ...VirtualNetworkGatewayNatRulesOperations.cs | 89 +- .../IVirtualNetworkGatewaysOperations.cs | 620 +-- .../IVirtualNetworkPeeringsOperations.cs | 97 +- .../IVirtualNetworkTapsOperations.cs | 112 +- .../Generated/IVirtualNetworksOperations.cs | 201 +- .../IVirtualRouterPeeringsOperations.cs | 93 +- .../Generated/IVirtualRoutersOperations.cs | 115 +- .../Generated/IVirtualWansOperations.cs | 122 +- .../Generated/IVpnConnectionsOperations.cs | 159 +- .../Generated/IVpnGatewaysOperations.cs | 213 +- .../IVpnLinkConnectionsOperations.cs | 90 +- ...tionsAssociatedWithVirtualWanOperations.cs | 52 +- .../IVpnServerConfigurationsOperations.cs | 116 +- .../IVpnSiteLinkConnectionsOperations.cs | 25 +- .../Generated/IVpnSiteLinksOperations.cs | 43 +- .../IVpnSitesConfigurationOperations.cs | 44 +- .../Generated/IVpnSitesOperations.cs | 116 +- ...ebApplicationFirewallPoliciesOperations.cs | 96 +- .../Generated/IWebCategoriesOperations.cs | 46 +- .../Generated/InboundNatRulesOperations.cs | 554 +-- .../InboundNatRulesOperationsExtensions.cs | 594 ++- .../InboundSecurityRuleOperations.cs | 165 +- ...InboundSecurityRuleOperationsExtensions.cs | 209 +- .../Generated/IpAllocationsOperations.cs | 837 ++-- .../IpAllocationsOperationsExtensions.cs | 713 ++-- .../Generated/IpGroupsOperations.cs | 805 ++-- .../Generated/IpGroupsOperationsExtensions.cs | 717 ++-- ...adBalancerBackendAddressPoolsOperations.cs | 553 +-- ...BackendAddressPoolsOperationsExtensions.cs | 586 ++- ...ancerFrontendIPConfigurationsOperations.cs | 314 +- ...endIPConfigurationsOperationsExtensions.cs | 234 +- ...oadBalancerLoadBalancingRulesOperations.cs | 314 +- ...rLoadBalancingRulesOperationsExtensions.cs | 234 +- ...LoadBalancerNetworkInterfacesOperations.cs | 211 +- ...erNetworkInterfacesOperationsExtensions.cs | 149 +- .../LoadBalancerOutboundRulesOperations.cs | 314 +- ...lancerOutboundRulesOperationsExtensions.cs | 234 +- .../Generated/LoadBalancerProbesOperations.cs | 314 +- .../LoadBalancerProbesOperationsExtensions.cs | 234 +- .../Generated/LoadBalancersOperations.cs | 1188 +++--- .../LoadBalancersOperationsExtensions.cs | 1132 +++--- .../LocalNetworkGatewaysOperations.cs | 666 ++-- ...ocalNetworkGatewaysOperationsExtensions.cs | 593 ++- ...roupNetworkManagerConnectionsOperations.cs | 500 +-- ...kManagerConnectionsOperationsExtensions.cs | 416 +- .../Models/AadAuthenticationParameters.cs | 60 +- .../Generated/Models/Access.cs | 13 +- .../Generated/Models/Action.cs | 59 +- .../Generated/Models/ActionType.cs | 13 +- .../Models/ActiveBaseSecurityAdminRule.cs | 98 +- .../Models/ActiveConfigurationParameter.cs | 55 +- .../Models/ActiveConnectivityConfiguration.cs | 103 +- ...iveConnectivityConfigurationsListResult.cs | 62 +- .../Models/ActiveDefaultSecurityAdminRule.cs | 225 +- .../Models/ActiveSecurityAdminRule.cs | 250 +- .../ActiveSecurityAdminRulesListResult.cs | 64 +- .../Generated/Models/AddressPrefixItem.cs | 39 +- .../Generated/Models/AddressPrefixType.cs | 13 +- .../Generated/Models/AddressSpace.cs | 35 +- .../Generated/Models/AdminPropertiesFormat.cs | 193 + .../Generated/Models/AdminRule.cs | 241 +- .../Generated/Models/AdminRuleCollection.cs | 129 +- .../AdminRuleCollectionPropertiesFormat.cs | 104 + .../AdminRuleCollectionsDeleteHeaders.cs | 38 +- .../Generated/Models/AdminRuleKind.cs | 19 + .../Models/AdminRulesDeleteHeaders.cs | 32 +- .../Generated/Models/AdminState.cs | 13 +- .../Generated/Models/ApplicationGateway.cs | 719 ++-- ...icationGatewayAuthenticationCertificate.cs | 104 +- ...thenticationCertificatePropertiesFormat.cs | 58 + ...pplicationGatewayAutoscaleConfiguration.cs | 56 +- .../ApplicationGatewayAvailableSslOptions.cs | 108 +- ...ewayAvailableSslOptionsPropertiesFormat.cs | 82 + ...cationGatewayAvailableWafRuleSetsResult.cs | 36 +- .../ApplicationGatewayBackendAddress.cs | 43 +- .../ApplicationGatewayBackendAddressPool.cs | 119 +- ...tewayBackendAddressPoolPropertiesFormat.cs | 68 + .../Models/ApplicationGatewayBackendHealth.cs | 39 +- ...icationGatewayBackendHealthHttpSettings.cs | 57 +- ...ApplicationGatewayBackendHealthOnDemand.cs | 53 +- .../ApplicationGatewayBackendHealthPool.cs | 53 +- .../ApplicationGatewayBackendHealthServer.cs | 68 +- ...icationGatewayBackendHealthServerHealth.cs | 13 +- .../ApplicationGatewayBackendHttpSettings.cs | 307 +- ...ewayBackendHttpSettingsPropertiesFormat.cs | 210 + .../ApplicationGatewayBackendSettings.cs | 203 +- ...nGatewayBackendSettingsPropertiesFormat.cs | 126 + ...plicationGatewayClientAuthConfiguration.cs | 52 +- ...plicationGatewayClientRevocationOptions.cs | 15 +- .../ApplicationGatewayConnectionDraining.cs | 60 +- .../ApplicationGatewayCookieBasedAffinity.cs | 13 +- .../Models/ApplicationGatewayCustomError.cs | 56 +- ...ApplicationGatewayCustomErrorStatusCode.cs | 13 +- ...icationGatewayFirewallDisabledRuleGroup.cs | 61 +- .../ApplicationGatewayFirewallExclusion.cs | 84 +- ...plicationGatewayFirewallManifestRuleSet.cs | 115 +- .../Models/ApplicationGatewayFirewallMode.cs | 13 +- ...icationGatewayFirewallRateLimitDuration.cs | 13 +- .../Models/ApplicationGatewayFirewallRule.cs | 97 +- .../ApplicationGatewayFirewallRuleGroup.cs | 78 +- .../ApplicationGatewayFirewallRuleSet.cs | 151 +- ...nGatewayFirewallRuleSetPropertiesFormat.cs | 123 + ...ationGatewayFirewallUserSessionVariable.cs | 13 +- ...plicationGatewayFrontendIPConfiguration.cs | 161 +- ...FrontendIPConfigurationPropertiesFormat.cs | 99 + .../Models/ApplicationGatewayFrontendPort.cs | 102 +- ...tionGatewayFrontendPortPropertiesFormat.cs | 58 + .../ApplicationGatewayGlobalConfiguration.cs | 43 +- .../ApplicationGatewayHeaderConfiguration.cs | 43 +- .../Models/ApplicationGatewayHttpListener.cs | 230 +- ...tionGatewayHttpListenerPropertiesFormat.cs | 151 + .../ApplicationGatewayIPConfiguration.cs | 109 +- ...nGatewayIPConfigurationPropertiesFormat.cs | 62 + .../Models/ApplicationGatewayListener.cs | 171 +- ...licationGatewayListenerPropertiesFormat.cs | 110 + ...icationGatewayLoadDistributionAlgorithm.cs | 13 +- ...pplicationGatewayLoadDistributionPolicy.cs | 124 +- ...yLoadDistributionPolicyPropertiesFormat.cs | 68 + ...pplicationGatewayLoadDistributionTarget.cs | 119 +- ...yLoadDistributionTargetPropertiesFormat.cs | 76 + .../Models/ApplicationGatewayOnDemandProbe.cs | 143 +- .../ApplicationGatewayOperationalState.cs | 13 +- .../Models/ApplicationGatewayPathRule.cs | 180 +- ...licationGatewayPathRulePropertiesFormat.cs | 118 + ...icationGatewayPrivateEndpointConnection.cs | 136 +- ...ewayPrivateEndpointConnectionProperties.cs | 82 + ...licationGatewayPrivateLinkConfiguration.cs | 111 +- ...tewayPrivateLinkConfigurationProperties.cs | 61 + ...cationGatewayPrivateLinkIpConfiguration.cs | 145 +- ...wayPrivateLinkIpConfigurationProperties.cs | 90 + .../ApplicationGatewayPrivateLinkResource.cs | 118 +- ...ionGatewayPrivateLinkResourceProperties.cs | 68 + .../Models/ApplicationGatewayProbe.cs | 294 +- ...licationGatewayProbeHealthResponseMatch.cs | 56 +- ...ApplicationGatewayProbePropertiesFormat.cs | 207 + .../ApplicationGatewayPropertiesFormat.cs | 550 +++ .../Models/ApplicationGatewayProtocol.cs | 19 +- ...ApplicationGatewayRedirectConfiguration.cs | 183 +- ...ayRedirectConfigurationPropertiesFormat.cs | 118 + .../Models/ApplicationGatewayRedirectType.cs | 13 +- .../ApplicationGatewayRequestRoutingRule.cs | 242 +- ...tewayRequestRoutingRulePropertiesFormat.cs | 168 + ...pplicationGatewayRequestRoutingRuleType.cs | 13 +- .../Models/ApplicationGatewayRewriteRule.cs | 83 +- .../ApplicationGatewayRewriteRuleActionSet.cs | 58 +- .../ApplicationGatewayRewriteRuleCondition.cs | 81 +- .../ApplicationGatewayRewriteRuleSet.cs | 94 +- ...onGatewayRewriteRuleSetPropertiesFormat.cs | 58 + .../Models/ApplicationGatewayRoutingRule.cs | 182 +- ...ationGatewayRoutingRulePropertiesFormat.cs | 120 + .../ApplicationGatewayRuleSetStatusOptions.cs | 13 +- .../Generated/Models/ApplicationGatewaySku.cs | 61 +- .../Models/ApplicationGatewaySkuName.cs | 13 +- .../ApplicationGatewaySslCertificate.cs | 156 +- ...onGatewaySslCertificatePropertiesFormat.cs | 95 + .../ApplicationGatewaySslCipherSuite.cs | 69 +- .../Models/ApplicationGatewaySslPolicy.cs | 103 +- .../Models/ApplicationGatewaySslPolicyName.cs | 13 +- .../Models/ApplicationGatewaySslPolicyType.cs | 13 +- .../ApplicationGatewaySslPredefinedPolicy.cs | 78 +- ...ewaySslPredefinedPolicyPropertiesFormat.cs | 61 + .../Models/ApplicationGatewaySslProfile.cs | 135 +- ...cationGatewaySslProfilePropertiesFormat.cs | 80 + .../Models/ApplicationGatewaySslProtocol.cs | 13 +- .../Models/ApplicationGatewayTier.cs | 13 +- .../Models/ApplicationGatewayTierTypes.cs | 13 +- ...licationGatewayTrustedClientCertificate.cs | 129 +- ...rustedClientCertificatePropertiesFormat.cs | 78 + ...pplicationGatewayTrustedRootCertificate.cs | 121 +- ...yTrustedRootCertificatePropertiesFormat.cs | 70 + .../ApplicationGatewayUrlConfiguration.cs | 74 +- .../Models/ApplicationGatewayUrlPathMap.cs | 172 +- ...cationGatewayUrlPathMapPropertiesFormat.cs | 108 + ...tewayWafDynamicManifestPropertiesResult.cs | 69 + ...licationGatewayWafDynamicManifestResult.cs | 98 +- .../ApplicationGatewayWafRuleActionTypes.cs | 13 +- .../ApplicationGatewayWafRuleStateTypes.cs | 13 +- ...ewayWebApplicationFirewallConfiguration.cs | 200 +- .../Generated/Models/ApplicationRule.cs | 136 +- .../Models/ApplicationSecurityGroup.cs | 98 +- ...pplicationSecurityGroupPropertiesFormat.cs | 62 + .../Generated/Models/AssociationType.cs | 13 +- .../Generated/Models/AuthenticationMethod.cs | 17 +- .../Models/AuthorizationPropertiesFormat.cs | 68 + .../Models/AuthorizationUseStatus.cs | 13 +- .../Models/AutoApprovedPrivateLinkService.cs | 32 +- .../Models/AutoLearnPrivateRangesMode.cs | 13 +- .../Generated/Models/Availability.cs | 46 +- .../Generated/Models/AvailableDelegation.cs | 80 +- .../Models/AvailablePrivateEndpointType.cs | 77 +- .../Models/AvailableProvidersList.cs | 37 +- .../Models/AvailableProvidersListCity.cs | 40 +- .../Models/AvailableProvidersListCountry.cs | 57 +- .../AvailableProvidersListParameters.cs | 67 +- .../Models/AvailableProvidersListState.cs | 57 +- .../Generated/Models/AvailableServiceAlias.cs | 56 +- .../Models/AzureAsyncOperationResult.cs | 54 +- .../Generated/Models/AzureFirewall.cs | 258 +- .../Models/AzureFirewallApplicationRule.cs | 97 +- .../AzureFirewallApplicationRuleCollection.cs | 139 +- ...plicationRuleCollectionPropertiesFormat.cs | 101 + .../AzureFirewallApplicationRuleProtocol.cs | 65 +- ...zureFirewallApplicationRuleProtocolType.cs | 13 +- .../Generated/Models/AzureFirewallFqdnTag.cs | 88 +- .../AzureFirewallFqdnTagPropertiesFormat.cs | 58 + .../Models/AzureFirewallIPConfiguration.cs | 141 +- ...FirewallIPConfigurationPropertiesFormat.cs | 85 + .../Generated/Models/AzureFirewallIpGroups.cs | 35 +- .../Models/AzureFirewallNatRCAction.cs | 29 +- .../Models/AzureFirewallNatRCActionType.cs | 13 +- .../Generated/Models/AzureFirewallNatRule.cs | 136 +- .../Models/AzureFirewallNatRuleCollection.cs | 139 +- ...zureFirewallNatRuleCollectionProperties.cs | 101 + .../Models/AzureFirewallNetworkRule.cs | 114 +- .../AzureFirewallNetworkRuleCollection.cs | 138 +- ...llNetworkRuleCollectionPropertiesFormat.cs | 101 + .../AzureFirewallNetworkRuleProtocol.cs | 15 +- .../Models/AzureFirewallPacketCaptureFlags.cs | 35 +- .../AzureFirewallPacketCaptureFlagsType.cs | 13 +- .../Models/AzureFirewallPacketCaptureRule.cs | 61 +- .../Models/AzureFirewallPropertiesFormat.cs | 171 + .../Models/AzureFirewallPublicIPAddress.cs | 31 +- .../Generated/Models/AzureFirewallRCAction.cs | 29 +- .../Models/AzureFirewallRCActionType.cs | 13 +- .../Generated/Models/AzureFirewallSku.cs | 43 +- .../Generated/Models/AzureFirewallSkuName.cs | 17 +- .../Generated/Models/AzureFirewallSkuTier.cs | 13 +- .../Models/AzureFirewallThreatIntelMode.cs | 13 +- .../AzureFirewallsPacketCaptureHeaders.cs | 34 +- .../Models/AzureReachabilityReport.cs | 78 +- .../Models/AzureReachabilityReportItem.cs | 56 +- .../AzureReachabilityReportLatencyInfo.cs | 60 +- .../Models/AzureReachabilityReportLocation.cs | 61 +- .../AzureReachabilityReportParameters.cs | 92 +- .../Generated/Models/AzureWebCategory.cs | 81 +- .../AzureWebCategoryPropertiesFormat.cs | 48 + .../Generated/Models/BGPCommunity.cs | 94 +- ...ackendAddressInboundNatRulePortMappings.cs | 36 +- .../Generated/Models/BackendAddressPool.cs | 252 +- .../BackendAddressPoolPropertiesFormat.cs | 166 + .../Generated/Models/BaseAdminRule.cs | 45 +- .../Generated/Models/BastionActiveSession.cs | 134 +- .../Models/BastionConnectProtocol.cs | 13 +- .../Generated/Models/BastionHost.cs | 264 +- .../Models/BastionHostIPConfiguration.cs | 141 +- ...tionHostIPConfigurationPropertiesFormat.cs | 99 + .../Models/BastionHostPropertiesFormat.cs | 187 + .../BastionHostPropertiesFormatNetworkAcls.cs | 36 +- .../Generated/Models/BastionHostSkuName.cs | 13 +- .../Generated/Models/BastionSessionState.cs | 46 +- .../Generated/Models/BastionShareableLink.cs | 73 +- .../Models/BastionShareableLinkListRequest.cs | 35 +- .../BastionShareableLinkTokenListRequest.cs | 35 +- .../Generated/Models/BgpConnection.cs | 154 +- .../Models/BgpConnectionProperties.cs | 113 + .../Generated/Models/BgpPeerState.cs | 13 +- .../Generated/Models/BgpPeerStatus.cs | 124 +- .../Models/BgpPeerStatusListResult.cs | 29 +- .../Generated/Models/BgpServiceCommunity.cs | 66 +- .../BgpServiceCommunityPropertiesFormat.cs | 58 + .../Generated/Models/BgpSettings.cs | 86 +- .../Models/BreakOutCategoryPolicies.cs | 48 +- ...heckPrivateLinkServiceVisibilityRequest.cs | 32 +- .../Generated/Models/ChildResource.cs | 64 +- .../Models/CircuitConnectionStatus.cs | 13 +- .../Generated/Models/CommissionedState.cs | 13 +- .../Generated/Models/ConfigurationGroup.cs | 71 +- .../Generated/Models/ConfigurationType.cs | 13 +- .../Generated/Models/ConnectionMonitor.cs | 192 +- .../Models/ConnectionMonitorDestination.cs | 77 +- .../Models/ConnectionMonitorEndpoint.cs | 122 +- .../Models/ConnectionMonitorEndpointFilter.cs | 51 +- .../ConnectionMonitorEndpointFilterItem.cs | 49 +- ...ConnectionMonitorEndpointFilterItemType.cs | 13 +- .../ConnectionMonitorEndpointFilterType.cs | 13 +- .../Models/ConnectionMonitorEndpointScope.cs | 55 +- .../ConnectionMonitorEndpointScopeItem.cs | 33 +- .../ConnectionMonitorHttpConfiguration.cs | 123 +- .../ConnectionMonitorIcmpConfiguration.cs | 37 +- .../Models/ConnectionMonitorOutput.cs | 43 +- .../Models/ConnectionMonitorParameters.cs | 173 +- .../Models/ConnectionMonitorQueryResult.cs | 47 +- .../Models/ConnectionMonitorResult.cs | 305 +- .../ConnectionMonitorResultProperties.cs | 119 + .../Models/ConnectionMonitorSource.cs | 59 +- .../Models/ConnectionMonitorSourceStatus.cs | 13 +- .../ConnectionMonitorSuccessThreshold.cs | 56 +- .../ConnectionMonitorTcpConfiguration.cs | 73 +- .../ConnectionMonitorTestConfiguration.cs | 153 +- ...nectionMonitorTestConfigurationProtocol.cs | 13 +- .../Models/ConnectionMonitorTestGroup.cs | 96 +- .../Generated/Models/ConnectionMonitorType.cs | 13 +- .../ConnectionMonitorWorkspaceSettings.cs | 35 +- .../Models/ConnectionResetSharedKey.cs | 42 +- .../Generated/Models/ConnectionSharedKey.cs | 40 +- .../Generated/Models/ConnectionState.cs | 13 +- .../Models/ConnectionStateSnapshot.cs | 187 +- .../Generated/Models/ConnectionStatus.cs | 13 +- .../Models/ConnectivityConfiguration.cs | 186 +- .../ConnectivityConfigurationProperties.cs | 152 + ...ConnectivityConfigurationsDeleteHeaders.cs | 38 +- .../Models/ConnectivityDestination.cs | 72 +- .../Generated/Models/ConnectivityGroupItem.cs | 80 +- .../Generated/Models/ConnectivityHop.cs | 111 +- .../Models/ConnectivityInformation.cs | 98 +- .../Generated/Models/ConnectivityIssue.cs | 78 +- .../Models/ConnectivityParameters.cs | 96 +- .../Generated/Models/ConnectivitySource.cs | 63 +- .../Generated/Models/ConnectivityTopology.cs | 13 +- .../Generated/Models/Container.cs | 18 +- .../Models/ContainerNetworkInterface.cs | 133 +- .../ContainerNetworkInterfaceConfiguration.cs | 128 +- ...kInterfaceConfigurationPropertiesFormat.cs | 74 + ...ontainerNetworkInterfaceIpConfiguration.cs | 88 +- ...nterfaceIpConfigurationPropertiesFormat.cs | 50 + ...ntainerNetworkInterfacePropertiesFormat.cs | 82 + .../Generated/Models/CoverageLevel.cs | 13 +- .../Generated/Models/CreatedByType.cs | 13 +- .../Generated/Models/Criterion.cs | 73 +- .../Generated/Models/CrossTenantScopes.cs | 49 +- .../Models/CustomDnsConfigPropertiesFormat.cs | 50 +- .../Generated/Models/CustomIpPrefix.cs | 304 +- .../Models/CustomIpPrefixPropertiesFormat.cs | 194 + .../Generated/Models/CustomIpPrefixType.cs | 13 +- .../Models/DdosCustomPoliciesDeleteHeaders.cs | 38 +- .../Generated/Models/DdosCustomPolicy.cs | 98 +- .../DdosCustomPolicyPropertiesFormat.cs | 62 + .../Generated/Models/DdosProtectionPlan.cs | 163 +- .../DdosProtectionPlanPropertiesFormat.cs | 86 + .../DdosProtectionPlansDeleteHeaders.cs | 38 +- .../Generated/Models/DdosSettings.cs | 47 +- .../Models/DdosSettingsProtectionMode.cs | 13 +- .../Models/DefaultAdminPropertiesFormat.cs | 163 + .../Generated/Models/DefaultAdminRule.cs | 210 +- .../Models/DefaultRuleSetPropertyFormat.cs | 58 + .../Generated/Models/Delegation.cs | 117 +- .../Generated/Models/DelegationProperties.cs | 40 +- ...eleteBastionShareableLinkByTokenHeaders.cs | 34 +- .../Generated/Models/DeleteExistingPeering.cs | 13 +- .../Generated/Models/DeleteOptions.cs | 13 +- .../Generated/Models/DeploymentStatus.cs | 13 +- .../Models/DestinationPortBehavior.cs | 13 +- .../Generated/Models/DeviceProperties.cs | 45 +- .../Generated/Models/DhGroup.cs | 13 +- .../Generated/Models/DhcpOptions.cs | 36 +- .../Generated/Models/Dimension.cs | 47 +- .../Generated/Models/Direction.cs | 13 +- .../Models/DnsNameAvailabilityResult.cs | 25 +- .../Generated/Models/DnsSettings.cs | 54 +- .../Generated/Models/DscpConfiguration.cs | 201 +- .../DscpConfigurationPropertiesFormat.cs | 149 + .../Models/EffectiveAdminRuleKind.cs | 19 + .../Models/EffectiveBaseSecurityAdminRule.cs | 78 +- .../EffectiveConnectivityConfiguration.cs | 185 +- .../EffectiveDefaultSecurityAdminRule.cs | 217 +- .../Models/EffectiveNetworkSecurityGroup.cs | 72 +- ...ffectiveNetworkSecurityGroupAssociation.cs | 53 +- ...EffectiveNetworkSecurityGroupListResult.cs | 47 +- .../Models/EffectiveNetworkSecurityRule.cs | 237 +- .../Generated/Models/EffectiveRoute.cs | 119 +- .../Models/EffectiveRouteListResult.cs | 40 +- .../Models/EffectiveRouteMapRoute.cs | 47 +- .../Models/EffectiveRouteMapRouteList.cs | 35 +- .../Generated/Models/EffectiveRouteSource.cs | 13 +- .../Generated/Models/EffectiveRouteState.cs | 13 +- .../Models/EffectiveRoutesParameters.cs | 47 +- .../Models/EffectiveSecurityAdminRule.cs | 242 +- .../Models/EffectiveSecurityRuleProtocol.cs | 13 +- .../Generated/Models/EndpointServiceResult.cs | 41 +- .../Generated/Models/EndpointType.cs | 15 +- .../Generated/Models/Error.cs | 69 +- .../Generated/Models/ErrorDetails.cs | 45 +- .../Generated/Models/ErrorException.cs | 22 +- .../Generated/Models/ErrorResponse.cs | 30 +- .../Models/ErrorResponseException.cs | 25 +- .../Models/EvaluatedNetworkSecurityGroup.cs | 72 +- .../Generated/Models/EvaluationState.cs | 13 +- .../Generated/Models/ExclusionManagedRule.cs | 33 +- .../Models/ExclusionManagedRuleGroup.cs | 58 +- .../Models/ExclusionManagedRuleSet.cs | 68 +- .../Generated/Models/ExplicitProxy.cs | 128 +- .../Generated/Models/ExpressRouteCircuit.cs | 276 +- .../Models/ExpressRouteCircuitArpTable.cs | 61 +- .../ExpressRouteCircuitAuthorization.cs | 116 +- .../Models/ExpressRouteCircuitConnection.cs | 188 +- ...sRouteCircuitConnectionPropertiesFormat.cs | 115 + .../Models/ExpressRouteCircuitPeering.cs | 366 +- ...rcuitPeeringAdvertisedPublicPrefixState.cs | 16 +- .../ExpressRouteCircuitPeeringConfig.cs | 100 +- .../Models/ExpressRouteCircuitPeeringId.cs | 32 +- ...ressRouteCircuitPeeringPropertiesFormat.cs | 280 ++ .../Models/ExpressRouteCircuitPeeringState.cs | 13 +- .../ExpressRouteCircuitPropertiesFormat.cs | 204 + .../Models/ExpressRouteCircuitReference.cs | 31 +- .../Models/ExpressRouteCircuitRoutesTable.cs | 80 +- .../ExpressRouteCircuitRoutesTableSummary.cs | 90 +- ...ssRouteCircuitServiceProviderProperties.cs | 51 +- .../Models/ExpressRouteCircuitSku.cs | 53 +- .../Models/ExpressRouteCircuitSkuFamily.cs | 13 +- .../Models/ExpressRouteCircuitSkuTier.cs | 13 +- .../Models/ExpressRouteCircuitStats.cs | 59 +- .../ExpressRouteCircuitsArpTableListResult.cs | 49 +- ...pressRouteCircuitsRoutesTableListResult.cs | 46 +- ...uteCircuitsRoutesTableSummaryListResult.cs | 46 +- .../Models/ExpressRouteConnection.cs | 170 +- .../Models/ExpressRouteConnectionId.cs | 25 +- .../Models/ExpressRouteConnectionList.cs | 29 +- .../ExpressRouteConnectionProperties.cs | 139 + .../Models/ExpressRouteCrossConnection.cs | 201 +- .../ExpressRouteCrossConnectionPeering.cs | 284 +- ...ssRouteCrossConnectionPeeringProperties.cs | 223 ++ .../ExpressRouteCrossConnectionProperties.cs | 140 + ...sRouteCrossConnectionRoutesTableSummary.cs | 78 +- ...ConnectionsRoutesTableSummaryListResult.cs | 46 +- .../Generated/Models/ExpressRouteGateway.cs | 154 +- .../Models/ExpressRouteGatewayList.cs | 29 +- .../Models/ExpressRouteGatewayProperties.cs | 116 + ...GatewayPropertiesAutoScaleConfiguration.cs | 32 +- ...yPropertiesAutoScaleConfigurationBounds.cs | 51 +- .../Generated/Models/ExpressRouteLink.cs | 177 +- .../Models/ExpressRouteLinkAdminState.cs | 13 +- .../Models/ExpressRouteLinkConnectorType.cs | 13 +- .../Models/ExpressRouteLinkMacSecCipher.cs | 13 +- .../Models/ExpressRouteLinkMacSecConfig.cs | 82 +- .../Models/ExpressRouteLinkMacSecSciState.cs | 13 +- .../ExpressRouteLinkPropertiesFormat.cs | 131 + .../Models/ExpressRoutePeeringState.cs | 13 +- .../Models/ExpressRoutePeeringType.cs | 13 +- .../Generated/Models/ExpressRoutePort.cs | 244 +- .../Models/ExpressRoutePortAuthorization.cs | 133 +- ...sRoutePortAuthorizationPropertiesFormat.cs | 82 + .../ExpressRoutePortAuthorizationUseStatus.cs | 13 +- .../ExpressRoutePortPropertiesFormat.cs | 166 + .../Models/ExpressRoutePortsBillingType.cs | 13 +- .../Models/ExpressRoutePortsEncapsulation.cs | 13 +- .../Models/ExpressRoutePortsLocation.cs | 101 +- .../ExpressRoutePortsLocationBandwidths.cs | 43 +- ...pressRoutePortsLocationPropertiesFormat.cs | 81 + .../Models/ExpressRouteProviderPort.cs | 153 +- .../ExpressRouteProviderPortListResult.cs | 47 +- .../ExpressRouteProviderPortProperties.cs | 118 + .../Models/ExpressRouteServiceProvider.cs | 92 +- ...ssRouteServiceProviderBandwidthsOffered.cs | 41 +- ...essRouteServiceProviderPropertiesFormat.cs | 68 + .../Generated/Models/ExtendedLocation.cs | 39 +- .../Generated/Models/ExtendedLocationTypes.cs | 13 +- .../Generated/Models/FilterItems.cs | 41 +- .../Models/FirewallPacketCaptureParameters.cs | 143 +- .../FirewallPacketCaptureParametersFormat.cs | 144 + .../Generated/Models/FirewallPolicy.cs | 313 +- .../FirewallPolicyCertificateAuthority.cs | 48 +- .../FirewallPolicyFilterRuleCollection.cs | 62 +- ...irewallPolicyFilterRuleCollectionAction.cs | 35 +- ...allPolicyFilterRuleCollectionActionType.cs | 13 +- .../FirewallPolicyHttpHeaderToInsert.cs | 41 +- .../FirewallPolicyIDPSQuerySortOrder.cs | 17 +- .../FirewallPolicyIdpsSignatureDirection.cs | 69 + .../Models/FirewallPolicyIdpsSignatureMode.cs | 57 + .../FirewallPolicyIdpsSignatureSeverity.cs | 57 + .../Models/FirewallPolicyInsights.cs | 57 +- .../FirewallPolicyIntrusionDetection.cs | 71 +- ...ionDetectionBypassTrafficSpecifications.cs | 118 +- ...llPolicyIntrusionDetectionConfiguration.cs | 73 +- ...wallPolicyIntrusionDetectionProfileType.cs | 13 +- ...irewallPolicyIntrusionDetectionProtocol.cs | 15 +- ...ntrusionDetectionSignatureSpecification.cs | 45 +- ...rewallPolicyIntrusionDetectionStateType.cs | 13 +- .../FirewallPolicyLogAnalyticsResources.cs | 47 +- .../FirewallPolicyLogAnalyticsWorkspace.cs | 42 +- .../Models/FirewallPolicyNatRuleCollection.cs | 62 +- .../FirewallPolicyNatRuleCollectionAction.cs | 34 +- ...rewallPolicyNatRuleCollectionActionType.cs | 15 +- .../Models/FirewallPolicyPropertiesFormat.cs | 231 ++ .../Generated/Models/FirewallPolicyRule.cs | 35 +- .../FirewallPolicyRuleApplicationProtocol.cs | 63 +- ...rewallPolicyRuleApplicationProtocolType.cs | 13 +- .../Models/FirewallPolicyRuleCollection.cs | 59 +- .../FirewallPolicyRuleCollectionGroup.cs | 163 +- ...wallPolicyRuleCollectionGroupProperties.cs | 115 + .../FirewallPolicyRuleCollectionType.cs | 19 + .../FirewallPolicyRuleNetworkProtocol.cs | 15 +- .../Models/FirewallPolicyRuleType.cs | 20 + .../Generated/Models/FirewallPolicySNAT.cs | 58 +- .../Generated/Models/FirewallPolicySQL.cs | 33 +- .../Generated/Models/FirewallPolicySku.cs | 29 +- .../Generated/Models/FirewallPolicySkuTier.cs | 13 +- .../FirewallPolicyThreatIntelWhitelist.cs | 47 +- .../Models/FirewallPolicyTransportSecurity.cs | 32 +- .../Generated/Models/FlowLog.cs | 186 +- .../Models/FlowLogFormatParameters.cs | 40 +- .../Generated/Models/FlowLogFormatType.cs | 15 +- .../Generated/Models/FlowLogInformation.cs | 119 +- .../Generated/Models/FlowLogProperties.cs | 94 + .../Models/FlowLogPropertiesFormat.cs | 143 + .../Models/FlowLogStatusParameters.cs | 43 +- .../Models/FrontendIPConfiguration.cs | 260 +- ...FrontendIPConfigurationPropertiesFormat.cs | 161 + ...atewayCustomBgpIpAddressIpConfiguration.cs | 62 +- .../GatewayLoadBalancerTunnelInterface.cs | 77 +- .../GatewayLoadBalancerTunnelInterfaceType.cs | 13 +- .../GatewayLoadBalancerTunnelProtocol.cs | 15 +- .../Generated/Models/GatewayRoute.cs | 97 +- .../Models/GatewayRouteListResult.cs | 29 +- .../GenerateExpressRoutePortsLOARequest.cs | 39 +- .../GenerateExpressRoutePortsLOAResult.cs | 32 +- .../Generated/Models/Geo.cs | 25 +- .../Models/GetInboundRoutesParameters.cs | 47 +- .../Models/GetOutboundRoutesParameters.cs | 57 +- .../Models/GetVpnSitesConfigurationRequest.cs | 63 +- .../Generated/Models/GroupByUserSession.cs | 41 +- .../Generated/Models/GroupByVariable.cs | 37 +- .../Generated/Models/GroupConnectivity.cs | 13 +- .../Generated/Models/HTTPConfiguration.cs | 60 +- .../Models/HTTPConfigurationMethod.cs | 17 +- .../Generated/Models/HTTPHeader.cs | 45 +- .../Generated/Models/HTTPMethod.cs | 17 +- .../Generated/Models/HopLink.cs | 155 +- .../Generated/Models/HopLinkProperties.cs | 110 + .../Generated/Models/Hub.cs | 35 +- .../Models/HubBgpConnectionStatus.cs | 13 +- .../Generated/Models/HubIPAddresses.cs | 37 +- .../HubIPConfigurationPropertiesFormat.cs | 88 + .../Generated/Models/HubIpConfiguration.cs | 135 +- .../Generated/Models/HubPublicIPAddresses.cs | 50 +- .../Generated/Models/HubRoute.cs | 108 +- .../Generated/Models/HubRouteTable.cs | 139 +- .../Models/HubRouteTableProperties.cs | 88 + .../Generated/Models/HubRoutingPreference.cs | 13 +- .../Models/HubVirtualNetworkConnection.cs | 153 +- .../HubVirtualNetworkConnectionProperties.cs | 101 + .../HubVirtualNetworkConnectionStatus.cs | 13 +- .../Generated/Models/IDPSQueryObject.cs | 95 +- .../Models/IPAddressAvailabilityResult.cs | 62 +- .../Generated/Models/IPAllocationMethod.cs | 13 +- .../Generated/Models/IPConfiguration.cs | 126 +- .../IPConfigurationBgpPeeringAddress.cs | 73 +- .../Models/IPConfigurationProfile.cs | 101 +- .../IPConfigurationProfilePropertiesFormat.cs | 60 + .../Models/IPConfigurationPropertiesFormat.cs | 88 + .../Generated/Models/IPPrefixesList.cs | 31 +- .../Generated/Models/IPRule.cs | 30 +- .../Generated/Models/IPVersion.cs | 13 +- .../Generated/Models/IkeEncryption.cs | 17 +- .../Generated/Models/IkeIntegrity.cs | 17 +- .../Generated/Models/InboundNatPool.cs | 254 +- .../Models/InboundNatPoolPropertiesFormat.cs | 169 + .../Generated/Models/InboundNatRule.cs | 308 +- .../Models/InboundNatRulePortMapping.cs | 60 +- .../Models/InboundNatRulePropertiesFormat.cs | 194 + .../Generated/Models/InboundSecurityRule.cs | 95 +- .../Models/InboundSecurityRuleProperties.cs | 58 + .../Generated/Models/InboundSecurityRules.cs | 72 +- .../Models/InboundSecurityRulesProtocol.cs | 13 +- .../InternetIngressPublicIpsProperties.cs | 33 +- .../Generated/Models/IpAllocation.cs | 161 +- .../Models/IpAllocationPropertiesFormat.cs | 119 + .../Generated/Models/IpAllocationType.cs | 13 +- .../Generated/Models/IpFlowProtocol.cs | 13 +- .../Generated/Models/IpGroup.cs | 121 +- .../Models/IpGroupPropertiesFormat.cs | 82 + .../Generated/Models/IpTag.cs | 37 +- .../Generated/Models/IpsecEncryption.cs | 19 +- .../Generated/Models/IpsecIntegrity.cs | 19 +- .../Generated/Models/IpsecPolicy.cs | 184 +- .../Models/Ipv6CircuitConnectionConfig.cs | 51 +- .../Ipv6ExpressRouteCircuitPeeringConfig.cs | 79 +- .../Generated/Models/IsGlobal.cs | 13 +- .../Generated/Models/IsWorkloadProtected.cs | 13 +- .../Generated/Models/IssueType.cs | 13 +- .../Generated/Models/LoadBalancer.cs | 255 +- .../Models/LoadBalancerBackendAddress.cs | 138 +- .../LoadBalancerBackendAddressAdminState.cs | 13 +- ...dBalancerBackendAddressPropertiesFormat.cs | 114 + .../LoadBalancerOutboundRuleProtocol.cs | 13 +- .../Models/LoadBalancerPropertiesFormat.cs | 155 + .../Generated/Models/LoadBalancerSku.cs | 43 +- .../Generated/Models/LoadBalancerSkuName.cs | 13 +- .../Generated/Models/LoadBalancerSkuTier.cs | 13 +- .../Models/LoadBalancerVipSwapRequest.cs | 34 +- ...erVipSwapRequestFrontendIPConfiguration.cs | 49 +- ...equestFrontendIPConfigurationProperties.cs | 48 + .../Generated/Models/LoadBalancingRule.cs | 318 +- .../LoadBalancingRulePropertiesFormat.cs | 215 + .../Generated/Models/LoadDistribution.cs | 13 +- .../Generated/Models/LocalNetworkGateway.cs | 153 +- .../LocalNetworkGatewayPropertiesFormat.cs | 116 + .../Generated/Models/LogSpecification.cs | 46 +- .../Models/ManagedRuleEnabledState.cs | 13 +- .../Models/ManagedRuleGroupOverride.cs | 58 +- .../Generated/Models/ManagedRuleOverride.cs | 68 +- .../Generated/Models/ManagedRuleSet.cs | 71 +- .../Models/ManagedRulesDefinition.cs | 63 +- .../Models/ManagedServiceIdentity.cs | 102 +- ...viceIdentityUserAssignedIdentitiesValue.cs | 43 +- .../Generated/Models/MatchCondition.cs | 102 +- .../Generated/Models/MatchVariable.cs | 52 +- .../Generated/Models/MatchedRule.cs | 42 +- .../Generated/Models/MetricSpecification.cs | 164 +- .../MigrateLoadBalancerToIpBasedRequest.cs | 41 +- .../Generated/Models/MigratedPools.cs | 33 +- .../Generated/Models/NatGateway.cs | 171 +- .../Models/NatGatewayPropertiesFormat.cs | 100 + .../Generated/Models/NatGatewaySku.cs | 29 +- .../Generated/Models/NatGatewaySkuName.cs | 13 +- .../Generated/Models/NatRule.cs | 116 +- .../Generated/Models/NatRulePortMapping.cs | 45 +- ...etworkConfigurationDiagnosticParameters.cs | 88 +- .../NetworkConfigurationDiagnosticProfile.cs | 122 +- .../NetworkConfigurationDiagnosticResponse.cs | 36 +- .../NetworkConfigurationDiagnosticResult.cs | 54 +- .../Generated/Models/NetworkGroup.cs | 95 +- .../Models/NetworkGroupProperties.cs | 68 + .../NetworkGroupsCreateOrUpdateHeaders.cs | 36 +- .../Models/NetworkGroupsDeleteHeaders.cs | 32 +- .../Generated/Models/NetworkIntentPolicy.cs | 56 +- .../Models/NetworkIntentPolicyBasedService.cs | 13 +- .../NetworkIntentPolicyConfiguration.cs | 47 +- .../Generated/Models/NetworkInterface.cs | 374 +- .../Models/NetworkInterfaceAssociation.cs | 46 +- .../Models/NetworkInterfaceAuxiliaryMode.cs | 13 +- .../Models/NetworkInterfaceAuxiliarySku.cs | 13 +- .../Models/NetworkInterfaceDnsSettings.cs | 124 +- .../Models/NetworkInterfaceIPConfiguration.cs | 277 +- ...gurationPrivateLinkConnectionProperties.cs | 60 +- ...nterfaceIPConfigurationPropertiesFormat.cs | 182 + .../Models/NetworkInterfaceMigrationPhase.cs | 13 +- .../Models/NetworkInterfaceNicType.cs | 13 +- .../NetworkInterfacePropertiesFormat.cs | 268 ++ .../NetworkInterfaceTapConfiguration.cs | 107 +- ...terfaceTapConfigurationPropertiesFormat.cs | 59 + .../Generated/Models/NetworkManager.cs | 155 +- .../Generated/Models/NetworkManagerCommit.cs | 78 +- .../NetworkManagerCommitsPostHeaders.cs | 38 +- .../Models/NetworkManagerConnection.cs | 94 +- .../NetworkManagerConnectionProperties.cs | 70 + .../Models/NetworkManagerDeploymentStatus.cs | 93 +- ...etworkManagerDeploymentStatusListResult.cs | 58 +- ...NetworkManagerDeploymentStatusParameter.cs | 62 +- ...tiveConnectivityConfigurationListResult.cs | 59 +- ...erEffectiveSecurityAdminRulesListResult.cs | 63 +- .../Models/NetworkManagerProperties.cs | 110 + ...rkManagerPropertiesNetworkManagerScopes.cs | 56 +- .../Models/NetworkManagerSecurityGroupItem.cs | 39 +- .../Models/NetworkManagersDeleteHeaders.cs | 38 +- .../Models/NetworkOperationStatus.cs | 13 +- .../Generated/Models/NetworkProfile.cs | 116 +- .../Models/NetworkProfilePropertiesFormat.cs | 78 + .../Generated/Models/NetworkRule.cs | 104 +- .../Generated/Models/NetworkSecurityGroup.cs | 176 +- .../NetworkSecurityGroupPropertiesFormat.cs | 122 + .../Models/NetworkSecurityGroupResult.cs | 44 +- .../NetworkSecurityRulesEvaluationResult.cs | 86 +- .../Models/NetworkVirtualAppliance.cs | 338 +- .../NetworkVirtualApplianceConnection.cs | 170 +- ...orkVirtualApplianceConnectionProperties.cs | 146 + ...irtualApplianceConnectionsDeleteHeaders.cs | 38 +- ...NetworkVirtualAppliancePropertiesFormat.cs | 259 ++ .../Models/NetworkVirtualApplianceSku.cs | 100 +- .../NetworkVirtualApplianceSkuInstances.cs | 43 +- ...workVirtualApplianceSkuPropertiesFormat.cs | 71 + ...kVirtualAppliancesCreateOrUpdateHeaders.cs | 38 +- .../NetworkVirtualAppliancesDeleteHeaders.cs | 38 +- .../Generated/Models/NetworkWatcher.cs | 76 +- .../Models/NetworkWatcherPropertiesFormat.cs | 48 + .../Generated/Models/NextHopParameters.cs | 91 +- .../Generated/Models/NextHopResult.cs | 67 +- .../Generated/Models/NextHopType.cs | 13 +- .../Generated/Models/NextStep.cs | 13 +- .../Models/O365BreakOutCategoryPolicies.cs | 52 +- .../Generated/Models/O365PolicyProperties.cs | 26 +- .../Models/Office365PolicyProperties.cs | 26 +- .../Generated/Models/OfficeTrafficCategory.cs | 13 +- .../Generated/Models/Operation.cs | 62 +- .../Generated/Models/OperationDisplay.cs | 57 +- .../Models/OperationPropertiesFormat.cs | 48 + ...ionPropertiesFormatServiceSpecification.cs | 47 +- .../Generated/Models/OrderBy.cs | 41 +- .../Generated/Models/Origin.cs | 13 +- .../Generated/Models/OutboundRule.cs | 199 +- .../Models/OutboundRulePropertiesFormat.cs | 139 + .../Generated/Models/OutputType.cs | 13 +- .../Models/OwaspCrsExclusionEntry.cs | 115 +- .../OwaspCrsExclusionEntryMatchVariable.cs | 13 +- ...pCrsExclusionEntrySelectorMatchOperator.cs | 13 +- .../Models/P2SConnectionConfiguration.cs | 162 +- .../P2SConnectionConfigurationProperties.cs | 108 + .../Models/P2SVpnConnectionHealth.cs | 31 +- .../Models/P2SVpnConnectionHealthRequest.cs | 55 +- .../Models/P2SVpnConnectionRequest.cs | 30 +- .../Generated/Models/P2SVpnGateway.cs | 174 +- .../Models/P2SVpnGatewayProperties.cs | 121 + .../Models/P2SVpnProfileParameters.cs | 29 +- .../Generated/Models/PacketCapture.cs | 174 +- .../Generated/Models/PacketCaptureFilter.cs | 139 +- .../Models/PacketCaptureMachineScope.cs | 50 +- .../Models/PacketCaptureParameters.cs | 171 +- .../Models/PacketCaptureQueryStatusResult.cs | 98 +- .../Generated/Models/PacketCaptureResult.cs | 236 +- .../Models/PacketCaptureResultProperties.cs | 87 + .../Models/PacketCaptureStorageLocation.cs | 78 +- .../Models/PacketCaptureTargetType.cs | 31 +- .../Generated/Models/Page.cs | 74 +- .../Generated/Models/Page1.cs | 74 +- .../Generated/Models/Parameter.cs | 49 +- .../PartnerManagedResourceProperties.cs | 53 +- .../Generated/Models/PatchObject.cs | 29 +- .../Generated/Models/PatchRouteFilter.cs | 142 +- .../Generated/Models/PatchRouteFilterRule.cs | 139 +- .../Generated/Models/PcError.cs | 13 +- .../Generated/Models/PcProtocol.cs | 13 +- .../Generated/Models/PcStatus.cs | 13 +- .../PeerExpressRouteCircuitConnection.cs | 188 +- ...sRouteCircuitConnectionPropertiesFormat.cs | 116 + .../Generated/Models/PeerRoute.cs | 97 +- .../Generated/Models/PfsGroup.cs | 15 +- .../Generated/Models/PolicySettings.cs | 184 +- .../Models/PolicySettingsLogScrubbing.cs | 45 +- .../Generated/Models/PreferredIPVersion.cs | 13 +- .../Models/PreferredRoutingGateway.cs | 13 +- .../Models/PrepareNetworkPoliciesRequest.cs | 51 +- .../Generated/Models/PrivateDnsZoneConfig.cs | 68 +- .../Generated/Models/PrivateDnsZoneGroup.cs | 93 +- .../PrivateDnsZoneGroupPropertiesFormat.cs | 60 + .../Models/PrivateDnsZonePropertiesFormat.cs | 60 + .../Generated/Models/PrivateEndpoint.cs | 215 +- .../Models/PrivateEndpointConnection.cs | 142 +- .../PrivateEndpointConnectionProperties.cs | 90 + .../Models/PrivateEndpointIPConfiguration.cs | 117 +- ...rivateEndpointIPConfigurationProperties.cs | 73 + .../Models/PrivateEndpointProperties.cs | 141 + .../Generated/Models/PrivateLinkService.cs | 204 +- .../Models/PrivateLinkServiceConnection.cs | 160 +- .../PrivateLinkServiceConnectionProperties.cs | 95 + .../PrivateLinkServiceConnectionState.cs | 60 +- .../PrivateLinkServiceIpConfiguration.cs | 160 +- ...ateLinkServiceIpConfigurationProperties.cs | 101 + .../Models/PrivateLinkServiceProperties.cs | 141 + ...rivateLinkServicePropertiesAutoApproval.cs | 28 +- .../PrivateLinkServicePropertiesVisibility.cs | 28 +- .../Models/PrivateLinkServiceVisibility.cs | 32 +- .../Generated/Models/Probe.cs | 260 +- .../Generated/Models/ProbePropertiesFormat.cs | 169 + .../Generated/Models/ProbeProtocol.cs | 13 +- .../Generated/Models/ProcessorArchitecture.cs | 13 +- .../Generated/Models/PropagatedRouteTable.cs | 40 +- .../Generated/Models/Protocol.cs | 13 +- .../Generated/Models/ProtocolConfiguration.cs | 30 +- .../Generated/Models/ProtocolType.cs | 13 +- .../Generated/Models/ProvisioningState.cs | 13 +- .../Generated/Models/PublicIPAddress.cs | 319 +- .../Models/PublicIPAddressDnsSettings.cs | 115 +- .../Models/PublicIPAddressMigrationPhase.cs | 13 +- .../Models/PublicIPAddressPropertiesFormat.cs | 205 + .../Generated/Models/PublicIPAddressSku.cs | 43 +- .../Models/PublicIPAddressSkuName.cs | 13 +- .../Models/PublicIPAddressSkuTier.cs | 13 +- ...cIPAddressesDdosProtectionStatusHeaders.cs | 38 +- .../Models/PublicIPAddressesDeleteHeaders.cs | 38 +- .../Generated/Models/PublicIPPrefix.cs | 232 +- .../Models/PublicIPPrefixPropertiesFormat.cs | 140 + .../Generated/Models/PublicIPPrefixSku.cs | 43 +- .../Generated/Models/PublicIPPrefixSkuName.cs | 13 +- .../Generated/Models/PublicIPPrefixSkuTier.cs | 13 +- ...pAddressDnsSettingsDomainNameLabelScope.cs | 29 +- .../PublicIpDdosProtectionStatusResult.cs | 82 +- .../Generated/Models/QosDefinition.cs | 88 +- .../Generated/Models/QosIpRange.cs | 35 +- .../Generated/Models/QosPortRange.cs | 35 +- .../QueryInboundNatRulePortMappingRequest.cs | 49 +- .../Generated/Models/QueryRequestOptions.cs | 35 +- .../Generated/Models/QueryResults.cs | 41 +- .../Models/QueryTroubleshootingParameters.cs | 46 +- .../Generated/Models/RadiusServer.cs | 57 +- .../Generated/Models/RecordSet.cs | 86 +- .../Models/ReferencedPublicIpAddress.cs | 25 +- .../Generated/Models/Resource.cs | 73 +- .../Generated/Models/ResourceIdentityType.cs | 29 +- .../Models/ResourceNavigationLink.cs | 112 +- .../Models/ResourceNavigationLinkFormat.cs | 68 + .../ResourceNavigationLinksListResult.cs | 47 +- .../Generated/Models/ResourceSet.cs | 29 +- .../Models/RetentionPolicyParameters.cs | 36 +- .../Generated/Models/Route.cs | 161 +- .../Generated/Models/RouteFilter.cs | 117 +- .../Models/RouteFilterPropertiesFormat.cs | 79 + .../Generated/Models/RouteFilterRule.cs | 151 +- .../Models/RouteFilterRulePropertiesFormat.cs | 103 + .../Generated/Models/RouteFilterRuleType.cs | 18 + .../Generated/Models/RouteMap.cs | 131 +- .../Generated/Models/RouteMapActionType.cs | 13 +- .../Models/RouteMapMatchCondition.cs | 13 +- .../Generated/Models/RouteMapProperties.cs | 81 + .../Generated/Models/RouteMapRule.cs | 73 +- .../Generated/Models/RouteNextHopType.cs | 13 +- .../Generated/Models/RoutePropertiesFormat.cs | 110 + .../Generated/Models/RouteTable.cs | 131 +- .../Models/RouteTablePropertiesFormat.cs | 90 + .../Generated/Models/RoutingConfiguration.cs | 83 +- .../Generated/Models/RoutingIntent.cs | 100 +- .../Models/RoutingIntentProperties.cs | 58 + .../Generated/Models/RoutingPolicy.cs | 75 +- .../Generated/Models/RoutingState.cs | 13 +- .../Generated/Models/ScopeConnection.cs | 106 +- .../Models/ScopeConnectionProperties.cs | 80 + .../Generated/Models/ScopeConnectionState.cs | 13 +- .../Models/ScrubbingRuleEntryMatchOperator.cs | 13 +- .../Models/ScrubbingRuleEntryMatchVariable.cs | 15 +- .../Models/ScrubbingRuleEntryState.cs | 13 +- .../Models/SecurityAdminConfiguration.cs | 109 +- ...urityAdminConfigurationPropertiesFormat.cs | 78 + ...ecurityAdminConfigurationsDeleteHeaders.cs | 38 +- .../Models/SecurityConfigurationRuleAccess.cs | 13 +- .../SecurityConfigurationRuleDirection.cs | 13 +- .../SecurityConfigurationRuleProtocol.cs | 13 +- .../Models/SecurityGroupNetworkInterface.cs | 47 +- .../Models/SecurityGroupViewParameters.cs | 41 +- .../Models/SecurityGroupViewResult.cs | 30 +- .../Models/SecurityPartnerProvider.cs | 119 +- ...SecurityPartnerProviderConnectionStatus.cs | 13 +- ...SecurityPartnerProviderPropertiesFormat.cs | 79 + .../Generated/Models/SecurityProviderName.cs | 13 +- .../Generated/Models/SecurityRule.cs | 348 +- .../Generated/Models/SecurityRuleAccess.cs | 13 +- .../Models/SecurityRuleAssociations.cs | 71 +- .../Generated/Models/SecurityRuleDirection.cs | 13 +- .../Models/SecurityRulePropertiesFormat.cs | 255 ++ .../Generated/Models/SecurityRuleProtocol.cs | 13 +- .../Models/ServiceAssociationLink.cs | 139 +- .../ServiceAssociationLinkPropertiesFormat.cs | 88 + .../ServiceAssociationLinksListResult.cs | 47 +- .../ServiceDelegationPropertiesFormat.cs | 70 + .../Generated/Models/ServiceEndpointPolicy.cs | 163 +- .../Models/ServiceEndpointPolicyDefinition.cs | 133 +- ...ndpointPolicyDefinitionPropertiesFormat.cs | 79 + .../ServiceEndpointPolicyPropertiesFormat.cs | 100 + .../Models/ServiceEndpointPropertiesFormat.cs | 61 +- .../ServiceProviderProvisioningState.cs | 13 +- .../Generated/Models/ServiceTagInformation.cs | 57 +- .../ServiceTagInformationPropertiesFormat.cs | 77 +- .../Generated/Models/ServiceTagsListResult.cs | 91 +- .../Generated/Models/SessionIds.cs | 29 +- .../Generated/Models/Severity.cs | 13 +- .../SignatureOverridesFilterValuesQuery.cs | 35 +- .../SignatureOverridesFilterValuesResponse.cs | 35 +- .../Generated/Models/SignaturesOverrides.cs | 67 +- .../Models/SignaturesOverridesList.cs | 35 +- .../Models/SignaturesOverridesProperties.cs | 35 +- .../Generated/Models/SingleQueryResult.cs | 172 +- .../Generated/Models/SingletonResource.cs | 45 + .../Generated/Models/Sku.cs | 29 +- .../Generated/Models/SlotType.cs | 25 +- .../Generated/Models/StaticMember.cs | 93 +- .../Models/StaticMemberProperties.cs | 68 + .../Generated/Models/StaticRoute.cs | 54 +- .../Generated/Models/StaticRoutesConfig.cs | 57 +- .../Generated/Models/SubResource.cs | 29 +- .../Generated/Models/Subnet.cs | 363 +- .../Generated/Models/SubnetAssociation.cs | 42 +- .../Models/SubnetPropertiesFormat.cs | 251 ++ .../Generated/Models/SwapResource.cs | 55 +- .../Models/SwapResourceListResult.cs | 33 +- .../Models/SwapResourceProperties.cs | 29 +- .../Generated/Models/SyncMode.cs | 13 +- .../Models/SyncRemoteAddressSpace.cs | 13 +- .../Generated/Models/SystemData.cs | 91 +- .../Generated/Models/TagsObject.cs | 29 +- .../Generated/Models/Topology.cs | 68 +- .../Generated/Models/TopologyAssociation.cs | 61 +- .../Generated/Models/TopologyParameters.cs | 51 +- .../Generated/Models/TopologyResource.cs | 67 +- ...TrafficAnalyticsConfigurationProperties.cs | 82 +- .../Models/TrafficAnalyticsProperties.cs | 29 +- .../Generated/Models/TrafficSelectorPolicy.cs | 54 +- .../Generated/Models/TransportProtocol.cs | 13 +- .../Models/TroubleshootingDetails.cs | 70 +- .../Models/TroubleshootingParameters.cs | 76 +- .../Models/TroubleshootingProperties.cs | 78 + .../TroubleshootingRecommendedActions.cs | 67 +- .../Generated/Models/TroubleshootingResult.cs | 60 +- .../Models/TunnelConnectionHealth.cs | 74 +- .../Models/TunnelConnectionStatus.cs | 13 +- .../Models/UnprepareNetworkPoliciesRequest.cs | 36 +- .../Generated/Models/Usage.cs | 72 +- .../Generated/Models/UsageName.cs | 36 +- .../Generated/Models/UsageUnit.cs | 18 + .../Generated/Models/UseHubGateway.cs | 13 +- .../Generated/Models/VM.cs | 38 +- .../Generated/Models/VerbosityLevel.cs | 13 +- .../Models/VerificationIPFlowParameters.cs | 184 +- .../Models/VerificationIPFlowResult.cs | 45 +- ...VirtualApplianceAdditionalNicProperties.cs | 50 +- .../Models/VirtualApplianceNicProperties.cs | 66 +- .../Generated/Models/VirtualApplianceSite.cs | 105 +- .../Models/VirtualApplianceSiteProperties.cs | 68 + .../Models/VirtualApplianceSkuProperties.cs | 52 +- .../Generated/Models/VirtualHub.cs | 400 +- .../Models/VirtualHubEffectiveRoute.cs | 72 +- .../Models/VirtualHubEffectiveRouteList.cs | 41 +- .../Generated/Models/VirtualHubId.cs | 37 +- .../Generated/Models/VirtualHubProperties.cs | 302 ++ .../Generated/Models/VirtualHubRoute.cs | 39 +- .../Generated/Models/VirtualHubRouteTable.cs | 29 +- .../Models/VirtualHubRouteTableV2.cs | 103 +- .../VirtualHubRouteTableV2Properties.cs | 68 + .../Generated/Models/VirtualHubRouteV2.cs | 59 +- .../Generated/Models/VirtualNetwork.cs | 311 +- .../Models/VirtualNetworkBgpCommunities.cs | 59 +- ...irtualNetworkConnectionGatewayReference.cs | 40 +- .../Models/VirtualNetworkEncryption.cs | 47 +- .../VirtualNetworkEncryptionEnforcement.cs | 13 +- .../Generated/Models/VirtualNetworkGateway.cs | 500 +-- .../VirtualNetworkGatewayAutoScaleBounds.cs | 43 +- ...ualNetworkGatewayAutoScaleConfiguration.cs | 32 +- .../Models/VirtualNetworkGatewayConnection.cs | 473 ++- ...rtualNetworkGatewayConnectionListEntity.cs | 424 +- ...wayConnectionListEntityPropertiesFormat.cs | 346 ++ .../VirtualNetworkGatewayConnectionMode.cs | 13 +- ...etworkGatewayConnectionPropertiesFormat.cs | 388 ++ ...VirtualNetworkGatewayConnectionProtocol.cs | 13 +- .../VirtualNetworkGatewayConnectionStatus.cs | 13 +- .../VirtualNetworkGatewayConnectionType.cs | 13 +- .../VirtualNetworkGatewayIPConfiguration.cs | 136 +- ...kGatewayIPConfigurationPropertiesFormat.cs | 90 + .../Models/VirtualNetworkGatewayNatRule.cs | 162 +- .../VirtualNetworkGatewayNatRuleProperties.cs | 98 + .../VirtualNetworkGatewayPolicyGroup.cs | 150 +- .../VirtualNetworkGatewayPolicyGroupMember.cs | 56 +- ...tualNetworkGatewayPolicyGroupProperties.cs | 106 + .../VirtualNetworkGatewayPropertiesFormat.cs | 346 ++ .../Models/VirtualNetworkGatewaySku.cs | 71 +- .../Models/VirtualNetworkGatewaySkuName.cs | 13 +- .../Models/VirtualNetworkGatewaySkuTier.cs | 13 +- .../Models/VirtualNetworkGatewayType.cs | 13 +- .../Generated/Models/VirtualNetworkPeering.cs | 332 +- .../Models/VirtualNetworkPeeringLevel.cs | 13 +- .../VirtualNetworkPeeringPropertiesFormat.cs | 226 ++ .../Models/VirtualNetworkPeeringState.cs | 13 +- ...alNetworkPrivateEndpointNetworkPolicies.cs | 13 +- ...etworkPrivateLinkServiceNetworkPolicies.cs | 13 +- .../Models/VirtualNetworkPropertiesFormat.cs | 227 ++ .../Generated/Models/VirtualNetworkTap.cs | 156 +- .../VirtualNetworkTapPropertiesFormat.cs | 105 + .../Generated/Models/VirtualNetworkUsage.cs | 69 +- .../Models/VirtualNetworkUsageName.cs | 36 +- .../Generated/Models/VirtualRouter.cs | 156 +- .../VirtualRouterAutoScaleConfiguration.cs | 44 +- .../Generated/Models/VirtualRouterPeering.cs | 125 +- .../Models/VirtualRouterPeeringProperties.cs | 90 + .../Models/VirtualRouterPropertiesFormat.cs | 123 + .../Generated/Models/VirtualWAN.cs | 166 +- .../Generated/Models/VirtualWanProperties.cs | 118 + .../Models/VirtualWanSecurityProvider.cs | 49 +- .../Models/VirtualWanSecurityProviderType.cs | 13 +- .../Models/VirtualWanSecurityProviders.cs | 36 +- .../Models/VirtualWanVpnProfileParameters.cs | 49 +- .../Models/VnetLocalRouteOverrideCriteria.cs | 13 +- .../Generated/Models/VnetRoute.cs | 58 +- .../VngClientConnectionConfiguration.cs | 133 +- ...ClientConnectionConfigurationProperties.cs | 91 + .../Generated/Models/VpnAuthenticationType.cs | 13 +- .../Models/VpnClientConfiguration.cs | 208 +- .../Models/VpnClientConnectionHealth.cs | 74 +- .../Models/VpnClientConnectionHealthDetail.cs | 153 +- ...nClientConnectionHealthDetailListResult.cs | 35 +- .../Models/VpnClientIPsecParameters.cs | 184 +- .../Generated/Models/VpnClientParameters.cs | 89 +- .../Generated/Models/VpnClientProtocol.cs | 15 +- .../Models/VpnClientRevokedCertificate.cs | 94 +- ...lientRevokedCertificatePropertiesFormat.cs | 59 + .../Models/VpnClientRootCertificate.cs | 97 +- ...pnClientRootCertificatePropertiesFormat.cs | 73 + .../Generated/Models/VpnConnection.cs | 315 +- ...nConnectionPacketCaptureStartParameters.cs | 51 +- ...pnConnectionPacketCaptureStopParameters.cs | 53 +- .../Models/VpnConnectionProperties.cs | 232 ++ .../Generated/Models/VpnConnectionStatus.cs | 13 +- .../Models/VpnDeviceScriptParameters.cs | 47 +- .../Generated/Models/VpnGateway.cs | 195 +- .../Generated/Models/VpnGatewayGeneration.cs | 13 +- .../Models/VpnGatewayIpConfiguration.cs | 53 +- .../Generated/Models/VpnGatewayNatRule.cs | 181 +- .../Models/VpnGatewayNatRuleProperties.cs | 118 + .../VpnGatewayPacketCaptureStartParameters.cs | 32 +- .../VpnGatewayPacketCaptureStopParameters.cs | 34 +- .../Generated/Models/VpnGatewayProperties.cs | 148 + .../Models/VpnGatewayTunnelingProtocol.cs | 13 +- .../Generated/Models/VpnLinkBgpSettings.cs | 38 +- .../Generated/Models/VpnLinkConnectionMode.cs | 13 +- .../Models/VpnLinkProviderProperties.cs | 35 +- .../Generated/Models/VpnNatRuleMapping.cs | 36 +- .../Generated/Models/VpnNatRuleMode.cs | 13 +- .../Generated/Models/VpnNatRuleType.cs | 13 +- .../Models/VpnPacketCaptureStartParameters.cs | 31 +- .../Models/VpnPacketCaptureStopParameters.cs | 34 +- .../Models/VpnPolicyMemberAttributeType.cs | 13 +- .../Generated/Models/VpnProfileResponse.cs | 27 +- ...ServerConfigRadiusClientRootCertificate.cs | 45 +- ...ServerConfigRadiusServerRootCertificate.cs | 41 +- ...ServerConfigVpnClientRevokedCertificate.cs | 45 +- ...VpnServerConfigVpnClientRootCertificate.cs | 41 +- .../Models/VpnServerConfiguration.cs | 285 +- .../VpnServerConfigurationPolicyGroup.cs | 151 +- ...VpnServerConfigurationPolicyGroupMember.cs | 56 +- ...erverConfigurationPolicyGroupProperties.cs | 90 + .../VpnServerConfigurationProperties.cs | 208 + .../Models/VpnServerConfigurationsResponse.cs | 39 +- .../Generated/Models/VpnSite.cs | 200 +- .../Generated/Models/VpnSiteId.cs | 29 +- .../Generated/Models/VpnSiteLink.cs | 135 +- .../Generated/Models/VpnSiteLinkConnection.cs | 310 +- .../Models/VpnSiteLinkConnectionProperties.cs | 219 + .../Generated/Models/VpnSiteLinkProperties.cs | 88 + .../Generated/Models/VpnSiteProperties.cs | 159 + .../Generated/Models/VpnType.cs | 13 +- .../Models/WebApplicationFirewallAction.cs | 13 +- .../WebApplicationFirewallCustomRule.cs | 205 +- .../WebApplicationFirewallEnabledState.cs | 13 +- .../WebApplicationFirewallMatchVariable.cs | 13 +- .../Models/WebApplicationFirewallMode.cs | 13 +- .../Models/WebApplicationFirewallOperator.cs | 13 +- .../Models/WebApplicationFirewallPolicy.cs | 209 +- ...plicationFirewallPolicyPropertiesFormat.cs | 165 + ...bApplicationFirewallPolicyResourceState.cs | 13 +- .../Models/WebApplicationFirewallRuleType.cs | 13 +- .../WebApplicationFirewallScrubbingRules.cs | 108 +- .../WebApplicationFirewallScrubbingState.cs | 13 +- .../Models/WebApplicationFirewallState.cs | 13 +- .../Models/WebApplicationFirewallTransform.cs | 13 +- .../Generated/NatGatewaysOperations.cs | 833 ++-- .../NatGatewaysOperationsExtensions.cs | 711 ++-- .../Generated/NatRulesOperations.cs | 556 +-- .../Generated/NatRulesOperationsExtensions.cs | 590 ++- .../Generated/NetworkGroupsOperations.cs | 588 +-- .../NetworkGroupsOperationsExtensions.cs | 595 ++- ...workInterfaceIPConfigurationsOperations.cs | 314 +- ...aceIPConfigurationsOperationsExtensions.cs | 234 +- ...NetworkInterfaceLoadBalancersOperations.cs | 211 +- ...erfaceLoadBalancersOperationsExtensions.cs | 149 +- ...orkInterfaceTapConfigurationsOperations.cs | 553 +-- ...ceTapConfigurationsOperationsExtensions.cs | 582 ++- .../Generated/NetworkInterfacesOperations.cs | 2305 ++++++----- .../NetworkInterfacesOperationsExtensions.cs | 2100 +++++----- .../Generated/NetworkManagementClient.cs | 2838 ++++++------- .../NetworkManagementClientExtensions.cs | 2110 +++++----- .../NetworkManagerCommitsOperations.cs | 170 +- ...tworkManagerCommitsOperationsExtensions.cs | 173 +- ...etworkManagerDeploymentStatusOperations.cs | 149 +- ...gerDeploymentStatusOperationsExtensions.cs | 110 +- .../Generated/NetworkManagersOperations.cs | 857 ++-- .../NetworkManagersOperationsExtensions.cs | 744 ++-- .../Generated/NetworkProfilesOperations.cs | 823 ++-- .../NetworkProfilesOperationsExtensions.cs | 632 ++- .../NetworkSecurityGroupsOperations.cs | 836 ++-- ...tworkSecurityGroupsOperationsExtensions.cs | 723 ++-- ...rkVirtualApplianceConnectionsOperations.cs | 574 +-- ...pplianceConnectionsOperationsExtensions.cs | 594 ++- .../NetworkVirtualAppliancesOperations.cs | 846 ++-- ...rkVirtualAppliancesOperationsExtensions.cs | 715 ++-- .../Generated/NetworkWatchersOperations.cs | 2199 +++++----- .../NetworkWatchersOperationsExtensions.cs | 2441 ++++++------ .../Generated/Operations.cs | 202 +- .../Generated/OperationsExtensions.cs | 125 +- .../Generated/P2sVpnGatewaysOperations.cs | 1454 ++++--- .../P2sVpnGatewaysOperationsExtensions.cs | 1696 ++++---- .../Generated/PacketCapturesOperations.cs | 669 ++-- .../PacketCapturesOperationsExtensions.cs | 859 ++-- ...xpressRouteCircuitConnectionsOperations.cs | 320 +- ...eCircuitConnectionsOperationsExtensions.cs | 270 +- .../PrivateDnsZoneGroupsOperations.cs | 548 +-- ...rivateDnsZoneGroupsOperationsExtensions.cs | 598 ++- .../Generated/PrivateEndpointsOperations.cs | 691 ++-- .../PrivateEndpointsOperationsExtensions.cs | 632 ++- .../PrivateLinkServicesOperations.cs | 1795 +++++---- ...PrivateLinkServicesOperationsExtensions.cs | 1830 ++++----- .../Generated/PublicIPAddressesOperations.cs | 1931 +++++---- .../PublicIPAddressesOperationsExtensions.cs | 1891 +++++---- .../Generated/PublicIPPrefixesOperations.cs | 833 ++-- .../PublicIPPrefixesOperationsExtensions.cs | 711 ++-- .../ResourceNavigationLinksOperations.cs | 131 +- ...urceNavigationLinksOperationsExtensions.cs | 100 +- .../Generated/RouteFilterRulesOperations.cs | 557 +-- .../RouteFilterRulesOperationsExtensions.cs | 582 ++- .../Generated/RouteFiltersOperations.cs | 833 ++-- .../RouteFiltersOperationsExtensions.cs | 711 ++-- .../Generated/RouteMapsOperations.cs | 567 +-- .../RouteMapsOperationsExtensions.cs | 582 ++- .../Generated/RouteTablesOperations.cs | 833 ++-- .../RouteTablesOperationsExtensions.cs | 711 ++-- .../Generated/RoutesOperations.cs | 557 +-- .../Generated/RoutesOperationsExtensions.cs | 582 ++- .../Generated/RoutingIntentOperations.cs | 556 +-- .../RoutingIntentOperationsExtensions.cs | 598 ++- .../Generated/ScopeConnectionsOperations.cs | 540 +-- .../ScopeConnectionsOperationsExtensions.cs | 448 +-- .../SdkInfo_NetworkManagementClient.cs | 178 - .../SecurityAdminConfigurationsOperations.cs | 567 +-- ...AdminConfigurationsOperationsExtensions.cs | 583 ++- .../SecurityPartnerProvidersOperations.cs | 832 ++-- ...ityPartnerProvidersOperationsExtensions.cs | 703 ++-- .../Generated/SecurityRulesOperations.cs | 557 +-- .../SecurityRulesOperationsExtensions.cs | 586 ++- .../ServiceAssociationLinksOperations.cs | 131 +- ...iceAssociationLinksOperationsExtensions.cs | 100 +- .../ServiceEndpointPoliciesOperations.cs | 833 ++-- ...iceEndpointPoliciesOperationsExtensions.cs | 715 ++-- ...viceEndpointPolicyDefinitionsOperations.cs | 556 +-- ...ntPolicyDefinitionsOperationsExtensions.cs | 598 ++- .../ServiceTagInformationOperations.cs | 212 +- ...rviceTagInformationOperationsExtensions.cs | 173 +- .../Generated/ServiceTagsOperations.cs | 125 +- .../ServiceTagsOperationsExtensions.cs | 88 +- .../Generated/StaticMembersOperations.cs | 552 +-- .../StaticMembersOperationsExtensions.cs | 496 ++- .../Generated/SubnetsOperations.cs | 794 ++-- .../Generated/SubnetsOperationsExtensions.cs | 950 +++-- ...tionNetworkManagerConnectionsOperations.cs | 516 +-- ...kManagerConnectionsOperationsExtensions.cs | 352 +- .../Generated/UsagesOperations.cs | 209 +- .../Generated/UsagesOperationsExtensions.cs | 137 +- .../Generated/VipSwapOperations.cs | 349 +- .../Generated/VipSwapOperationsExtensions.cs | 335 +- .../VirtualApplianceSitesOperations.cs | 553 +-- ...rtualApplianceSitesOperationsExtensions.cs | 594 ++- .../VirtualApplianceSkusOperations.cs | 302 +- ...irtualApplianceSkusOperationsExtensions.cs | 186 +- .../VirtualHubBgpConnectionOperations.cs | 378 +- ...ualHubBgpConnectionOperationsExtensions.cs | 456 +-- .../VirtualHubBgpConnectionsOperations.cs | 440 +- ...alHubBgpConnectionsOperationsExtensions.cs | 499 ++- .../VirtualHubIpConfigurationOperations.cs | 560 +-- ...lHubIpConfigurationOperationsExtensions.cs | 592 ++- .../VirtualHubRouteTableV2sOperations.cs | 548 +-- ...ualHubRouteTableV2sOperationsExtensions.cs | 592 ++- .../Generated/VirtualHubsOperations.cs | 1206 +++--- .../VirtualHubsOperationsExtensions.cs | 1293 +++--- ...tualNetworkGatewayConnectionsOperations.cs | 1490 ++++--- ...kGatewayConnectionsOperationsExtensions.cs | 1893 +++++---- ...VirtualNetworkGatewayNatRulesOperations.cs | 556 +-- ...workGatewayNatRulesOperationsExtensions.cs | 590 ++- .../VirtualNetworkGatewaysOperations.cs | 2717 +++++++------ ...tualNetworkGatewaysOperationsExtensions.cs | 3524 ++++++++--------- .../VirtualNetworkPeeringsOperations.cs | 577 +-- ...tualNetworkPeeringsOperationsExtensions.cs | 622 ++- .../Generated/VirtualNetworkTapsOperations.cs | 832 ++-- .../VirtualNetworkTapsOperationsExtensions.cs | 699 ++-- .../Generated/VirtualNetworksOperations.cs | 1335 ++++--- .../VirtualNetworksOperationsExtensions.cs | 1356 +++---- .../VirtualRouterPeeringsOperations.cs | 538 +-- ...rtualRouterPeeringsOperationsExtensions.cs | 586 ++- .../Generated/VirtualRoutersOperations.cs | 694 ++-- .../VirtualRoutersOperationsExtensions.cs | 632 ++- .../Generated/VirtualWansOperations.cs | 847 ++-- .../VirtualWansOperationsExtensions.cs | 707 ++-- .../Generated/VpnConnectionsOperations.cs | 796 ++-- .../VpnConnectionsOperationsExtensions.cs | 962 +++-- .../Generated/VpnGatewaysOperations.cs | 1191 +++--- .../VpnGatewaysOperationsExtensions.cs | 1374 +++---- .../Generated/VpnLinkConnectionsOperations.cs | 433 +- .../VpnLinkConnectionsOperationsExtensions.cs | 561 ++- ...tionsAssociatedWithVirtualWanOperations.cs | 141 +- ...iatedWithVirtualWanOperationsExtensions.cs | 177 +- .../VpnServerConfigurationsOperations.cs | 833 ++-- ...erverConfigurationsOperationsExtensions.cs | 707 ++-- .../VpnSiteLinkConnectionsOperations.cs | 134 +- ...SiteLinkConnectionsOperationsExtensions.cs | 112 +- .../Generated/VpnSiteLinksOperations.cs | 314 +- .../VpnSiteLinksOperationsExtensions.cs | 234 +- .../VpnSitesConfigurationOperations.cs | 151 +- ...nSitesConfigurationOperationsExtensions.cs | 185 +- .../Generated/VpnSitesOperations.cs | 836 ++-- .../Generated/VpnSitesOperationsExtensions.cs | 707 ++-- ...ebApplicationFirewallPoliciesOperations.cs | 718 ++-- ...ionFirewallPoliciesOperationsExtensions.cs | 545 ++- .../Generated/WebCategoriesOperations.cs | 303 +- .../WebCategoriesOperationsExtensions.cs | 198 +- src/Network/Network.Management.Sdk/README.md | 17 +- .../AzureFirewallNetworkRuleProtocolHelper.cs | 2 +- .../NewAzureFirewallNetworkRuleCommand.cs | 2 +- .../AzureFirewall/NewAzureFirewallCommand.cs | 8 +- ...FirewallPolicyNetworkRuleProtocolHelper.cs | 2 +- ...ionDetectionBypassTrafficSettingCommand.cs | 2 +- ...ewAzureFirewallPolicyNetworkRuleCommand.cs | 2 +- .../NewAzureCustomIpPrefixCommand.cs | 10 +- .../Network/Bastion/BastionBaseCmdlet.cs | 4 +- src/Network/Network/ChangeLog.md | 1 + src/Network/Network/Common/NetworkClient.cs | 16 +- .../Common/NetworkResourceManagerProfile.cs | 966 ++++- .../NewAzVirtualHubBgpConnectionCommand.cs | 2 +- .../UpdateAzVirtualHubBgpConnectionCommand.cs | 2 +- ...sconnectAzureP2SVpnGatewayVpnConnection.cs | 2 +- ...etAzureRmP2SVpnGatewayVpnProfileCommand.cs | 6 +- .../P2SVpnGateway/P2SVpnGatewayBaseCmdlet.cs | 4 +- .../VirtualHubRouteTableBaseCmdlet.cs | 4 +- ...VpnServerConfigurationVpnProfileCommand.cs | 6 +- .../IpAllocation/IpAllocationBaseCmdlet.cs | 4 +- .../Network/IpGroup/IpGroupBaseCmdlet.cs | 4 +- ...BackendAddressInboundNatRulePortMapping.cs | 4 +- .../NetworkInterfaceBaseCmdlet.cs | 4 +- ...tworkManagerDeploymentStatusListCommand.cs | 2 +- .../NewAzNetworkManagerStaticMemberCommand.cs | 2 +- .../NetworkGroup/NewAzNetworkGroupCommand.cs | 2 +- .../NetworkGroup/SetAzNetworkGroupCommand.cs | 2 +- ...rActiveConnectivityConfigurationCommand.cs | 2 +- ...rkManagerActiveSecurityAdminRuleCommand.cs | 2 +- .../NetworkManagerBaseCmdlet.cs | 2 +- ...ManagerConnectivityConfigurationCommand.cs | 2 +- ...ManagerConnectivityConfigurationCommand.cs | 2 +- ...fectiveConnectivityConfigurationCommand.cs | 2 +- ...anagerEffectiveSecurityAdminRuleCommand.cs | 2 +- ...ManagerManagementGroupConnectionCommand.cs | 2 +- ...ManagerManagementGroupConnectionCommand.cs | 2 +- ...wAzNetworkManagerScopeConnectionCommand.cs | 2 +- ...tAzNetworkManagerScopeConnectionCommand.cs | 2 +- ...zNetworkManagerSecurityAdminRuleCommand.cs | 4 +- ...zNetworkManagerSecurityAdminRuleCommand.cs | 2 +- ...nagerSecurityAdminRuleCollectionCommand.cs | 2 +- ...nagerSecurityAdminRuleCollectionCommand.cs | 2 +- ...anagerSecurityAdminConfigurationCommand.cs | 2 +- ...anagerSecurityAdminConfigurationCommand.cs | 2 +- ...orkManagerSubscriptionConnectionCommand.cs | 2 +- ...orkManagerSubscriptionConnectionCommand.cs | 2 +- .../NewAzNetworkManagerCommand.cs | 2 +- .../SetAzNetworkManagerCommand.cs | 2 +- .../ConnectionMonitorBaseCmdlet.cs | 18 +- ...ureNetworkWatcherPacketCaptureCommandV2.cs | 2 +- ...tAzureNetworkWatcherConnectivityCommand.cs | 6 +- .../NewAzureRMRouteServerCommand.cs | 2 +- .../RemoveAzureRMRouteServerCommand.cs | 2 +- .../UpdateAzureRMRouteServerPeerCommand.cs | 2 +- .../NewAzureVirtualNetworkCommand.cs | 2 +- ...wAzureRmVpnClientIpsecParametersCommand.cs | 18 +- .../NewAzureRmVpnClientIpsecPolicyCommand.cs | 18 +- .../NewAzureVirtualNetworkGatewayCommand.cs | 2 +- .../NewAzureVpnClientConfigurationCommand.cs | 6 +- ...UpdateAzureVirtualNetworkGatewayCommand.cs | 2 +- .../NewAzureRmIpsecPolicyCommand.cs | 12 +- .../NewAzureRMVirtualRouterCommand.cs | 2 +- .../RemoveAzureRMVirtualRouterCommand.cs | 2 +- .../VirtualRouter/RouteServerBaseCmdlet.cs | 4 +- .../VirtualRouter/VirtualRouterBaseCmdlet.cs | 2 +- .../UpdateAzureRMVirtualRouterPeerCommand.cs | 2 +- 1450 files changed, 146139 insertions(+), 120884 deletions(-) create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AdminPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AdminRuleKind.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPoolPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettingsPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSetPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPortPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListenerPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListenerPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResourceProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSetPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificatePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfilePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMapPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestPropertiesResult.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroupPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AuthorizationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollectionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTagPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollectionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategoryPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPoolPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/BgpConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunityPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResultProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfacePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicyPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlanPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/DefaultRuleSetPropertyFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/DscpConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/EffectiveAdminRuleKind.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnectionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeeringProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParametersFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureDirection.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureMode.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureSeverity.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroupProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionType.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleType.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FlowLogProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FlowLogPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/HopLinkProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/HubIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/HubRouteTableProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfilePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/InboundNatPoolPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRuleProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/IpAllocationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/IpGroupPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGatewayPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NatGatewayPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkProfilePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcherPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/OutboundRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGatewayProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResultProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnectionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroupPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZonePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ProbePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinkFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RouteFilterPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRuleType.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RouteMapProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RoutePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RouteTablePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/RoutingIntentProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/SecurityRulePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinkPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ServiceDelegationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinitionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/SingletonResource.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/StaticMemberProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/SubnetPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/UsageUnit.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSiteProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualHubProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2Properties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfigurationPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRuleProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTapPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeeringProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VirtualWanProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificatePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificatePropertiesFormat.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRuleProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnectionProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/VpnSiteProperties.cs create mode 100644 src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyPropertiesFormat.cs delete mode 100644 src/Network/Network.Management.Sdk/Generated/SdkInfo_NetworkManagementClient.cs diff --git a/src/Network/Network.Management.Sdk/Customizations/ConnectionMonitorOperation.cs b/src/Network/Network.Management.Sdk/Customizations/ConnectionMonitorOperation.cs index 1fd1e8d3d21f..042ad6012f95 100644 --- a/src/Network/Network.Management.Sdk/Customizations/ConnectionMonitorOperation.cs +++ b/src/Network/Network.Management.Sdk/Customizations/ConnectionMonitorOperation.cs @@ -207,7 +207,7 @@ internal partial class ConnectionMonitorsOperations : IServiceOperations // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AdminRuleCollectionsOperations operations. /// - internal partial class AdminRuleCollectionsOperations : IServiceOperations, IAdminRuleCollectionsOperations + internal partial class AdminRuleCollectionsOperations : Microsoft.Rest.IServiceOperations, IAdminRuleCollectionsOperations { /// /// Initializes a new instance of the AdminRuleCollectionsOperations class. @@ -36,13 +24,13 @@ internal partial class AdminRuleCollectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AdminRuleCollectionsOperations(NetworkManagementClient client) + internal AdminRuleCollectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -79,13 +67,13 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -94,67 +82,80 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -165,25 +166,24 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -195,55 +195,56 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -253,9 +254,10 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -266,25 +268,29 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a network manager security admin configuration rule collection. /// @@ -306,13 +312,13 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -321,53 +327,66 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -377,25 +396,24 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -407,55 +425,56 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -465,9 +484,10 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -478,31 +498,32 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an admin rule collection. /// - /// - /// The Rule Collection to create or update - /// /// /// The name of the resource group. /// @@ -515,19 +536,22 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// The name of the network manager security Configuration rule collection. /// + /// + /// The Rule Collection to create or update + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -536,62 +560,72 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(AdminRuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, AdminRuleCollection ruleCollection, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (ruleCollection == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollection"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollection"); } - if (ruleCollection != null) - { - ruleCollection.Validate(); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("ruleCollection", ruleCollection); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); + + tracingParameters.Add("ruleCollection", ruleCollection); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -601,25 +635,24 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -631,61 +664,62 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(ruleCollection != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(ruleCollection, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ruleCollection, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -695,9 +729,10 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -708,16 +743,16 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -726,25 +761,29 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes an admin rule collection. /// @@ -766,16 +805,16 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// in the background, prior to the delete. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -804,10 +843,10 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -816,86 +855,99 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("force", force); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); - List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -907,55 +959,56 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -965,33 +1018,38 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the rule collections in a security admin configuration, in a /// paginated format. @@ -1005,13 +1063,13 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1020,51 +1078,54 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1076,55 +1137,56 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1134,9 +1196,10 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1147,24 +1210,28 @@ internal AdminRuleCollectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperationsExtensions.cs index d449afe8079e..12eb744a24f2 100644 --- a/src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperationsExtensions.cs @@ -1,363 +1,342 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AdminRuleCollectionsOperations. + /// Extension methods for AdminRuleCollectionsOperations /// public static partial class AdminRuleCollectionsOperationsExtensions { - /// - /// Lists all the rule collections in a security admin configuration, in a - /// paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Lists all the rule collections in a security admin configuration, in a - /// paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string)) + { + return ((IAdminRuleCollectionsOperations)operations).ListAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Gets a network manager security admin configuration rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - public static AdminRuleCollection Get(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a network manager security admin configuration rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static AdminRuleCollection Get(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return ((IAdminRuleCollectionsOperations)operations).GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } - /// - /// Gets a network manager security admin configuration rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a network manager security admin configuration rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static AdminRuleCollection CreateOrUpdate(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, AdminRuleCollection ruleCollection) + { + return ((IAdminRuleCollectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleCollection).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an admin rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Rule Collection to create or update - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - public static AdminRuleCollection CreateOrUpdate(this IAdminRuleCollectionsOperations operations, AdminRuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + /// + /// Creates or updates an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, AdminRuleCollection ruleCollection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleCollection, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRuleCollectionsDeleteHeaders Delete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?)) + { + return ((IAdminRuleCollectionsOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an admin rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Rule Collection to create or update - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAdminRuleCollectionsOperations operations, AdminRuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Deletes an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRuleCollectionsDeleteHeaders BeginDelete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?)) + { + return ((IAdminRuleCollectionsOperations)operations).BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).GetAwaiter().GetResult(); + } - /// - /// Deletes an admin rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static AdminRuleCollectionsDeleteHeaders Delete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?)) + /// + /// Deletes an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAdminRuleCollectionsOperations operations, string nextPageLink) + { + return ((IAdminRuleCollectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes an admin rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAdminRuleCollectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// Deletes an admin rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static AdminRuleCollectionsDeleteHeaders BeginDelete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?)) - { - return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).GetAwaiter().GetResult(); - } - - /// - /// Deletes an admin rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists all the rule collections in a security admin configuration, in a - /// paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAdminRuleCollectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the rule collections in a security admin configuration, in a - /// paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAdminRuleCollectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AdminRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/AdminRulesOperations.cs index cf9d529f1e33..81883241f612 100644 --- a/src/Network/Network.Management.Sdk/Generated/AdminRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AdminRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AdminRulesOperations operations. /// - internal partial class AdminRulesOperations : IServiceOperations, IAdminRulesOperations + internal partial class AdminRulesOperations : Microsoft.Rest.IServiceOperations, IAdminRulesOperations { /// /// Initializes a new instance of the AdminRulesOperations class. @@ -36,13 +24,13 @@ internal partial class AdminRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AdminRulesOperations(NetworkManagementClient client) + internal AdminRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -81,13 +69,13 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -96,47 +84,57 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); @@ -144,25 +142,29 @@ internal AdminRulesOperations(NetworkManagementClient client) tracingParameters.Add("ruleCollectionName", ruleCollectionName); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -173,25 +175,24 @@ internal AdminRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -203,55 +204,56 @@ internal AdminRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -261,9 +263,10 @@ internal AdminRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -274,25 +277,29 @@ internal AdminRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a network manager security configuration admin rule. /// @@ -317,13 +324,13 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,59 +339,73 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + if (ruleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); tracingParameters.Add("ruleName", ruleName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -394,25 +415,24 @@ internal AdminRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -424,55 +444,56 @@ internal AdminRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -482,9 +503,10 @@ internal AdminRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -495,31 +517,32 @@ internal AdminRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an admin rule. /// - /// - /// The admin rule to create or update - /// /// /// The name of the resource group. /// @@ -535,19 +558,22 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// The name of the rule. /// + /// + /// The admin rule to create or update + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -556,64 +582,79 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, BaseAdminRule adminRule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (adminRule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "adminRule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "adminRule"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + if (ruleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("adminRule", adminRule); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); tracingParameters.Add("ruleName", ruleName); + + tracingParameters.Add("adminRule", adminRule); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -623,25 +664,24 @@ internal AdminRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -653,61 +693,62 @@ internal AdminRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(adminRule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(adminRule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(adminRule, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -717,9 +758,10 @@ internal AdminRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -730,16 +772,16 @@ internal AdminRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -748,25 +790,29 @@ internal AdminRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes an admin rule. /// @@ -791,16 +837,16 @@ internal AdminRulesOperations(NetworkManagementClient client) /// in the background, prior to the delete. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -832,10 +878,10 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -844,92 +890,106 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } + if (ruleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("force", force); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -941,55 +1001,56 @@ internal AdminRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,33 +1060,38 @@ internal AdminRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network manager security configuration admin rules. /// @@ -1038,13 +1104,13 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1053,51 +1119,54 @@ internal AdminRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1109,55 +1178,56 @@ internal AdminRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1167,9 +1237,10 @@ internal AdminRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1180,24 +1251,28 @@ internal AdminRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AdminRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AdminRulesOperationsExtensions.cs index 155e2473cca7..ec3a9da09244 100644 --- a/src/Network/Network.Management.Sdk/Generated/AdminRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AdminRulesOperationsExtensions.cs @@ -1,389 +1,368 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AdminRulesOperations. + /// Extension methods for AdminRulesOperations /// public static partial class AdminRulesOperationsExtensions { - /// - /// List all network manager security configuration admin rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List all network manager security configuration admin rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string)) + { + return ((IAdminRulesOperations)operations).ListAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Gets a network manager security configuration admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - public static BaseAdminRule Get(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static BaseAdminRule Get(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return ((IAdminRulesOperations)operations).GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } - /// - /// Gets a network manager security configuration admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static BaseAdminRule CreateOrUpdate(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, BaseAdminRule adminRule) + { + return ((IAdminRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, adminRule).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The admin rule to create or update - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - public static BaseAdminRule CreateOrUpdate(this IAdminRulesOperations operations, BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + /// + /// Creates or updates an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, BaseAdminRule adminRule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, adminRule, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRulesDeleteHeaders Delete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?)) + { + return ((IAdminRulesOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The admin rule to create or update - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAdminRulesOperations operations, BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Deletes an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRulesDeleteHeaders BeginDelete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?)) + { + return ((IAdminRulesOperations)operations).BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force).GetAwaiter().GetResult(); + } - /// - /// Deletes an admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static AdminRulesDeleteHeaders Delete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?)) + /// + /// Deletes an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAdminRulesOperations operations, string nextPageLink) + { + return ((IAdminRulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes an admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAdminRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// Deletes an admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static AdminRulesDeleteHeaders BeginDelete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?)) - { - return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force).GetAwaiter().GetResult(); - } - - /// - /// Deletes an admin rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// The name of the rule. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// List all network manager security configuration admin rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAdminRulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List all network manager security configuration admin rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAdminRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs index e124729a0eba..8857da0878ad 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayPrivateEndpointConnectionsOperations operations. /// - internal partial class ApplicationGatewayPrivateEndpointConnectionsOperations : IServiceOperations, IApplicationGatewayPrivateEndpointConnectionsOperations + internal partial class ApplicationGatewayPrivateEndpointConnectionsOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewayPrivateEndpointConnectionsOperations { /// /// Initializes a new instance of the ApplicationGatewayPrivateEndpointConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class ApplicationGatewayPrivateEndpointConnectionsOperations : /// /// Thrown when a required parameter is null /// - internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagementClient client) + internal ApplicationGatewayPrivateEndpointConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// The name of the application gateway private endpoint connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -92,16 +80,16 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// connection operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -122,13 +110,13 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -137,47 +125,59 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -187,25 +187,24 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -217,55 +216,56 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -275,9 +275,10 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -288,25 +289,29 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all private endpoint connections on an application gateway. /// @@ -322,13 +327,13 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +342,52 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +426,56 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +485,10 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +499,29 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified private endpoint connection on application gateway. /// @@ -519,10 +540,10 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,47 +552,59 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -581,25 +614,24 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -611,55 +643,56 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,20 +702,25 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates the specified private endpoint connection on application gateway. /// @@ -705,13 +743,13 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -720,52 +758,65 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("connectionName", connectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -775,25 +826,24 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -805,61 +855,62 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -869,9 +920,10 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -882,25 +934,29 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all private endpoint connections on an application gateway. /// @@ -913,13 +969,13 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -928,51 +984,54 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -984,55 +1043,56 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1042,9 +1102,10 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1055,24 +1116,28 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperationsExtensions.cs index 55031356e063..2ae6e11464b4 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ApplicationGatewayPrivateEndpointConnectionsOperations. + /// Extension methods for ApplicationGatewayPrivateEndpointConnectionsOperations /// public static partial class ApplicationGatewayPrivateEndpointConnectionsOperationsExtensions { - /// - /// Deletes the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - public static void Delete(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName) - { - operations.DeleteAsync(resourceGroupName, applicationGatewayName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// Parameters supplied to update application gateway private endpoint - /// connection operation. - /// - public static ApplicationGatewayPrivateEndpointConnection Update(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters) - { - return operations.UpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// Parameters supplied to update application gateway private endpoint - /// connection operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - public static ApplicationGatewayPrivateEndpointConnection Get(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName) - { - return operations.GetAsync(resourceGroupName, applicationGatewayName, connectionName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + public static void Delete(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName) + { + ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).DeleteAsync(resourceGroupName, applicationGatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + public static ApplicationGatewayPrivateEndpointConnection Update(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters) + { + return ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).UpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all private endpoint connections on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static IPage List(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Updates the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + public static ApplicationGatewayPrivateEndpointConnection Get(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName) + { + return ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).GetAsync(resourceGroupName, applicationGatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Lists all private endpoint connections on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all private endpoint connections on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static Microsoft.Rest.Azure.IPage List(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName) + { + return ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).ListAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - public static void BeginDelete(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName) + /// + /// Lists all private endpoint connections on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + public static void BeginDelete(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName) + { + ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + public static ApplicationGatewayPrivateEndpointConnection BeginUpdate(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters) + { + return ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).BeginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// Parameters supplied to update application gateway private endpoint - /// connection operation. - /// - public static ApplicationGatewayPrivateEndpointConnection BeginUpdate(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters) + /// + /// Updates the specified private endpoint connection on application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The name of the application gateway private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all private endpoint connections on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string nextPageLink) + { + return ((IApplicationGatewayPrivateEndpointConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Updates the specified private endpoint connection on application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The name of the application gateway private endpoint connection. - /// - /// - /// Parameters supplied to update application gateway private endpoint - /// connection operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all private endpoint connections on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all private endpoint connections on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all private endpoint connections on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IApplicationGatewayPrivateEndpointConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs index bec5080437f3..94c6c6490cec 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayPrivateLinkResourcesOperations operations. /// - internal partial class ApplicationGatewayPrivateLinkResourcesOperations : IServiceOperations, IApplicationGatewayPrivateLinkResourcesOperations + internal partial class ApplicationGatewayPrivateLinkResourcesOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewayPrivateLinkResourcesOperations { /// /// Initializes a new instance of the ApplicationGatewayPrivateLinkResourcesOperations class. @@ -36,13 +24,13 @@ internal partial class ApplicationGatewayPrivateLinkResourcesOperations : IServi /// /// Thrown when a required parameter is null /// - internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClient client) + internal ApplicationGatewayPrivateLinkResourcesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all private link resources on an application gateway. /// @@ -256,13 +260,13 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -271,51 +275,54 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -327,55 +334,56 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -385,9 +393,10 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -398,24 +407,28 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperationsExtensions.cs index 02576ad20925..b5e25e8728ad 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperationsExtensions.cs @@ -1,99 +1,88 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ApplicationGatewayPrivateLinkResourcesOperations. + /// Extension methods for ApplicationGatewayPrivateLinkResourcesOperations /// public static partial class ApplicationGatewayPrivateLinkResourcesOperationsExtensions { - /// - /// Lists all private link resources on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static IPage List(this IApplicationGatewayPrivateLinkResourcesOperations operations, string resourceGroupName, string applicationGatewayName) - { - return operations.ListAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } + /// + /// Lists all private link resources on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static Microsoft.Rest.Azure.IPage List(this IApplicationGatewayPrivateLinkResourcesOperations operations, string resourceGroupName, string applicationGatewayName) + { + return ((IApplicationGatewayPrivateLinkResourcesOperations)operations).ListAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } - /// - /// Lists all private link resources on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IApplicationGatewayPrivateLinkResourcesOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all private link resources on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IApplicationGatewayPrivateLinkResourcesOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all private link resources on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationGatewayPrivateLinkResourcesOperations operations, string nextPageLink) + { + return ((IApplicationGatewayPrivateLinkResourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all private link resources on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IApplicationGatewayPrivateLinkResourcesOperations operations, string nextPageLink) + /// + /// Lists all private link resources on an application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IApplicationGatewayPrivateLinkResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all private link resources on an application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IApplicationGatewayPrivateLinkResourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperations.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperations.cs index 7eb5a1e36bd6..40c467b62da5 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayWafDynamicManifestsDefaultOperations operations. /// - internal partial class ApplicationGatewayWafDynamicManifestsDefaultOperations : IServiceOperations, IApplicationGatewayWafDynamicManifestsDefaultOperations + internal partial class ApplicationGatewayWafDynamicManifestsDefaultOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewayWafDynamicManifestsDefaultOperations { /// /// Initializes a new instance of the ApplicationGatewayWafDynamicManifestsDefaultOperations class. @@ -36,13 +24,13 @@ internal partial class ApplicationGatewayWafDynamicManifestsDefaultOperations : /// /// Thrown when a required parameter is null /// - internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagementClient client) + internal ApplicationGatewayWafDynamicManifestsDefaultOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagemen /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,35 +65,45 @@ internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagemen /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagemen _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagemen _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagemen throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,24 +215,28 @@ internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagemen _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperationsExtensions.cs index 2f4ae40c9eb2..962e404a9b71 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsDefaultOperationsExtensions.cs @@ -1,59 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ApplicationGatewayWafDynamicManifestsDefaultOperations. + /// Extension methods for ApplicationGatewayWafDynamicManifestsDefaultOperations /// public static partial class ApplicationGatewayWafDynamicManifestsDefaultOperationsExtensions { - /// - /// Gets the regional application gateway waf manifest. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where the nrp are located at. - /// - public static ApplicationGatewayWafDynamicManifestResult Get(this IApplicationGatewayWafDynamicManifestsDefaultOperations operations, string location) - { - return operations.GetAsync(location).GetAwaiter().GetResult(); - } + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where the nrp are located at. + /// + public static ApplicationGatewayWafDynamicManifestResult Get(this IApplicationGatewayWafDynamicManifestsDefaultOperations operations, string location) + { + return ((IApplicationGatewayWafDynamicManifestsDefaultOperations)operations).GetAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets the regional application gateway waf manifest. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where the nrp are located at. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IApplicationGatewayWafDynamicManifestsDefaultOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where the nrp are located at. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IApplicationGatewayWafDynamicManifestsDefaultOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperations.cs index 74238e04c126..51fc9b0d63a5 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayWafDynamicManifestsOperations operations. /// - internal partial class ApplicationGatewayWafDynamicManifestsOperations : IServiceOperations, IApplicationGatewayWafDynamicManifestsOperations + internal partial class ApplicationGatewayWafDynamicManifestsOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewayWafDynamicManifestsOperations { /// /// Initializes a new instance of the ApplicationGatewayWafDynamicManifestsOperations class. @@ -36,13 +24,13 @@ internal partial class ApplicationGatewayWafDynamicManifestsOperations : IServic /// /// Thrown when a required parameter is null /// - internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient client) + internal ApplicationGatewayWafDynamicManifestsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,35 +65,45 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task>> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,25 +215,29 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the regional application gateway waf manifest. /// @@ -247,13 +250,13 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -262,51 +265,54 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task>> GetNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -318,55 +324,56 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,9 +383,10 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -389,24 +397,28 @@ internal ApplicationGatewayWafDynamicManifestsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperationsExtensions.cs index a216b977c727..91ba59d9914a 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewayWafDynamicManifestsOperationsExtensions.cs @@ -1,93 +1,82 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ApplicationGatewayWafDynamicManifestsOperations. + /// Extension methods for ApplicationGatewayWafDynamicManifestsOperations /// public static partial class ApplicationGatewayWafDynamicManifestsOperationsExtensions { - /// - /// Gets the regional application gateway waf manifest. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where the nrp are located at. - /// - public static IPage Get(this IApplicationGatewayWafDynamicManifestsOperations operations, string location) - { - return operations.GetAsync(location).GetAwaiter().GetResult(); - } + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where the nrp are located at. + /// + public static Microsoft.Rest.Azure.IPage Get(this IApplicationGatewayWafDynamicManifestsOperations operations, string location) + { + return ((IApplicationGatewayWafDynamicManifestsOperations)operations).GetAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets the regional application gateway waf manifest. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where the nrp are located at. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAsync(this IApplicationGatewayWafDynamicManifestsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where the nrp are located at. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetAsync(this IApplicationGatewayWafDynamicManifestsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage GetNext(this IApplicationGatewayWafDynamicManifestsOperations operations, string nextPageLink) + { + return ((IApplicationGatewayWafDynamicManifestsOperations)operations).GetNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the regional application gateway waf manifest. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetNext(this IApplicationGatewayWafDynamicManifestsOperations operations, string nextPageLink) + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetNextAsync(this IApplicationGatewayWafDynamicManifestsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the regional application gateway waf manifest. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetNextAsync(this IApplicationGatewayWafDynamicManifestsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperations.cs index 648d2fea3ba0..2752c8d112bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewaysOperations operations. /// - internal partial class ApplicationGatewaysOperations : IServiceOperations, IApplicationGatewaysOperations + internal partial class ApplicationGatewaysOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewaysOperations { /// /// Initializes a new instance of the ApplicationGatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class ApplicationGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ApplicationGatewaysOperations(NetworkManagementClient client) + internal ApplicationGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// The name of the application gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified application gateway. /// @@ -279,16 +283,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to the create or update application gateway operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -309,13 +313,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -324,46 +328,57 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (applicationGatewayName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +388,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,61 +417,62 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -467,9 +482,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -480,25 +496,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all application gateways in a resource group. /// @@ -511,13 +531,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -526,35 +546,45 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -564,25 +594,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -594,55 +623,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -652,9 +682,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -665,25 +696,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the application gateways in a subscription. /// @@ -693,13 +728,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -708,29 +743,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -740,25 +784,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -770,55 +813,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -828,9 +872,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -841,25 +886,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts the specified application gateway. /// @@ -870,16 +919,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// The name of the application gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -892,21 +941,20 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// The name of the application gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the backend health of the specified application gateway in a resource - /// group. + /// Gets the backend health of the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -919,21 +967,20 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// health. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the backend health for given combination of backend pool and http - /// setting of the specified application gateway in a resource group. + /// Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -941,24 +988,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The name of the application gateway. /// - /// - /// Request body for on-demand test probe operation. - /// /// /// Expands BackendAddressPool and BackendHttpSettings referenced in backend /// health. /// + /// + /// Request body for on-demand test probe operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> BackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginBackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -970,13 +1017,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -985,29 +1032,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableServerVariablesWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableServerVariablesWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableServerVariables", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableServerVariables", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1017,25 +1073,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1047,50 +1102,51 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1100,9 +1156,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1113,25 +1170,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all available request headers. /// @@ -1141,13 +1202,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1156,29 +1217,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableRequestHeadersWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableRequestHeadersWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableRequestHeaders", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableRequestHeaders", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1188,25 +1258,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1218,50 +1287,51 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1271,9 +1341,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1284,25 +1355,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all available response headers. /// @@ -1312,13 +1387,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1327,29 +1402,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableResponseHeadersWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableResponseHeadersWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableResponseHeaders", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableResponseHeaders", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1359,25 +1443,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1389,50 +1472,51 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1442,9 +1526,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1455,25 +1540,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all available web application firewall rule sets. /// @@ -1483,13 +1572,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1498,29 +1587,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListAvailableWafRuleSetsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListAvailableWafRuleSetsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableWafRuleSets", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableWafRuleSets", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1530,25 +1628,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1560,55 +1657,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1618,9 +1716,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1631,25 +1730,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists available Ssl options for configuring Ssl policy. /// @@ -1659,13 +1762,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1674,29 +1777,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListAvailableSslOptionsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListAvailableSslOptionsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslOptions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslOptions", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1706,25 +1818,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1736,55 +1847,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1794,9 +1906,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1807,25 +1920,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all SSL predefined policies for configuring Ssl policy. /// @@ -1835,13 +1952,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1850,29 +1967,38 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslPredefinedPolicies", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslPredefinedPolicies", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1882,25 +2008,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1912,55 +2037,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1970,9 +2096,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1983,25 +2110,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets Ssl predefined policy with the specified policy name. /// @@ -2014,13 +2145,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2029,35 +2160,45 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSslPredefinedPolicyWithHttpMessagesAsync(string predefinedPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetSslPredefinedPolicyWithHttpMessagesAsync(string predefinedPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (predefinedPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "predefinedPolicyName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("predefinedPolicyName", predefinedPolicyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSslPredefinedPolicy", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSslPredefinedPolicy", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{predefinedPolicyName}", System.Uri.EscapeDataString(predefinedPolicyName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2067,25 +2208,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2097,55 +2237,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2155,9 +2296,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2168,25 +2310,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified application gateway. /// @@ -2202,10 +2348,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2214,41 +2360,52 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2258,25 +2415,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2288,55 +2444,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2346,20 +2503,25 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified application gateway. /// @@ -2378,13 +2540,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2393,50 +2555,61 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (applicationGatewayName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (applicationGatewayName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2446,25 +2619,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2476,61 +2648,62 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2540,9 +2713,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2553,16 +2727,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2571,25 +2745,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts the specified application gateway. /// @@ -2605,10 +2783,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2617,41 +2795,52 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2661,25 +2850,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2691,55 +2879,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2749,20 +2938,25 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops the specified application gateway in a resource group. /// @@ -2778,10 +2972,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2790,41 +2984,52 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2834,25 +3039,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2864,55 +3068,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2922,20 +3127,25 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the backend health of the specified application gateway in a resource /// group. @@ -2956,13 +3166,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2971,42 +3181,54 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3020,25 +3242,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3050,55 +3271,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3108,9 +3330,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3121,25 +3344,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the backend health for given combination of backend pool and http /// setting of the specified application gateway in a resource group. @@ -3150,26 +3377,26 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The name of the application gateway. /// - /// - /// Request body for on-demand test probe operation. - /// /// /// Expands BackendAddressPool and BackendHttpSettings referenced in backend /// health. /// + /// + /// Request body for on-demand test probe operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3178,47 +3405,60 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginBackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginBackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (probeRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "probeRequest"); } - if (applicationGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (probeRequest == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "probeRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + tracingParameters.Add("probeRequest", probeRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealthOnDemand", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealthOnDemand", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3232,25 +3472,24 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3262,61 +3501,62 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(probeRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(probeRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(probeRequest, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3326,9 +3566,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3339,25 +3580,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all application gateways in a resource group. /// @@ -3370,13 +3615,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3385,51 +3630,54 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3441,55 +3689,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3499,9 +3748,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3512,25 +3762,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the application gateways in a subscription. /// @@ -3543,13 +3797,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3558,51 +3812,54 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3614,55 +3871,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3672,9 +3930,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3685,25 +3944,29 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all SSL predefined policies for configuring Ssl policy. /// @@ -3716,13 +3979,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3731,51 +3994,54 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslPredefinedPoliciesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslPredefinedPoliciesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3787,55 +4053,56 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3845,9 +4112,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3858,24 +4126,28 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperationsExtensions.cs index 87b3f5be5724..05a838c8165e 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationGatewaysOperationsExtensions.cs @@ -1,1005 +1,938 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ApplicationGatewaysOperations. + /// Extension methods for ApplicationGatewaysOperations /// public static partial class ApplicationGatewaysOperationsExtensions { - /// - /// Deletes the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static void Delete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - operations.DeleteAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - return operations.GetAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the specified application gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to update application gateway tags. - /// - public static ApplicationGateway UpdateTags(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates the specified application gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to update application gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all application gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all application gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the application gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IApplicationGatewaysOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all the application gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - operations.StartAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Starts the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stops the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - operations.StopAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Stops the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the backend health of the specified application gateway in a resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) - { - return operations.BackendHealthAsync(resourceGroupName, applicationGatewayName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the backend health of the specified application gateway in a resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - /// - /// The cancellation token. - /// - public static async Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the backend health for given combination of backend pool and http - /// setting of the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Request body for on-demand test probe operation. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - public static ApplicationGatewayBackendHealthOnDemand BackendHealthOnDemand(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string)) - { - return operations.BackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the backend health for given combination of backend pool and http - /// setting of the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Request body for on-demand test probe operation. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - /// - /// The cancellation token. - /// - public static async Task BackendHealthOnDemandAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all available server variables. - /// - /// - /// The operations group for this extension method. - /// - public static IList ListAvailableServerVariables(this IApplicationGatewaysOperations operations) - { - return operations.ListAvailableServerVariablesAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all available server variables. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableServerVariablesAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableServerVariablesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all available request headers. - /// - /// - /// The operations group for this extension method. - /// - public static IList ListAvailableRequestHeaders(this IApplicationGatewaysOperations operations) - { - return operations.ListAvailableRequestHeadersAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all available request headers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableRequestHeadersAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableRequestHeadersWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all available response headers. - /// - /// - /// The operations group for this extension method. - /// - public static IList ListAvailableResponseHeaders(this IApplicationGatewaysOperations operations) - { - return operations.ListAvailableResponseHeadersAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all available response headers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableResponseHeadersAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableResponseHeadersWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all available web application firewall rule sets. - /// - /// - /// The operations group for this extension method. - /// - public static ApplicationGatewayAvailableWafRuleSetsResult ListAvailableWafRuleSets(this IApplicationGatewaysOperations operations) - { - return operations.ListAvailableWafRuleSetsAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all available web application firewall rule sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListAvailableWafRuleSetsAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableWafRuleSetsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists available Ssl options for configuring Ssl policy. - /// - /// - /// The operations group for this extension method. - /// - public static ApplicationGatewayAvailableSslOptions ListAvailableSslOptions(this IApplicationGatewaysOperations operations) - { - return operations.ListAvailableSslOptionsAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists available Ssl options for configuring Ssl policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListAvailableSslOptionsAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableSslOptionsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all SSL predefined policies for configuring Ssl policy. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAvailableSslPredefinedPolicies(this IApplicationGatewaysOperations operations) - { - return operations.ListAvailableSslPredefinedPoliciesAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all SSL predefined policies for configuring Ssl policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableSslPredefinedPoliciesAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets Ssl predefined policy with the specified policy name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of Ssl predefined policy. - /// - public static ApplicationGatewaySslPredefinedPolicy GetSslPredefinedPolicy(this IApplicationGatewaysOperations operations, string predefinedPolicyName) - { - return operations.GetSslPredefinedPolicyAsync(predefinedPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Gets Ssl predefined policy with the specified policy name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of Ssl predefined policy. - /// - /// - /// The cancellation token. - /// - public static async Task GetSslPredefinedPolicyAsync(this IApplicationGatewaysOperations operations, string predefinedPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSslPredefinedPolicyWithHttpMessagesAsync(predefinedPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - operations.BeginDeleteAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - operations.BeginStartAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Starts the specified application gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stops the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) - { - operations.BeginStopAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Stops the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the backend health of the specified application gateway in a resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - public static ApplicationGatewayBackendHealth BeginBackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) - { - return operations.BeginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the backend health of the specified application gateway in a resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - /// - /// The cancellation token. - /// - public static async Task BeginBackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginBackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the backend health for given combination of backend pool and http - /// setting of the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Request body for on-demand test probe operation. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - public static ApplicationGatewayBackendHealthOnDemand BeginBackendHealthOnDemand(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string)) - { - return operations.BeginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the backend health for given combination of backend pool and http - /// setting of the specified application gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Request body for on-demand test probe operation. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - /// - /// The cancellation token. - /// - public static async Task BeginBackendHealthOnDemandAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginBackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all application gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IApplicationGatewaysOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all application gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the application gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IApplicationGatewaysOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the application gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all SSL predefined policies for configuring Ssl policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAvailableSslPredefinedPoliciesNext(this IApplicationGatewaysOperations operations, string nextPageLink) - { - return operations.ListAvailableSslPredefinedPoliciesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all SSL predefined policies for configuring Ssl policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableSslPredefinedPoliciesNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Deletes the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void Delete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + ((IApplicationGatewaysOperations)operations).DeleteAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + return ((IApplicationGatewaysOperations)operations).GetAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) + { + return ((IApplicationGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates the specified application gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static ApplicationGateway UpdateTags(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, TagsObject parameters) + { + return ((IApplicationGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the specified application gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all application gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) + { + return ((IApplicationGatewaysOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all application gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the application gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the application gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + ((IApplicationGatewaysOperations)operations).StartAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Starts the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stops the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + ((IApplicationGatewaysOperations)operations).StopAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Stops the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) + { + return ((IApplicationGatewaysOperations)operations).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + public static ApplicationGatewayBackendHealthOnDemand BackendHealthOnDemand(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string)) + { + return ((IApplicationGatewaysOperations)operations).BackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BackendHealthOnDemandAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all available server variables. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IList ListAvailableServerVariables(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableServerVariablesAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all available server variables. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableServerVariablesAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableServerVariablesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all available request headers. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IList ListAvailableRequestHeaders(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableRequestHeadersAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all available request headers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableRequestHeadersAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableRequestHeadersWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all available response headers. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IList ListAvailableResponseHeaders(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableResponseHeadersAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all available response headers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableResponseHeadersAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableResponseHeadersWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all available web application firewall rule sets. + /// + /// + /// The operations group for this extension method. + /// + public static ApplicationGatewayAvailableWafRuleSetsResult ListAvailableWafRuleSets(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableWafRuleSetsAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all available web application firewall rule sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAvailableWafRuleSetsAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableWafRuleSetsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists available Ssl options for configuring Ssl policy. + /// + /// + /// The operations group for this extension method. + /// + public static ApplicationGatewayAvailableSslOptions ListAvailableSslOptions(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableSslOptionsAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists available Ssl options for configuring Ssl policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAvailableSslOptionsAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableSslOptionsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all SSL predefined policies for configuring Ssl policy. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAvailableSslPredefinedPolicies(this IApplicationGatewaysOperations operations) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableSslPredefinedPoliciesAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all SSL predefined policies for configuring Ssl policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableSslPredefinedPoliciesAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets Ssl predefined policy with the specified policy name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of Ssl predefined policy. + /// + public static ApplicationGatewaySslPredefinedPolicy GetSslPredefinedPolicy(this IApplicationGatewaysOperations operations, string predefinedPolicyName) + { + return ((IApplicationGatewaysOperations)operations).GetSslPredefinedPolicyAsync(predefinedPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Gets Ssl predefined policy with the specified policy name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of Ssl predefined policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetSslPredefinedPolicyAsync(this IApplicationGatewaysOperations operations, string predefinedPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetSslPredefinedPolicyWithHttpMessagesAsync(predefinedPolicyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + ((IApplicationGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) + { + return ((IApplicationGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + ((IApplicationGatewaysOperations)operations).BeginStartAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Starts the specified application gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stops the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + { + ((IApplicationGatewaysOperations)operations).BeginStopAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Stops the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + public static ApplicationGatewayBackendHealth BeginBackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) + { + return ((IApplicationGatewaysOperations)operations).BeginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginBackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginBackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + public static ApplicationGatewayBackendHealthOnDemand BeginBackendHealthOnDemand(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string)) + { + return ((IApplicationGatewaysOperations)operations).BeginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginBackendHealthOnDemandAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginBackendHealthOnDemandWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all application gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationGatewaysOperations operations, string nextPageLink) + { + return ((IApplicationGatewaysOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all application gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the application gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IApplicationGatewaysOperations operations, string nextPageLink) + { + return ((IApplicationGatewaysOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the application gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all SSL predefined policies for configuring Ssl policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAvailableSslPredefinedPoliciesNext(this IApplicationGatewaysOperations operations, string nextPageLink) + { + return ((IApplicationGatewaysOperations)operations).ListAvailableSslPredefinedPoliciesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all SSL predefined policies for configuring Ssl policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableSslPredefinedPoliciesNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperations.cs index 7a184f6a4768..da4fc3428290 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationSecurityGroupsOperations operations. /// - internal partial class ApplicationSecurityGroupsOperations : IServiceOperations, IApplicationSecurityGroupsOperations + internal partial class ApplicationSecurityGroupsOperations : Microsoft.Rest.IServiceOperations, IApplicationSecurityGroupsOperations { /// /// Initializes a new instance of the ApplicationSecurityGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class ApplicationSecurityGroupsOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) + internal ApplicationSecurityGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// The name of the application security group. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an application security group. /// @@ -280,20 +284,20 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Updates an application security group's tags. + /// Updates an application security group's tags. /// /// /// The name of the resource group. @@ -310,13 +314,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -325,46 +329,57 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (applicationSecurityGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (applicationSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -374,25 +389,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -404,61 +418,62 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +483,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,25 +497,29 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all application security groups in a subscription. /// @@ -509,13 +529,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -524,29 +544,38 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -556,25 +585,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -586,55 +614,56 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -644,9 +673,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -657,25 +687,29 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the application security groups in a resource group. /// @@ -688,13 +722,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -703,35 +737,45 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +785,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,55 +814,56 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,9 +873,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -842,25 +887,29 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified application security group. /// @@ -876,10 +925,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -888,41 +937,52 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (applicationSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -932,25 +992,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -962,55 +1021,56 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1020,20 +1080,25 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an application security group. /// @@ -1053,13 +1118,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1068,46 +1133,58 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (applicationSecurityGroupName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (applicationSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1117,25 +1194,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1147,61 +1223,62 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1211,9 +1288,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1224,16 +1302,16 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1242,25 +1320,29 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all application security groups in a subscription. /// @@ -1273,13 +1355,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1288,51 +1370,54 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1344,55 +1429,56 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1402,9 +1488,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1415,25 +1502,29 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the application security groups in a resource group. /// @@ -1446,13 +1537,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1461,51 +1552,54 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1517,55 +1611,56 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1575,9 +1670,10 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1588,24 +1684,28 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperationsExtensions.cs index 0cf4d8d745eb..739aa4d80a14 100644 --- a/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ApplicationSecurityGroupsOperationsExtensions.cs @@ -1,411 +1,370 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ApplicationSecurityGroupsOperations. + /// Extension methods for ApplicationSecurityGroupsOperations /// public static partial class ApplicationSecurityGroupsOperationsExtensions { - /// - /// Deletes the specified application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - public static void Delete(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName) - { - operations.DeleteAsync(resourceGroupName, applicationSecurityGroupName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets information about the specified application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - public static ApplicationSecurityGroup Get(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName) - { - return operations.GetAsync(resourceGroupName, applicationSecurityGroupName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + public static void Delete(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName) + { + ((IApplicationSecurityGroupsOperations)operations).DeleteAsync(resourceGroupName, applicationSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets information about the specified application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets information about the specified application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + public static ApplicationSecurityGroup Get(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName) + { + return ((IApplicationSecurityGroupsOperations)operations).GetAsync(resourceGroupName, applicationSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to the create or update ApplicationSecurityGroup - /// operation. - /// - public static ApplicationSecurityGroup CreateOrUpdate(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters) + /// + /// Gets information about the specified application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates an application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + public static ApplicationSecurityGroup CreateOrUpdate(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters) + { + return ((IApplicationSecurityGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to the create or update ApplicationSecurityGroup - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates an application security group's tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + public static ApplicationSecurityGroup UpdateTags(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters) + { + return ((IApplicationSecurityGroupsOperations)operations).UpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates an application security group's tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to update application security group tags. - /// - public static ApplicationSecurityGroup UpdateTags(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters) + /// + /// Updates an application security group's tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all application security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IApplicationSecurityGroupsOperations operations) + { + return ((IApplicationSecurityGroupsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Updates an application security group's tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to update application security group tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all application security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IApplicationSecurityGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the application security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IApplicationSecurityGroupsOperations operations, string resourceGroupName) + { + return ((IApplicationSecurityGroupsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all application security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IApplicationSecurityGroupsOperations operations) + /// + /// Gets all the application security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + public static void BeginDelete(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName) + { + ((IApplicationSecurityGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, applicationSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all application security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IApplicationSecurityGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + public static ApplicationSecurityGroup BeginCreateOrUpdate(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters) + { + return ((IApplicationSecurityGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all the application security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IApplicationSecurityGroupsOperations operations, string resourceGroupName) + /// + /// Creates or updates an application security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all application security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IApplicationSecurityGroupsOperations operations, string nextPageLink) + { + return ((IApplicationSecurityGroupsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the application security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all application security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IApplicationSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the application security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationSecurityGroupsOperations operations, string nextPageLink) + { + return ((IApplicationSecurityGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - public static void BeginDelete(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName) + /// + /// Gets all the application security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IApplicationSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, applicationSecurityGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates an application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to the create or update ApplicationSecurityGroup - /// operation. - /// - public static ApplicationSecurityGroup BeginCreateOrUpdate(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an application security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to the create or update ApplicationSecurityGroup - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all application security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IApplicationSecurityGroupsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all application security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IApplicationSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the application security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IApplicationSecurityGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the application security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IApplicationSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperations.cs index 93a9724aa719..fa944e9c97f3 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableDelegationsOperations operations. /// - internal partial class AvailableDelegationsOperations : IServiceOperations, IAvailableDelegationsOperations + internal partial class AvailableDelegationsOperations : Microsoft.Rest.IServiceOperations, IAvailableDelegationsOperations { /// /// Initializes a new instance of the AvailableDelegationsOperations class. @@ -36,13 +24,13 @@ internal partial class AvailableDelegationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AvailableDelegationsOperations(NetworkManagementClient client) + internal AvailableDelegationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,13 +51,13 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,35 +66,45 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -116,25 +114,24 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -146,55 +143,56 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -204,9 +202,10 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -217,25 +216,29 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all of the available subnet delegations for this subscription in this /// region. @@ -249,13 +252,13 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -264,51 +267,54 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -320,55 +326,56 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -378,9 +385,10 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -391,24 +399,28 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperationsExtensions.cs index 7be7807be121..85b084a91fa8 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableDelegationsOperationsExtensions.cs @@ -1,97 +1,86 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailableDelegationsOperations. + /// Extension methods for AvailableDelegationsOperations /// public static partial class AvailableDelegationsOperationsExtensions { - /// - /// Gets all of the available subnet delegations for this subscription in this - /// region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the subnet. - /// - public static IPage List(this IAvailableDelegationsOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Gets all of the available subnet delegations for this subscription in this + /// region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the subnet. + /// + public static Microsoft.Rest.Azure.IPage List(this IAvailableDelegationsOperations operations, string location) + { + return ((IAvailableDelegationsOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets all of the available subnet delegations for this subscription in this - /// region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the subnet. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAvailableDelegationsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all of the available subnet delegations for this subscription in this + /// region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAvailableDelegationsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all of the available subnet delegations for this subscription in this + /// region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAvailableDelegationsOperations operations, string nextPageLink) + { + return ((IAvailableDelegationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all of the available subnet delegations for this subscription in this - /// region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAvailableDelegationsOperations operations, string nextPageLink) + /// + /// Gets all of the available subnet delegations for this subscription in this + /// region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAvailableDelegationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all of the available subnet delegations for this subscription in this - /// region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAvailableDelegationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperations.cs b/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperations.cs index 4d80a2197fdd..7e3480ea1426 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableEndpointServicesOperations operations. /// - internal partial class AvailableEndpointServicesOperations : IServiceOperations, IAvailableEndpointServicesOperations + internal partial class AvailableEndpointServicesOperations : Microsoft.Rest.IServiceOperations, IAvailableEndpointServicesOperations { /// /// Initializes a new instance of the AvailableEndpointServicesOperations class. @@ -36,13 +24,13 @@ internal partial class AvailableEndpointServicesOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal AvailableEndpointServicesOperations(NetworkManagementClient client) + internal AvailableEndpointServicesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,35 +65,45 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,25 +215,29 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List what values of endpoint services are available for use. /// @@ -247,13 +250,13 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -262,51 +265,54 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -318,55 +324,56 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,9 +383,10 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -389,24 +397,28 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperationsExtensions.cs index a8540d8bfdd4..3cc4910e66be 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableEndpointServicesOperationsExtensions.cs @@ -1,93 +1,82 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailableEndpointServicesOperations. + /// Extension methods for AvailableEndpointServicesOperations /// public static partial class AvailableEndpointServicesOperationsExtensions { - /// - /// List what values of endpoint services are available for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location to check available endpoint services. - /// - public static IPage List(this IAvailableEndpointServicesOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location to check available endpoint services. + /// + public static Microsoft.Rest.Azure.IPage List(this IAvailableEndpointServicesOperations operations, string location) + { + return ((IAvailableEndpointServicesOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// List what values of endpoint services are available for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location to check available endpoint services. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAvailableEndpointServicesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location to check available endpoint services. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAvailableEndpointServicesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAvailableEndpointServicesOperations operations, string nextPageLink) + { + return ((IAvailableEndpointServicesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List what values of endpoint services are available for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAvailableEndpointServicesOperations operations, string nextPageLink) + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAvailableEndpointServicesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List what values of endpoint services are available for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAvailableEndpointServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperations.cs b/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperations.cs index 5a368c6adcdb..e2e2106e3378 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailablePrivateEndpointTypesOperations operations. /// - internal partial class AvailablePrivateEndpointTypesOperations : IServiceOperations, IAvailablePrivateEndpointTypesOperations + internal partial class AvailablePrivateEndpointTypesOperations : Microsoft.Rest.IServiceOperations, IAvailablePrivateEndpointTypesOperations { /// /// Initializes a new instance of the AvailablePrivateEndpointTypesOperations class. @@ -36,13 +24,13 @@ internal partial class AvailablePrivateEndpointTypesOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) + internal AvailablePrivateEndpointTypesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,13 +51,13 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,35 +66,45 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -116,25 +114,24 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -146,55 +143,56 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -204,9 +202,10 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -217,25 +216,29 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all of the resource types that can be linked to a Private Endpoint /// in this subscription in this region. @@ -252,13 +255,13 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -267,41 +270,52 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -311,25 +325,24 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -341,55 +354,56 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -399,9 +413,10 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -412,25 +427,29 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all of the resource types that can be linked to a Private Endpoint /// in this subscription in this region. @@ -444,13 +463,13 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -459,51 +478,54 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -515,55 +537,56 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -573,9 +596,10 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -586,25 +610,29 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all of the resource types that can be linked to a Private Endpoint /// in this subscription in this region. @@ -618,13 +646,13 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -633,51 +661,54 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -689,55 +720,56 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -747,9 +779,10 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -760,24 +793,28 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperationsExtensions.cs index e4d8966ccd63..2f3873d2144c 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailablePrivateEndpointTypesOperationsExtensions.cs @@ -1,175 +1,162 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailablePrivateEndpointTypesOperations. + /// Extension methods for AvailablePrivateEndpointTypesOperations /// public static partial class AvailablePrivateEndpointTypesOperationsExtensions { - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - public static IPage List(this IAvailablePrivateEndpointTypesOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + public static Microsoft.Rest.Azure.IPage List(this IAvailablePrivateEndpointTypesOperations operations, string location) + { + return ((IAvailablePrivateEndpointTypesOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAvailablePrivateEndpointTypesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAvailablePrivateEndpointTypesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IAvailablePrivateEndpointTypesOperations operations, string location, string resourceGroupName) + { + return ((IAvailablePrivateEndpointTypesOperations)operations).ListByResourceGroupAsync(location, resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IAvailablePrivateEndpointTypesOperations operations, string location, string resourceGroupName) + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IAvailablePrivateEndpointTypesOperations operations, string location, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(location, resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink) + { + return ((IAvailablePrivateEndpointTypesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IAvailablePrivateEndpointTypesOperations operations, string location, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink) + { + return ((IAvailablePrivateEndpointTypesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink) + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns all of the resource types that can be linked to a Private Endpoint - /// in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IAvailablePrivateEndpointTypesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperations.cs index 4b53265dac04..75024c85fd86 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableResourceGroupDelegationsOperations operations. /// - internal partial class AvailableResourceGroupDelegationsOperations : IServiceOperations, IAvailableResourceGroupDelegationsOperations + internal partial class AvailableResourceGroupDelegationsOperations : Microsoft.Rest.IServiceOperations, IAvailableResourceGroupDelegationsOperations { /// /// Initializes a new instance of the AvailableResourceGroupDelegationsOperations class. @@ -36,13 +24,13 @@ internal partial class AvailableResourceGroupDelegationsOperations : IServiceOpe /// /// Thrown when a required parameter is null /// - internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient client) + internal AvailableResourceGroupDelegationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,13 +54,13 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,41 +69,52 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -125,25 +124,24 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -155,55 +153,56 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -213,9 +212,10 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -226,25 +226,29 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all of the available subnet delegations for this resource group in /// this region. @@ -258,13 +262,13 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -273,51 +277,54 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -329,55 +336,56 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -387,9 +395,10 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -400,24 +409,28 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperationsExtensions.cs index 485badd5ba0e..d58ddd41c560 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableResourceGroupDelegationsOperationsExtensions.cs @@ -1,103 +1,92 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailableResourceGroupDelegationsOperations. + /// Extension methods for AvailableResourceGroupDelegationsOperations /// public static partial class AvailableResourceGroupDelegationsOperationsExtensions { - /// - /// Gets all of the available subnet delegations for this resource group in - /// this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IAvailableResourceGroupDelegationsOperations operations, string location, string resourceGroupName) - { - return operations.ListAsync(location, resourceGroupName).GetAwaiter().GetResult(); - } + /// + /// Gets all of the available subnet delegations for this resource group in + /// this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IAvailableResourceGroupDelegationsOperations operations, string location, string resourceGroupName) + { + return ((IAvailableResourceGroupDelegationsOperations)operations).ListAsync(location, resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all of the available subnet delegations for this resource group in - /// this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAvailableResourceGroupDelegationsOperations operations, string location, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all of the available subnet delegations for this resource group in + /// this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAvailableResourceGroupDelegationsOperations operations, string location, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all of the available subnet delegations for this resource group in + /// this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAvailableResourceGroupDelegationsOperations operations, string nextPageLink) + { + return ((IAvailableResourceGroupDelegationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all of the available subnet delegations for this resource group in - /// this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAvailableResourceGroupDelegationsOperations operations, string nextPageLink) + /// + /// Gets all of the available subnet delegations for this resource group in + /// this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAvailableResourceGroupDelegationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all of the available subnet delegations for this resource group in - /// this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAvailableResourceGroupDelegationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperations.cs b/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperations.cs index 1b97fba95e8f..9b97aaf83cc3 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableServiceAliasesOperations operations. /// - internal partial class AvailableServiceAliasesOperations : IServiceOperations, IAvailableServiceAliasesOperations + internal partial class AvailableServiceAliasesOperations : Microsoft.Rest.IServiceOperations, IAvailableServiceAliasesOperations { /// /// Initializes a new instance of the AvailableServiceAliasesOperations class. @@ -36,13 +24,13 @@ internal partial class AvailableServiceAliasesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AvailableServiceAliasesOperations(NetworkManagementClient client) + internal AvailableServiceAliasesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,35 +65,45 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,25 +215,29 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all available service aliases for this resource group in this region. /// @@ -250,13 +253,13 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -265,41 +268,52 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -309,25 +323,24 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -339,55 +352,56 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -397,9 +411,10 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -410,25 +425,29 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all available service aliases for this subscription in this region. /// @@ -441,13 +460,13 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -456,51 +475,54 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -512,55 +534,56 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -570,9 +593,10 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -583,25 +607,29 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all available service aliases for this resource group in this region. /// @@ -614,13 +642,13 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -629,51 +657,54 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -685,55 +716,56 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -743,9 +775,10 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -756,24 +789,28 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperationsExtensions.cs index a69c54bb22ff..acb6faf47a41 100644 --- a/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AvailableServiceAliasesOperationsExtensions.cs @@ -1,167 +1,154 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailableServiceAliasesOperations. + /// Extension methods for AvailableServiceAliasesOperations /// public static partial class AvailableServiceAliasesOperationsExtensions { - /// - /// Gets all available service aliases for this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location. - /// - public static IPage List(this IAvailableServiceAliasesOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Gets all available service aliases for this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location. + /// + public static Microsoft.Rest.Azure.IPage List(this IAvailableServiceAliasesOperations operations, string location) + { + return ((IAvailableServiceAliasesOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets all available service aliases for this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAvailableServiceAliasesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all available service aliases for this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAvailableServiceAliasesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all available service aliases for this resource group in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The location. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IAvailableServiceAliasesOperations operations, string resourceGroupName, string location) + { + return ((IAvailableServiceAliasesOperations)operations).ListByResourceGroupAsync(resourceGroupName, location).GetAwaiter().GetResult(); + } - /// - /// Gets all available service aliases for this resource group in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The location. - /// - public static IPage ListByResourceGroup(this IAvailableServiceAliasesOperations operations, string resourceGroupName, string location) + /// + /// Gets all available service aliases for this resource group in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The location. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IAvailableServiceAliasesOperations operations, string resourceGroupName, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, location, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName, location).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all available service aliases for this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAvailableServiceAliasesOperations operations, string nextPageLink) + { + return ((IAvailableServiceAliasesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all available service aliases for this resource group in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The location. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IAvailableServiceAliasesOperations operations, string resourceGroupName, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all available service aliases for this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAvailableServiceAliasesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all available service aliases for this resource group in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IAvailableServiceAliasesOperations operations, string nextPageLink) + { + return ((IAvailableServiceAliasesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all available service aliases for this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAvailableServiceAliasesOperations operations, string nextPageLink) + /// + /// Gets all available service aliases for this resource group in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IAvailableServiceAliasesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all available service aliases for this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAvailableServiceAliasesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all available service aliases for this resource group in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IAvailableServiceAliasesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all available service aliases for this resource group in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IAvailableServiceAliasesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperations.cs b/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperations.cs index bb4da8174c51..a93f7e006604 100644 --- a/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AzureFirewallFqdnTagsOperations operations. /// - internal partial class AzureFirewallFqdnTagsOperations : IServiceOperations, IAzureFirewallFqdnTagsOperations + internal partial class AzureFirewallFqdnTagsOperations : Microsoft.Rest.IServiceOperations, IAzureFirewallFqdnTagsOperations { /// /// Initializes a new instance of the AzureFirewallFqdnTagsOperations class. @@ -36,13 +24,13 @@ internal partial class AzureFirewallFqdnTagsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) + internal AzureFirewallFqdnTagsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Azure Firewall FQDN Tags in a subscription. /// @@ -238,13 +240,13 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,51 +255,54 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -309,55 +314,56 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -367,9 +373,10 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -380,24 +387,28 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperationsExtensions.cs index 567fe7d1e1b1..410bdaea2784 100644 --- a/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AzureFirewallFqdnTagsOperationsExtensions.cs @@ -1,87 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AzureFirewallFqdnTagsOperations. + /// Extension methods for AzureFirewallFqdnTagsOperations /// public static partial class AzureFirewallFqdnTagsOperationsExtensions { - /// - /// Gets all the Azure Firewall FQDN Tags in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IAzureFirewallFqdnTagsOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } + /// + /// Gets all the Azure Firewall FQDN Tags in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IAzureFirewallFqdnTagsOperations operations) + { + return ((IAzureFirewallFqdnTagsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all the Azure Firewall FQDN Tags in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IAzureFirewallFqdnTagsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the Azure Firewall FQDN Tags in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IAzureFirewallFqdnTagsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the Azure Firewall FQDN Tags in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IAzureFirewallFqdnTagsOperations operations, string nextPageLink) + { + return ((IAzureFirewallFqdnTagsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the Azure Firewall FQDN Tags in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IAzureFirewallFqdnTagsOperations operations, string nextPageLink) + /// + /// Gets all the Azure Firewall FQDN Tags in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IAzureFirewallFqdnTagsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the Azure Firewall FQDN Tags in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IAzureFirewallFqdnTagsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperations.cs b/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperations.cs index e274aa126607..0dec1fd2bb1a 100644 --- a/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AzureFirewallsOperations operations. /// - internal partial class AzureFirewallsOperations : IServiceOperations, IAzureFirewallsOperations + internal partial class AzureFirewallsOperations : Microsoft.Rest.IServiceOperations, IAzureFirewallsOperations { /// /// Initializes a new instance of the AzureFirewallsOperations class. @@ -36,13 +24,13 @@ internal partial class AzureFirewallsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AzureFirewallsOperations(NetworkManagementClient client) + internal AzureFirewallsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// The name of the Azure Firewall. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, azureFirewallName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, azureFirewallName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (azureFirewallName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureFirewallName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("azureFirewallName", azureFirewallName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Azure Firewall. /// @@ -279,16 +283,16 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update Azure Firewall operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -304,16 +308,16 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// Parameters supplied to update azure firewall tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -328,13 +332,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -343,35 +347,45 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +395,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +424,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +483,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +497,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Azure Firewalls in a subscription. /// @@ -510,13 +529,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -525,29 +544,38 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -557,25 +585,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -587,55 +614,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -645,9 +673,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -658,28 +687,31 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Retrieves a list of all IP prefixes that azure firewall has learned to not - /// SNAT. + /// Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. /// /// /// The name of the resource group. @@ -688,16 +720,16 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// The name of the azure firewall. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -713,16 +745,16 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// Parameters supplied to run packet capture on azure firewall. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> PacketCaptureMethodWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PacketCaptureWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginPacketCaptureMethodWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginPacketCaptureWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -740,10 +772,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -752,41 +784,52 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (azureFirewallName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureFirewallName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("azureFirewallName", azureFirewallName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -796,25 +839,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -826,55 +868,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -884,20 +927,25 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Azure Firewall. /// @@ -916,13 +964,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -931,57 +979,68 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (azureFirewallName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureFirewallName"); } if (azureFirewallName != null) { if (azureFirewallName.Length > 56) { - throw new ValidationException(ValidationRules.MaxLength, "azureFirewallName", 56); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "azureFirewallName", 56); } if (azureFirewallName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "azureFirewallName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "azureFirewallName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("azureFirewallName", azureFirewallName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -991,25 +1050,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1021,61 +1079,62 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1085,9 +1144,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1098,16 +1158,16 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1116,25 +1176,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates tags of an Azure Firewall resource. /// @@ -1153,13 +1217,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1168,46 +1232,57 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (azureFirewallName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (azureFirewallName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureFirewallName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("azureFirewallName", azureFirewallName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1217,25 +1292,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1247,61 +1321,62 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1311,9 +1386,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1324,25 +1400,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves a list of all IP prefixes that azure firewall has learned to not /// SNAT. @@ -1359,13 +1439,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1374,41 +1454,52 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (azureFirewallName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureFirewallName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("azureFirewallName", azureFirewallName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListLearnedPrefixes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListLearnedPrefixes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1418,25 +1509,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1448,55 +1538,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1506,9 +1597,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1519,25 +1611,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Runs a packet capture on AzureFirewall. /// @@ -1556,10 +1652,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1568,65 +1664,75 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPacketCaptureMethodWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (azureFirewallName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureFirewallName"); } if (azureFirewallName != null) { if (azureFirewallName.Length > 56) { - throw new ValidationException(ValidationRules.MaxLength, "azureFirewallName", 56); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "azureFirewallName", 56); } if (azureFirewallName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "azureFirewallName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "azureFirewallName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(azureFirewallName, "^[a-zA-Z0-9]")) { - throw new ValidationException(ValidationRules.Pattern, "azureFirewallName", "^[a-zA-Z0-9]"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "azureFirewallName", "^[a-zA-Z0-9]"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (this.Client.SubscriptionId == null) { - parameters.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("azureFirewallName", azureFirewallName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPacketCaptureMethod", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/packetCapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1636,25 +1742,24 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1666,61 +1771,62 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1730,33 +1836,38 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Azure Firewalls in a resource group. /// @@ -1769,13 +1880,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1784,51 +1895,54 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1840,55 +1954,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1898,9 +2013,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1911,25 +2027,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Azure Firewalls in a subscription. /// @@ -1942,13 +2062,13 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1957,51 +2077,54 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2013,55 +2136,56 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2071,9 +2195,10 @@ internal AzureFirewallsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2084,24 +2209,28 @@ internal AzureFirewallsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperationsExtensions.cs index 5f9522ef1bfa..ce2eb68d7a39 100644 --- a/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/AzureFirewallsOperationsExtensions.cs @@ -1,629 +1,569 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AzureFirewallsOperations. + /// Extension methods for AzureFirewallsOperations /// public static partial class AzureFirewallsOperationsExtensions { - /// - /// Deletes the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - public static void Delete(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + /// + /// Deletes the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static void Delete(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + ((IAzureFirewallsOperations)operations).DeleteAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewall Get(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + return ((IAzureFirewallsOperations)operations).GetAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Creates or updates the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewall CreateOrUpdate(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters) + { + return ((IAzureFirewallsOperations)operations).CreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Gets the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - public static AzureFirewall Get(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + } + /// + /// Updates tags of an Azure Firewall resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewall UpdateTags(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters) + { + return ((IAzureFirewallsOperations)operations).UpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates tags of an Azure Firewall resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Lists all Azure Firewalls in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IAzureFirewallsOperations operations, string resourceGroupName) + { + return ((IAzureFirewallsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all Azure Firewalls in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAzureFirewallsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Creates or updates the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to the create or update Azure Firewall operation. - /// - public static AzureFirewall CreateOrUpdate(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters) + } + /// + /// Gets all the Azure Firewalls in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IAzureFirewallsOperations operations) + { + return ((IAzureFirewallsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the Azure Firewalls in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IAzureFirewallsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates or updates the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to the create or update Azure Firewall operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + public static IPPrefixesList ListLearnedPrefixes(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + return ((IAzureFirewallsOperations)operations).ListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListLearnedPrefixesAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Updates tags of an Azure Firewall resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to update azure firewall tags. - /// - public static AzureFirewall UpdateTags(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters) + } + /// + /// Runs a packet capture on AzureFirewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewallsPacketCaptureHeaders PacketCapture(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters) + { + return ((IAzureFirewallsOperations)operations).PacketCaptureAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Runs a packet capture on AzureFirewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PacketCaptureAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PacketCaptureWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + return _result.Headers; } - - /// - /// Updates tags of an Azure Firewall resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to update azure firewall tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Deletes the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static void BeginDelete(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + ((IAzureFirewallsOperations)operations).BeginDeleteAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewall BeginCreateOrUpdate(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters) + { + return ((IAzureFirewallsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the specified Azure Firewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all Azure Firewalls in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IAzureFirewallsOperations operations, string resourceGroupName) + } + /// + /// Updates tags of an Azure Firewall resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewall BeginUpdateTags(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters) + { + return ((IAzureFirewallsOperations)operations).BeginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates tags of an Azure Firewall resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all Azure Firewalls in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAzureFirewallsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the Azure Firewalls in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IAzureFirewallsOperations operations) + } + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + public static IPPrefixesList BeginListLearnedPrefixes(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + return ((IAzureFirewallsOperations)operations).BeginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListLearnedPrefixesAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the Azure Firewalls in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IAzureFirewallsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Runs a packet capture on AzureFirewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + public static AzureFirewallsPacketCaptureHeaders BeginPacketCapture(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters) + { + return ((IAzureFirewallsOperations)operations).BeginPacketCaptureAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Runs a packet capture on AzureFirewall. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Azure Firewall. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPacketCaptureAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginPacketCaptureWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } - - /// - /// Retrieves a list of all IP prefixes that azure firewall has learned to not - /// SNAT. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the azure firewall. - /// - public static IPPrefixesList ListLearnedPrefixes(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + } + /// + /// Lists all Azure Firewalls in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAzureFirewallsOperations operations, string nextPageLink) + { + return ((IAzureFirewallsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all Azure Firewalls in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAzureFirewallsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Retrieves a list of all IP prefixes that azure firewall has learned to not - /// SNAT. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the azure firewall. - /// - /// - /// The cancellation token. - /// - public static async Task ListLearnedPrefixesAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Gets all the Azure Firewalls in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IAzureFirewallsOperations operations, string nextPageLink) + { + return ((IAzureFirewallsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Azure Firewalls in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IAzureFirewallsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Runs a packet capture on AzureFirewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to run packet capture on azure firewall. - /// - public static AzureFirewallsPacketCaptureHeaders PacketCaptureMethod(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters) - { - return operations.PacketCaptureMethodAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Runs a packet capture on AzureFirewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to run packet capture on azure firewall. - /// - /// - /// The cancellation token. - /// - public static async Task PacketCaptureMethodAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PacketCaptureMethodWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Deletes the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - public static void BeginDelete(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) - { - operations.BeginDeleteAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to the create or update Azure Firewall operation. - /// - public static AzureFirewall BeginCreateOrUpdate(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified Azure Firewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to the create or update Azure Firewall operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates tags of an Azure Firewall resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to update azure firewall tags. - /// - public static AzureFirewall BeginUpdateTags(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates tags of an Azure Firewall resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to update azure firewall tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves a list of all IP prefixes that azure firewall has learned to not - /// SNAT. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the azure firewall. - /// - public static IPPrefixesList BeginListLearnedPrefixes(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) - { - return operations.BeginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves a list of all IP prefixes that azure firewall has learned to not - /// SNAT. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the azure firewall. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListLearnedPrefixesAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Runs a packet capture on AzureFirewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to run packet capture on azure firewall. - /// - public static AzureFirewallsPacketCaptureHeaders BeginPacketCaptureMethod(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters) - { - return operations.BeginPacketCaptureMethodAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Runs a packet capture on AzureFirewall. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Azure Firewall. - /// - /// - /// Parameters supplied to run packet capture on azure firewall. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPacketCaptureMethodAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginPacketCaptureMethodWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists all Azure Firewalls in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAzureFirewallsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Azure Firewalls in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAzureFirewallsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the Azure Firewalls in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IAzureFirewallsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Azure Firewalls in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IAzureFirewallsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/BastionHostsOperations.cs b/src/Network/Network.Management.Sdk/Generated/BastionHostsOperations.cs index a3c8cea20eb0..ede17b88c211 100644 --- a/src/Network/Network.Management.Sdk/Generated/BastionHostsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/BastionHostsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// BastionHostsOperations operations. /// - internal partial class BastionHostsOperations : IServiceOperations, IBastionHostsOperations + internal partial class BastionHostsOperations : Microsoft.Rest.IServiceOperations, IBastionHostsOperations { /// /// Initializes a new instance of the BastionHostsOperations class. @@ -36,13 +24,13 @@ internal partial class BastionHostsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BastionHostsOperations(NetworkManagementClient client) + internal BastionHostsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal BastionHostsOperations(NetworkManagementClient client) /// The name of the Bastion Host. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, bastionHostName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, bastionHostName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal BastionHostsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Bastion Host. /// @@ -279,16 +283,16 @@ internal BastionHostsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update Bastion Host operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -304,16 +308,16 @@ internal BastionHostsOperations(NetworkManagementClient client) /// Parameters supplied to update BastionHost tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -325,13 +329,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -340,29 +344,38 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -372,25 +385,24 @@ internal BastionHostsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -402,55 +414,56 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -460,9 +473,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -473,25 +487,29 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Bastion Hosts in a resource group. /// @@ -504,13 +522,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -519,35 +537,45 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -557,25 +585,24 @@ internal BastionHostsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -587,55 +614,56 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -645,9 +673,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -658,25 +687,29 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Bastion Host. /// @@ -692,10 +725,10 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -704,41 +737,52 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +792,24 @@ internal BastionHostsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +821,56 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,20 +880,25 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Bastion Host. /// @@ -868,13 +917,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -883,50 +932,61 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (bastionHostName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (bastionHostName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -936,25 +996,24 @@ internal BastionHostsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -966,61 +1025,62 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1030,9 +1090,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1043,16 +1104,16 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1061,25 +1122,29 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates Tags for BastionHost resource /// @@ -1098,13 +1163,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1113,46 +1178,57 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (bastionHostName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1162,25 +1238,24 @@ internal BastionHostsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1192,61 +1267,62 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1256,9 +1332,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1269,25 +1346,29 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Bastion Hosts in a subscription. /// @@ -1300,13 +1381,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1315,51 +1396,54 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1371,55 +1455,56 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1429,9 +1514,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1442,25 +1528,29 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Bastion Hosts in a resource group. /// @@ -1473,13 +1563,13 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1488,51 +1578,54 @@ internal BastionHostsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1544,55 +1637,56 @@ internal BastionHostsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1602,9 +1696,10 @@ internal BastionHostsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1615,24 +1710,28 @@ internal BastionHostsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/BastionHostsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/BastionHostsOperationsExtensions.cs index f801112ca221..91d20b008765 100644 --- a/src/Network/Network.Management.Sdk/Generated/BastionHostsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/BastionHostsOperationsExtensions.cs @@ -1,453 +1,409 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for BastionHostsOperations. + /// Extension methods for BastionHostsOperations /// public static partial class BastionHostsOperationsExtensions { - /// - /// Deletes the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - public static void Delete(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName) - { - operations.DeleteAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - public static BastionHost Get(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName) - { - return operations.GetAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to the create or update Bastion Host operation. - /// - public static BastionHost CreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to the create or update Bastion Host operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates Tags for BastionHost resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to update BastionHost tags. - /// - public static BastionHost UpdateTags(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates Tags for BastionHost resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to update BastionHost tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static void Delete(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName) + { + ((IBastionHostsOperations)operations).DeleteAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); + } - /// - /// Lists all Bastion Hosts in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IBastionHostsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Deletes the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static BastionHost Get(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName) + { + return ((IBastionHostsOperations)operations).GetAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); + } - /// - /// Lists all Bastion Hosts in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IBastionHostsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static BastionHost CreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters) + { + return ((IBastionHostsOperations)operations).CreateOrUpdateAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all Bastion Hosts in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IBastionHostsOperations operations, string resourceGroupName) + /// + /// Creates or updates the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates Tags for BastionHost resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static BastionHost UpdateTags(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters) + { + return ((IBastionHostsOperations)operations).UpdateTagsAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all Bastion Hosts in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IBastionHostsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates Tags for BastionHost resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Bastion Hosts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IBastionHostsOperations operations) + { + return ((IBastionHostsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - public static void BeginDelete(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName) + /// + /// Lists all Bastion Hosts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IBastionHostsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Bastion Hosts in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IBastionHostsOperations operations, string resourceGroupName) + { + return ((IBastionHostsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Bastion Hosts in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IBastionHostsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static void BeginDelete(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName) + { + ((IBastionHostsOperations)operations).BeginDeleteAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to the create or update Bastion Host operation. - /// - public static BastionHost BeginCreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static BastionHost BeginCreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters) + { + return ((IBastionHostsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Bastion Host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to the create or update Bastion Host operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Bastion Host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, BastionHost parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates Tags for BastionHost resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static BastionHost BeginUpdateTags(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters) + { + return ((IBastionHostsOperations)operations).BeginUpdateTagsAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates Tags for BastionHost resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to update BastionHost tags. - /// - public static BastionHost BeginUpdateTags(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters) + /// + /// Updates Tags for BastionHost resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateTagsAsync(resourceGroupName, bastionHostName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Bastion Hosts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IBastionHostsOperations operations, string nextPageLink) + { + return ((IBastionHostsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Updates Tags for BastionHost resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Parameters supplied to update BastionHost tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Bastion Hosts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IBastionHostsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Bastion Hosts in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IBastionHostsOperations operations, string nextPageLink) + { + return ((IBastionHostsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all Bastion Hosts in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IBastionHostsOperations operations, string nextPageLink) + /// + /// Lists all Bastion Hosts in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IBastionHostsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all Bastion Hosts in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IBastionHostsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all Bastion Hosts in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IBastionHostsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Bastion Hosts in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IBastionHostsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperations.cs b/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperations.cs index d9eda64ee50b..633433876f40 100644 --- a/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// BgpServiceCommunitiesOperations operations. /// - internal partial class BgpServiceCommunitiesOperations : IServiceOperations, IBgpServiceCommunitiesOperations + internal partial class BgpServiceCommunitiesOperations : Microsoft.Rest.IServiceOperations, IBgpServiceCommunitiesOperations { /// /// Initializes a new instance of the BgpServiceCommunitiesOperations class. @@ -36,13 +24,13 @@ internal partial class BgpServiceCommunitiesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BgpServiceCommunitiesOperations(NetworkManagementClient client) + internal BgpServiceCommunitiesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the available bgp service communities. /// @@ -238,13 +240,13 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,51 +255,54 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -309,55 +314,56 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -367,9 +373,10 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -380,24 +387,28 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperationsExtensions.cs index 47d56787811e..aef5f9cde51e 100644 --- a/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/BgpServiceCommunitiesOperationsExtensions.cs @@ -1,87 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for BgpServiceCommunitiesOperations. + /// Extension methods for BgpServiceCommunitiesOperations /// public static partial class BgpServiceCommunitiesOperationsExtensions { - /// - /// Gets all the available bgp service communities. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IBgpServiceCommunitiesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Gets all the available bgp service communities. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IBgpServiceCommunitiesOperations operations) + { + return ((IBgpServiceCommunitiesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all the available bgp service communities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IBgpServiceCommunitiesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the available bgp service communities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IBgpServiceCommunitiesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the available bgp service communities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IBgpServiceCommunitiesOperations operations, string nextPageLink) + { + return ((IBgpServiceCommunitiesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the available bgp service communities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IBgpServiceCommunitiesOperations operations, string nextPageLink) + /// + /// Gets all the available bgp service communities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IBgpServiceCommunitiesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the available bgp service communities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IBgpServiceCommunitiesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperations.cs index b9d4db73b3eb..08c5b7c8322b 100644 --- a/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ConfigurationPolicyGroupsOperations operations. /// - internal partial class ConfigurationPolicyGroupsOperations : IServiceOperations, IConfigurationPolicyGroupsOperations + internal partial class ConfigurationPolicyGroupsOperations : Microsoft.Rest.IServiceOperations, IConfigurationPolicyGroupsOperations { /// /// Initializes a new instance of the ConfigurationPolicyGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class ConfigurationPolicyGroupsOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) + internal ConfigurationPolicyGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the - /// existing one. + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. /// /// /// The resource group name of the ConfigurationPolicyGroup. @@ -68,16 +55,16 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// PolicyGroup. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,16 +80,16 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// The name of the ConfigurationPolicyGroup. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -123,13 +110,13 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -138,47 +125,59 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + if (configurationPolicyGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationPolicyGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationPolicyGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("configurationPolicyGroupName", configurationPolicyGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); _url = _url.Replace("{configurationPolicyGroupName}", System.Uri.EscapeDataString(configurationPolicyGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -188,25 +187,24 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -218,55 +216,56 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -276,9 +275,10 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -289,25 +289,29 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the configurationPolicyGroups in a resource group for a /// vpnServerConfiguration. @@ -324,13 +328,13 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -339,41 +343,52 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnServerConfigurationWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnServerConfigurationWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnServerConfiguration", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnServerConfiguration", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -383,25 +398,24 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -413,55 +427,56 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -471,9 +486,10 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -484,27 +500,31 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the /// existing one. /// /// @@ -526,13 +546,13 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -541,52 +561,65 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnServerConfigurationPolicyGroupParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationPolicyGroupParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + if (configurationPolicyGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationPolicyGroupName"); - } - if (vpnServerConfigurationPolicyGroupParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationPolicyGroupParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationPolicyGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("configurationPolicyGroupName", configurationPolicyGroupName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnServerConfigurationPolicyGroupParameters", vpnServerConfigurationPolicyGroupParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); _url = _url.Replace("{configurationPolicyGroupName}", System.Uri.EscapeDataString(configurationPolicyGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -596,25 +629,24 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -626,61 +658,62 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnServerConfigurationPolicyGroupParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationPolicyGroupParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationPolicyGroupParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -690,9 +723,10 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -703,16 +737,16 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -721,25 +755,29 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a ConfigurationPolicyGroup. /// @@ -758,10 +796,10 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -770,47 +808,59 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + if (configurationPolicyGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationPolicyGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationPolicyGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("configurationPolicyGroupName", configurationPolicyGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); _url = _url.Replace("{configurationPolicyGroupName}", System.Uri.EscapeDataString(configurationPolicyGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -820,25 +870,24 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -850,55 +899,56 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -908,20 +958,25 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the configurationPolicyGroups in a resource group for a /// vpnServerConfiguration. @@ -935,13 +990,13 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -950,51 +1005,54 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnServerConfigurationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnServerConfigurationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnServerConfigurationNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnServerConfigurationNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1006,55 +1064,56 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1064,9 +1123,10 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1077,24 +1137,28 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperationsExtensions.cs index ef7de7ba73a7..250a57f6b920 100644 --- a/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ConfigurationPolicyGroupsOperationsExtensions.cs @@ -1,347 +1,315 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ConfigurationPolicyGroupsOperations. + /// Extension methods for ConfigurationPolicyGroupsOperations /// public static partial class ConfigurationPolicyGroupsOperationsExtensions { - /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the - /// existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - /// - /// Parameters supplied to create or update a VpnServerConfiguration - /// PolicyGroup. - /// - public static VpnServerConfigurationPolicyGroup CreateOrUpdate(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the - /// existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - /// - /// Parameters supplied to create or update a VpnServerConfiguration - /// PolicyGroup. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a ConfigurationPolicyGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - public static void Delete(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName) - { - operations.DeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a ConfigurationPolicyGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves the details of a ConfigurationPolicyGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup being retrieved. - /// - public static VpnServerConfigurationPolicyGroup Get(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName) - { - return operations.GetAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).GetAwaiter().GetResult(); - } + /// + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + public static VpnServerConfigurationPolicyGroup CreateOrUpdate(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters) + { + return ((IConfigurationPolicyGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of a ConfigurationPolicyGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup being retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a ConfigurationPolicyGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + public static void Delete(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName) + { + ((IConfigurationPolicyGroupsOperations)operations).DeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).GetAwaiter().GetResult(); + } - /// - /// Lists all the configurationPolicyGroups in a resource group for a - /// vpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration. - /// - public static IPage ListByVpnServerConfiguration(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName) - { - return operations.ListByVpnServerConfigurationAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); - } + /// + /// Deletes a ConfigurationPolicyGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of a ConfigurationPolicyGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup being retrieved. + /// + public static VpnServerConfigurationPolicyGroup Get(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName) + { + return ((IConfigurationPolicyGroupsOperations)operations).GetAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).GetAwaiter().GetResult(); + } - /// - /// Lists all the configurationPolicyGroups in a resource group for a - /// vpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnServerConfigurationAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a ConfigurationPolicyGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup being retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByVpnServerConfigurationWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all the configurationPolicyGroups in a resource group for a + /// vpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnServerConfiguration(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName) + { + return ((IConfigurationPolicyGroupsOperations)operations).ListByVpnServerConfigurationAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the - /// existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - /// - /// Parameters supplied to create or update a VpnServerConfiguration - /// PolicyGroup. - /// - public static VpnServerConfigurationPolicyGroup BeginCreateOrUpdate(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters) + /// + /// Lists all the configurationPolicyGroups in a resource group for a + /// vpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnServerConfigurationAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnServerConfigurationWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + public static VpnServerConfigurationPolicyGroup BeginCreateOrUpdate(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters) + { + return ((IConfigurationPolicyGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the - /// existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - /// - /// Parameters supplied to create or update a VpnServerConfiguration - /// PolicyGroup. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a ConfigurationPolicyGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + public static void BeginDelete(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName) + { + ((IConfigurationPolicyGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes a ConfigurationPolicyGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - public static void BeginDelete(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName) - { - operations.BeginDeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).GetAwaiter().GetResult(); - } + /// + /// Deletes a ConfigurationPolicyGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ConfigurationPolicyGroup. + /// + /// + /// The name of the VpnServerConfiguration. + /// + /// + /// The name of the ConfigurationPolicyGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the configurationPolicyGroups in a resource group for a + /// vpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnServerConfigurationNext(this IConfigurationPolicyGroupsOperations operations, string nextPageLink) + { + return ((IConfigurationPolicyGroupsOperations)operations).ListByVpnServerConfigurationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a ConfigurationPolicyGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ConfigurationPolicyGroup. - /// - /// - /// The name of the VpnServerConfiguration. - /// - /// - /// The name of the ConfigurationPolicyGroup. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IConfigurationPolicyGroupsOperations operations, string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the configurationPolicyGroups in a resource group for a + /// vpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnServerConfigurationNextAsync(this IConfigurationPolicyGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnServerConfigurationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Lists all the configurationPolicyGroups in a resource group for a - /// vpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVpnServerConfigurationNext(this IConfigurationPolicyGroupsOperations operations, string nextPageLink) - { - return operations.ListByVpnServerConfigurationNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the configurationPolicyGroups in a resource group for a - /// vpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnServerConfigurationNextAsync(this IConfigurationPolicyGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnServerConfigurationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperations.cs index e3bc25a71030..203ac9d60c8a 100644 --- a/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ConnectionMonitorsOperations operations. /// - internal partial class ConnectionMonitorsOperations : IServiceOperations, IConnectionMonitorsOperations + internal partial class ConnectionMonitorsOperations : Microsoft.Rest.IServiceOperations, IConnectionMonitorsOperations { /// /// Initializes a new instance of the ConnectionMonitorsOperations class. @@ -36,13 +24,13 @@ internal partial class ConnectionMonitorsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ConnectionMonitorsOperations(NetworkManagementClient client) + internal ConnectionMonitorsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,24 +50,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The name of the connection monitor. /// - /// - /// Parameters that define the operation to create a connection monitor. - /// /// /// Value indicating whether connection monitor V1 should be migrated to V2 /// format. /// + /// + /// Parameters that define the operation to create a connection monitor. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -100,13 +88,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -115,47 +103,59 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (connectionMonitorName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -165,25 +165,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -195,50 +194,51 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -248,9 +248,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -261,25 +262,29 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified connection monitor. /// @@ -293,16 +298,16 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// The name of the connection monitor. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -326,13 +331,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -341,52 +346,64 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (connectionMonitorName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -396,25 +413,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -426,56 +442,57 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -485,9 +502,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -498,25 +516,29 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops the specified connection monitor. /// @@ -530,16 +552,16 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// The name of the connection monitor. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -555,16 +577,16 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// The name of the connection monitor. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -580,16 +602,16 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// The name given to the connection monitor. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> QueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> QueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginQueryWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginQueryWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -607,13 +629,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -622,41 +644,52 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -666,25 +699,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -696,50 +728,51 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -749,9 +782,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -762,25 +796,29 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a connection monitor. /// @@ -793,26 +831,26 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The name of the connection monitor. /// - /// - /// Parameters that define the operation to create a connection monitor. - /// /// /// Value indicating whether connection monitor V1 should be migrated to V2 /// format. /// + /// + /// Parameters that define the operation to create a connection monitor. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -821,57 +859,70 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (connectionMonitorName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (parameters != null) + + if (connectionMonitorName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("migrate", migrate); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -885,25 +936,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -915,56 +965,57 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -974,9 +1025,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -987,16 +1039,16 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1005,25 +1057,29 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified connection monitor. /// @@ -1042,10 +1098,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1054,47 +1110,59 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (connectionMonitorName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1104,25 +1172,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1134,50 +1201,51 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1187,20 +1255,25 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops the specified connection monitor. /// @@ -1219,10 +1292,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1231,47 +1304,59 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (connectionMonitorName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1281,25 +1366,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1311,50 +1395,51 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1364,20 +1449,25 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts the specified connection monitor. /// @@ -1396,10 +1486,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1408,47 +1498,59 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (connectionMonitorName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1458,25 +1560,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1488,50 +1589,51 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1541,20 +1643,25 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Query a snapshot of the most recent connection states. /// @@ -1573,13 +1680,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1588,47 +1695,59 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginQueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginQueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (connectionMonitorName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionMonitorName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginQuery", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginQuery", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1638,25 +1757,24 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1668,50 +1786,51 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1721,9 +1840,10 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1734,16 +1854,16 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1752,24 +1872,28 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperationsExtensions.cs index 87fd32555585..c56c453a9518 100644 --- a/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ConnectionMonitorsOperationsExtensions.cs @@ -1,635 +1,593 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ConnectionMonitorsOperations. + /// Extension methods for ConnectionMonitorsOperations /// public static partial class ConnectionMonitorsOperationsExtensions { - /// - /// Create or update a connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// Parameters that define the operation to create a connection monitor. - /// - /// - /// Value indicating whether connection monitor V1 should be migrated to V2 - /// format. - /// - public static ConnectionMonitorResult CreateOrUpdate(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate).GetAwaiter().GetResult(); - } - - /// - /// Create or update a connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// Parameters that define the operation to create a connection monitor. - /// - /// - /// Value indicating whether connection monitor V1 should be migrated to V2 - /// format. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a connection monitor by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static ConnectionMonitorResult Get(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - return operations.GetAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } - - /// - /// Gets a connection monitor by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static void Delete(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - operations.DeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Update tags of the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the connection monitor. - /// - /// - /// Parameters supplied to update connection monitor tags. - /// - public static ConnectionMonitorResult UpdateTags(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update tags of the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the connection monitor. - /// - /// - /// Parameters supplied to update connection monitor tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static void Stop(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - operations.StopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } - - /// - /// Stops the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task StopAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Starts the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static void Start(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - operations.StartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } - - /// - /// Starts the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Query a snapshot of the most recent connection states. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the connection monitor. - /// - public static ConnectionMonitorQueryResult Query(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - return operations.QueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } + /// + /// Create or update a connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// Value indicating whether connection monitor V1 should be migrated to V2 + /// format. + /// + public static ConnectionMonitorResult CreateOrUpdate(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string)) + { + return ((IConnectionMonitorsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate).GetAwaiter().GetResult(); + } - /// - /// Query a snapshot of the most recent connection states. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task QueryAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// Value indicating whether connection monitor V1 should be migrated to V2 + /// format. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.QueryWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a connection monitor by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static ConnectionMonitorResult Get(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + return ((IConnectionMonitorsOperations)operations).GetAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Lists all connection monitors for the specified Network Watcher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - public static IEnumerable List(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName) + /// + /// Gets a connection monitor by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static void Delete(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + ((IConnectionMonitorsOperations)operations).DeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Lists all connection monitors for the specified Network Watcher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Update tags of the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the connection monitor. + /// + public static ConnectionMonitorResult UpdateTags(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters) + { + return ((IConnectionMonitorsOperations)operations).UpdateTagsAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update a connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// Parameters that define the operation to create a connection monitor. - /// - /// - /// Value indicating whether connection monitor V1 should be migrated to V2 - /// format. - /// - public static ConnectionMonitorResult BeginCreateOrUpdate(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string)) + /// + /// Update tags of the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Stops the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static void Stop(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + ((IConnectionMonitorsOperations)operations).StopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Create or update a connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// Parameters that define the operation to create a connection monitor. - /// - /// - /// Value indicating whether connection monitor V1 should be migrated to V2 - /// format. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Stops the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static void Start(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + ((IConnectionMonitorsOperations)operations).StartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static void BeginDelete(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - operations.BeginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } + /// + /// Starts the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Query a snapshot of the most recent connection states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the connection monitor. + /// + public static ConnectionMonitorQueryResult Query(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + return ((IConnectionMonitorsOperations)operations).QueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Query a snapshot of the most recent connection states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task QueryAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.QueryWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all connection monitors for the specified Network Watcher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + public static System.Collections.Generic.IEnumerable List(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName) + { + return ((IConnectionMonitorsOperations)operations).ListAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + } - /// - /// Stops the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static void BeginStop(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + /// + /// Lists all connection monitors for the specified Network Watcher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update a connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// Value indicating whether connection monitor V1 should be migrated to V2 + /// format. + /// + public static ConnectionMonitorResult BeginCreateOrUpdate(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string)) + { + return ((IConnectionMonitorsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate).GetAwaiter().GetResult(); + } - /// - /// Stops the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// Value indicating whether connection monitor V1 should be migrated to V2 + /// format. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static void BeginDelete(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + ((IConnectionMonitorsOperations)operations).BeginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Starts the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - public static void BeginStart(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - operations.BeginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stops the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static void BeginStop(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + ((IConnectionMonitorsOperations)operations).BeginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Starts the specified connection monitor. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name of the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Stops the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + public static void BeginStart(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + ((IConnectionMonitorsOperations)operations).BeginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Query a snapshot of the most recent connection states. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the connection monitor. - /// - public static ConnectionMonitorQueryResult BeginQuery(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) - { - return operations.BeginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); - } + /// + /// Starts the specified connection monitor. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name of the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Query a snapshot of the most recent connection states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the connection monitor. + /// + public static ConnectionMonitorQueryResult BeginQuery(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName) + { + return ((IConnectionMonitorsOperations)operations).BeginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).GetAwaiter().GetResult(); + } - /// - /// Query a snapshot of the most recent connection states. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the connection monitor. - /// - /// - /// The cancellation token. - /// - public static async Task BeginQueryAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Query a snapshot of the most recent connection states. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the connection monitor. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginQueryAsync(this IConnectionMonitorsOperations operations, string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginQueryWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginQueryWithHttpMessagesAsync(resourceGroupName, networkWatcherName, connectionMonitorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperations.cs index ba322fa5647f..007f09553be7 100644 --- a/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ConnectivityConfigurationsOperations operations. /// - internal partial class ConnectivityConfigurationsOperations : IServiceOperations, IConnectivityConfigurationsOperations + internal partial class ConnectivityConfigurationsOperations : Microsoft.Rest.IServiceOperations, IConnectivityConfigurationsOperations { /// /// Initializes a new instance of the ConnectivityConfigurationsOperations class. @@ -36,13 +24,13 @@ internal partial class ConnectivityConfigurationsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal ConnectivityConfigurationsOperations(NetworkManagementClient client) + internal ConnectivityConfigurationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -69,13 +57,13 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,47 +72,59 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -134,25 +134,24 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -164,55 +163,56 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -222,9 +222,10 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -235,32 +236,32 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates/Updates a new network manager connectivity configuration /// - /// - /// Parameters supplied to create/update a network manager connectivity - /// configuration - /// /// /// The name of the resource group. /// @@ -270,19 +271,23 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// The name of the network manager connectivity configuration. /// + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -291,56 +296,65 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, ConnectivityConfiguration connectivityConfiguration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (connectivityConfiguration == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectivityConfiguration"); - } - if (connectivityConfiguration != null) - { - connectivityConfiguration.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectivityConfiguration"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("connectivityConfiguration", connectivityConfiguration); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); + + tracingParameters.Add("connectivityConfiguration", connectivityConfiguration); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -350,25 +364,24 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -380,61 +393,62 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(connectivityConfiguration != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectivityConfiguration, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(connectivityConfiguration, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -444,9 +458,10 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -457,16 +472,16 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -475,28 +490,31 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deletes a network manager connectivity configuration, specified by the - /// resource group, network manager name, and connectivity configuration name + /// Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and connectivity configuration name /// /// /// The name of the resource group. @@ -513,16 +531,16 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// in the background, prior to the delete. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -551,13 +569,13 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -566,61 +584,73 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -631,25 +661,24 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -661,55 +690,56 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -719,9 +749,10 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -732,25 +763,29 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a network manager connectivity configuration, specified by the /// resource group, network manager name, and connectivity configuration name @@ -775,10 +810,10 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -787,80 +822,92 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("force", force); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -872,55 +919,56 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -930,33 +978,38 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the network manager connectivity configuration in a specified /// network manager. @@ -970,13 +1023,13 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -985,51 +1038,54 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1041,55 +1097,56 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1099,9 +1156,10 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1112,24 +1170,28 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperationsExtensions.cs index 6dcbc9818272..1e11cbb61665 100644 --- a/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ConnectivityConfigurationsOperationsExtensions.cs @@ -1,341 +1,318 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ConnectivityConfigurationsOperations. + /// Extension methods for ConnectivityConfigurationsOperations /// public static partial class ConnectivityConfigurationsOperationsExtensions { - /// - /// Gets a Network Connectivity Configuration, specified by the resource group, - /// network manager name, and connectivity Configuration name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - public static ConnectivityConfiguration Get(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); - } - - /// - /// Gets a Network Connectivity Configuration, specified by the resource group, - /// network manager name, and connectivity Configuration name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + public static ConnectivityConfiguration Get(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return ((IConnectivityConfigurationsOperations)operations).GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } - /// - /// Creates/Updates a new network manager connectivity configuration - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to create/update a network manager connectivity - /// configuration - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - public static ConnectivityConfiguration CreateOrUpdate(this IConnectivityConfigurationsOperations operations, ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + /// + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(connectivityConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates/Updates a new network manager connectivity configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + public static ConnectivityConfiguration CreateOrUpdate(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, ConnectivityConfiguration connectivityConfiguration) + { + return ((IConnectivityConfigurationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, configurationName, connectivityConfiguration).GetAwaiter().GetResult(); + } - /// - /// Creates/Updates a new network manager connectivity configuration - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to create/update a network manager connectivity - /// configuration - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IConnectivityConfigurationsOperations operations, ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates/Updates a new network manager connectivity configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, ConnectivityConfiguration connectivityConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, connectivityConfiguration, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(connectivityConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static ConnectivityConfigurationsDeleteHeaders Delete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return ((IConnectivityConfigurationsOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); + } - /// - /// Deletes a network manager connectivity configuration, specified by the - /// resource group, network manager name, and connectivity configuration name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static ConnectivityConfigurationsDeleteHeaders Delete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return ((IConnectivityConfigurationsOperations)operations).ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Deletes a network manager connectivity configuration, specified by the - /// resource group, network manager name, and connectivity configuration name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } + } + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static ConnectivityConfigurationsDeleteHeaders BeginDelete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return ((IConnectivityConfigurationsOperations)operations).BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); + } - /// - /// Lists all the network manager connectivity configuration in a specified - /// network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IConnectivityConfigurationsOperations operations, string nextPageLink) + { + return ((IConnectivityConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the network manager connectivity configuration in a specified - /// network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IConnectivityConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes a network manager connectivity configuration, specified by the - /// resource group, network manager name, and connectivity configuration name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static ConnectivityConfigurationsDeleteHeaders BeginDelete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) - { - return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); - } - - /// - /// Deletes a network manager connectivity configuration, specified by the - /// resource group, network manager name, and connectivity configuration name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists all the network manager connectivity configuration in a specified - /// network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IConnectivityConfigurationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the network manager connectivity configuration in a specified - /// network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IConnectivityConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperations.cs b/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperations.cs index 2420c4628166..b2e9ed22004e 100644 --- a/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CustomIPPrefixesOperations operations. /// - internal partial class CustomIPPrefixesOperations : IServiceOperations, ICustomIPPrefixesOperations + internal partial class CustomIPPrefixesOperations : Microsoft.Rest.IServiceOperations, ICustomIPPrefixesOperations { /// /// Initializes a new instance of the CustomIPPrefixesOperations class. @@ -36,13 +24,13 @@ internal partial class CustomIPPrefixesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CustomIPPrefixesOperations(NetworkManagementClient client) + internal CustomIPPrefixesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// The name of the CustomIpPrefix. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (customIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "customIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "customIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("customIpPrefixName", customIpPrefixName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{customIpPrefixName}", System.Uri.EscapeDataString(customIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a custom IP prefix. /// @@ -287,16 +292,16 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update custom IP prefix operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (customIpPrefixName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "customIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (customIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "customIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("customIpPrefixName", customIpPrefixName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{customIpPrefixName}", System.Uri.EscapeDataString(customIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the custom IP prefixes in a subscription. /// @@ -516,13 +537,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,29 +552,38 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +593,24 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +622,56 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +681,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +695,29 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all custom IP prefixes in a resource group. /// @@ -695,13 +730,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,35 +745,45 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified custom IP prefix. /// @@ -883,10 +933,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (customIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "customIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "customIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("customIpPrefixName", customIpPrefixName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{customIpPrefixName}", System.Uri.EscapeDataString(customIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a custom IP prefix. /// @@ -1059,13 +1125,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,46 +1140,58 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (customIpPrefixName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "customIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (customIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "customIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("customIpPrefixName", customIpPrefixName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{customIpPrefixName}", System.Uri.EscapeDataString(customIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1123,25 +1201,24 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1153,61 +1230,62 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1217,9 +1295,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1230,16 +1309,16 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1248,25 +1327,29 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the custom IP prefixes in a subscription. /// @@ -1279,13 +1362,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1294,51 +1377,54 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1350,55 +1436,56 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1408,9 +1495,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1421,25 +1509,29 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all custom IP prefixes in a resource group. /// @@ -1452,13 +1544,13 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,51 +1559,54 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1523,55 +1618,56 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1677,10 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1594,24 +1691,28 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperationsExtensions.cs index 54e20dfe38fc..0146a10396a4 100644 --- a/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/CustomIPPrefixesOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CustomIPPrefixesOperations. + /// Extension methods for CustomIPPrefixesOperations /// public static partial class CustomIPPrefixesOperationsExtensions { - /// - /// Deletes the specified custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the CustomIpPrefix. - /// - public static void Delete(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName) - { - operations.DeleteAsync(resourceGroupName, customIpPrefixName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the CustomIpPrefix. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified custom IP prefix in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Expands referenced resources. - /// - public static CustomIpPrefix Get(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, customIpPrefixName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the CustomIpPrefix. + /// + public static void Delete(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName) + { + ((ICustomIPPrefixesOperations)operations).DeleteAsync(resourceGroupName, customIpPrefixName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified custom IP prefix in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the CustomIpPrefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified custom IP prefix in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + /// + /// Expands referenced resources. + /// + public static CustomIpPrefix Get(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, string expand = default(string)) + { + return ((ICustomIPPrefixesOperations)operations).GetAsync(resourceGroupName, customIpPrefixName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Parameters supplied to the create or update custom IP prefix operation. - /// - public static CustomIpPrefix CreateOrUpdate(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters) + /// + /// Gets the specified custom IP prefix in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + public static CustomIpPrefix CreateOrUpdate(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters) + { + return ((ICustomIPPrefixesOperations)operations).CreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Parameters supplied to the create or update custom IP prefix operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates custom IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + public static CustomIpPrefix UpdateTags(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, TagsObject parameters) + { + return ((ICustomIPPrefixesOperations)operations).UpdateTagsAsync(resourceGroupName, customIpPrefixName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates custom IP prefix tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Parameters supplied to update custom IP prefix tags. - /// - public static CustomIpPrefix UpdateTags(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, TagsObject parameters) + /// + /// Updates custom IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, customIpPrefixName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the custom IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this ICustomIPPrefixesOperations operations) + { + return ((ICustomIPPrefixesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Updates custom IP prefix tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Parameters supplied to update custom IP prefix tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the custom IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this ICustomIPPrefixesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all custom IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this ICustomIPPrefixesOperations operations, string resourceGroupName) + { + return ((ICustomIPPrefixesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all the custom IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this ICustomIPPrefixesOperations operations) + /// + /// Gets all custom IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the CustomIpPrefix. + /// + public static void BeginDelete(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName) + { + ((ICustomIPPrefixesOperations)operations).BeginDeleteAsync(resourceGroupName, customIpPrefixName).GetAwaiter().GetResult(); + } - /// - /// Gets all the custom IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this ICustomIPPrefixesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the CustomIpPrefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + public static CustomIpPrefix BeginCreateOrUpdate(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters) + { + return ((ICustomIPPrefixesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all custom IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this ICustomIPPrefixesOperations operations, string resourceGroupName) + /// + /// Creates or updates a custom IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the custom IP prefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the custom IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this ICustomIPPrefixesOperations operations, string nextPageLink) + { + return ((ICustomIPPrefixesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all custom IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the custom IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this ICustomIPPrefixesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all custom IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ICustomIPPrefixesOperations operations, string nextPageLink) + { + return ((ICustomIPPrefixesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the CustomIpPrefix. - /// - public static void BeginDelete(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName) + /// + /// Gets all custom IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ICustomIPPrefixesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, customIpPrefixName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the CustomIpPrefix. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Parameters supplied to the create or update custom IP prefix operation. - /// - public static CustomIpPrefix BeginCreateOrUpdate(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a custom IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the custom IP prefix. - /// - /// - /// Parameters supplied to the create or update custom IP prefix operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ICustomIPPrefixesOperations operations, string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, customIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the custom IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this ICustomIPPrefixesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the custom IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this ICustomIPPrefixesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all custom IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICustomIPPrefixesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all custom IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ICustomIPPrefixesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperations.cs index 5faa17d92e97..da9ecf34d403 100644 --- a/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DdosCustomPoliciesOperations operations. /// - internal partial class DdosCustomPoliciesOperations : IServiceOperations, IDdosCustomPoliciesOperations + internal partial class DdosCustomPoliciesOperations : Microsoft.Rest.IServiceOperations, IDdosCustomPoliciesOperations { /// /// Initializes a new instance of the DdosCustomPoliciesOperations class. @@ -36,13 +24,13 @@ internal partial class DdosCustomPoliciesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DdosCustomPoliciesOperations(NetworkManagementClient client) + internal DdosCustomPoliciesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// The name of the DDoS custom policy. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ddosCustomPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosCustomPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosCustomPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosCustomPolicyName", ddosCustomPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosCustomPolicyName}", System.Uri.EscapeDataString(ddosCustomPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a DDoS custom policy. /// @@ -279,16 +283,16 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -309,13 +313,13 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -324,46 +328,57 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ddosCustomPolicyName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosCustomPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ddosCustomPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosCustomPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosCustomPolicyName", ddosCustomPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosCustomPolicyName}", System.Uri.EscapeDataString(ddosCustomPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +388,24 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,61 +417,62 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -467,9 +482,10 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -480,25 +496,29 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified DDoS custom policy. /// @@ -514,10 +534,10 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -526,41 +546,52 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ddosCustomPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosCustomPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosCustomPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosCustomPolicyName", ddosCustomPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosCustomPolicyName}", System.Uri.EscapeDataString(ddosCustomPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -570,25 +601,24 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -600,55 +630,56 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -658,33 +689,38 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a DDoS custom policy. /// @@ -703,13 +739,13 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -718,46 +754,58 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ddosCustomPolicyName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosCustomPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ddosCustomPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosCustomPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosCustomPolicyName", ddosCustomPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosCustomPolicyName}", System.Uri.EscapeDataString(ddosCustomPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -767,25 +815,24 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -797,61 +844,62 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -861,9 +909,10 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -874,16 +923,16 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -892,24 +941,28 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperationsExtensions.cs index 6159b5bf3fa3..9b83c223f48c 100644 --- a/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/DdosCustomPoliciesOperationsExtensions.cs @@ -1,283 +1,250 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DdosCustomPoliciesOperations. + /// Extension methods for DdosCustomPoliciesOperations /// public static partial class DdosCustomPoliciesOperationsExtensions { - /// - /// Deletes the specified DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - public static DdosCustomPoliciesDeleteHeaders Delete(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName) - { - return operations.DeleteAsync(resourceGroupName, ddosCustomPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } + /// + /// Deletes the specified DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + public static DdosCustomPoliciesDeleteHeaders Delete(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName) + { + return ((IDdosCustomPoliciesOperations)operations).DeleteAsync(resourceGroupName, ddosCustomPolicyName).GetAwaiter().GetResult(); + } - /// - /// Gets information about the specified DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - public static DdosCustomPolicy Get(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName) + /// + /// Deletes the specified DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, ddosCustomPolicyName).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Gets information about the specified DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + public static DdosCustomPolicy Get(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName) + { + return ((IDdosCustomPoliciesOperations)operations).GetAsync(resourceGroupName, ddosCustomPolicyName).GetAwaiter().GetResult(); + } - /// - /// Gets information about the specified DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets information about the specified DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + public static DdosCustomPolicy CreateOrUpdate(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters) + { + return ((IDdosCustomPoliciesOperations)operations).CreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the create or update operation. - /// - public static DdosCustomPolicy CreateOrUpdate(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters) + /// + /// Creates or updates a DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a DDoS custom policy tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + public static DdosCustomPolicy UpdateTags(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters) + { + return ((IDdosCustomPoliciesOperations)operations).UpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the create or update operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a DDoS custom policy tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + public static DdosCustomPoliciesDeleteHeaders BeginDelete(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName) + { + return ((IDdosCustomPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, ddosCustomPolicyName).GetAwaiter().GetResult(); + } - /// - /// Update a DDoS custom policy tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to update DDoS custom policy resource tags. - /// - public static DdosCustomPolicy UpdateTags(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters) + /// + /// Deletes the specified DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Creates or updates a DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + public static DdosCustomPolicy BeginCreateOrUpdate(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters) + { + return ((IDdosCustomPoliciesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update a DDoS custom policy tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to update DDoS custom policy resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a DDoS custom policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS custom policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes the specified DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - public static DdosCustomPoliciesDeleteHeaders BeginDelete(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName) - { - return operations.BeginDeleteAsync(resourceGroupName, ddosCustomPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Creates or updates a DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the create or update operation. - /// - public static DdosCustomPolicy BeginCreateOrUpdate(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a DDoS custom policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the create or update operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperations.cs b/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperations.cs index 576baffba2cf..f37fd3a51579 100644 --- a/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DdosProtectionPlansOperations operations. /// - internal partial class DdosProtectionPlansOperations : IServiceOperations, IDdosProtectionPlansOperations + internal partial class DdosProtectionPlansOperations : Microsoft.Rest.IServiceOperations, IDdosProtectionPlansOperations { /// /// Initializes a new instance of the DdosProtectionPlansOperations class. @@ -36,13 +24,13 @@ internal partial class DdosProtectionPlansOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DdosProtectionPlansOperations(NetworkManagementClient client) + internal DdosProtectionPlansOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// The name of the DDoS protection plan. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ddosProtectionPlanName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosProtectionPlanName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a DDoS protection plan. /// @@ -279,16 +283,16 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// Parameters supplied to the create or update operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -309,13 +313,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -324,46 +328,57 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ddosProtectionPlanName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ddosProtectionPlanName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosProtectionPlanName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +388,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,61 +417,62 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -467,9 +482,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -480,25 +496,29 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all DDoS protection plans in a subscription. /// @@ -508,13 +528,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -523,29 +543,38 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -555,25 +584,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -585,55 +613,56 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -643,9 +672,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -656,25 +686,29 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the DDoS protection plans in a resource group. /// @@ -687,13 +721,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -702,35 +736,45 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -740,25 +784,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -770,55 +813,56 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -828,9 +872,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -841,25 +886,29 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified DDoS protection plan. /// @@ -875,10 +924,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -887,41 +936,52 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ddosProtectionPlanName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosProtectionPlanName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -931,25 +991,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -961,55 +1020,56 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1019,33 +1079,38 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a DDoS protection plan. /// @@ -1064,13 +1129,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1079,46 +1144,58 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ddosProtectionPlanName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ddosProtectionPlanName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ddosProtectionPlanName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1128,25 +1205,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1158,61 +1234,62 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1222,9 +1299,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1235,16 +1313,16 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1253,25 +1331,29 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all DDoS protection plans in a subscription. /// @@ -1284,13 +1366,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1299,51 +1381,54 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1355,55 +1440,56 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1413,9 +1499,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1426,25 +1513,29 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the DDoS protection plans in a resource group. /// @@ -1457,13 +1548,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1472,51 +1563,54 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1528,55 +1622,56 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1586,9 +1681,10 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1599,24 +1695,28 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperationsExtensions.cs index 698b09246061..f8e21f4248c7 100644 --- a/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/DdosProtectionPlansOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DdosProtectionPlansOperations. + /// Extension methods for DdosProtectionPlansOperations /// public static partial class DdosProtectionPlansOperationsExtensions { - /// - /// Deletes the specified DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - public static DdosProtectionPlansDeleteHeaders Delete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) - { - return operations.DeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Gets information about the specified DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - public static DdosProtectionPlan Get(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) - { - return operations.GetAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about the specified DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlansDeleteHeaders Delete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + return ((IDdosProtectionPlansOperations)operations).DeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the create or update operation. - /// - public static DdosProtectionPlan CreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlan Get(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + return ((IDdosProtectionPlansOperations)operations).GetAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the create or update operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlan CreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + { + return ((IDdosProtectionPlansOperations)operations).CreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update a DDoS protection plan tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the update DDoS protection plan resource tags. - /// - public static DdosProtectionPlan UpdateTags(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters) + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a DDoS protection plan tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlan UpdateTags(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters) + { + return ((IDdosProtectionPlansOperations)operations).UpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update a DDoS protection plan tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the update DDoS protection plan resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a DDoS protection plan tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IDdosProtectionPlansOperations operations) + { + return ((IDdosProtectionPlansOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all DDoS protection plans in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IDdosProtectionPlansOperations operations) + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDdosProtectionPlansOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDdosProtectionPlansOperations operations, string resourceGroupName) + { + return ((IDdosProtectionPlansOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all DDoS protection plans in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDdosProtectionPlansOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlansDeleteHeaders BeginDelete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + return ((IDdosProtectionPlansOperations)operations).BeginDeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } - /// - /// Gets all the DDoS protection plans in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IDdosProtectionPlansOperations operations, string resourceGroupName) + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlan BeginCreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + { + return ((IDdosProtectionPlansOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all the DDoS protection plans in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDdosProtectionPlansOperations operations, string nextPageLink) + { + return ((IDdosProtectionPlansOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - public static DdosProtectionPlansDeleteHeaders BeginDelete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginDeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDdosProtectionPlansOperations operations, string nextPageLink) + { + return ((IDdosProtectionPlansOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// Creates or updates a DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the create or update operation. - /// - public static DdosProtectionPlan BeginCreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a DDoS protection plan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the create or update operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all DDoS protection plans in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDdosProtectionPlansOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all DDoS protection plans in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the DDoS protection plans in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDdosProtectionPlansOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the DDoS protection plans in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperations.cs index 1f7035ba50fd..7b0e927c687b 100644 --- a/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DefaultSecurityRulesOperations operations. /// - internal partial class DefaultSecurityRulesOperations : IServiceOperations, IDefaultSecurityRulesOperations + internal partial class DefaultSecurityRulesOperations : Microsoft.Rest.IServiceOperations, IDefaultSecurityRulesOperations { /// /// Initializes a new instance of the DefaultSecurityRulesOperations class. @@ -36,13 +24,13 @@ internal partial class DefaultSecurityRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DefaultSecurityRulesOperations(NetworkManagementClient client) + internal DefaultSecurityRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified default network security rule. /// @@ -262,13 +266,13 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (defaultSecurityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "defaultSecurityRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "defaultSecurityRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("defaultSecurityRuleName", defaultSecurityRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{defaultSecurityRuleName}", System.Uri.EscapeDataString(defaultSecurityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all default security rules in a network security group. /// @@ -459,13 +480,13 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperationsExtensions.cs index 5a6ad4c92b61..725b77e7d66f 100644 --- a/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/DefaultSecurityRulesOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DefaultSecurityRulesOperations. + /// Extension methods for DefaultSecurityRulesOperations /// public static partial class DefaultSecurityRulesOperationsExtensions { - /// - /// Gets all default security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - public static IPage List(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) - { - return operations.ListAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all default security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets all default security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static Microsoft.Rest.Azure.IPage List(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) + { + return ((IDefaultSecurityRulesOperations)operations).ListAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Get the specified default network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the default security rule. - /// - public static SecurityRule Get(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName) + /// + /// Gets all default security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the specified default network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the default security rule. + /// + public static SecurityRule Get(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName) + { + return ((IDefaultSecurityRulesOperations)operations).GetAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).GetAwaiter().GetResult(); + } - /// - /// Get the specified default network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the default security rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the specified default network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the default security rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all default security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDefaultSecurityRulesOperations operations, string nextPageLink) + { + return ((IDefaultSecurityRulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all default security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDefaultSecurityRulesOperations operations, string nextPageLink) + /// + /// Gets all default security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDefaultSecurityRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all default security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDefaultSecurityRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperations.cs b/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperations.cs index f6e585ff3a24..f9ea0ea1d4a5 100644 --- a/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DscpConfigurationOperations operations. /// - internal partial class DscpConfigurationOperations : IServiceOperations, IDscpConfigurationOperations + internal partial class DscpConfigurationOperations : Microsoft.Rest.IServiceOperations, IDscpConfigurationOperations { /// /// Initializes a new instance of the DscpConfigurationOperations class. @@ -36,13 +24,13 @@ internal partial class DscpConfigurationOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DscpConfigurationOperations(NetworkManagementClient client) + internal DscpConfigurationOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// Parameters supplied to the create or update dscp configuration operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -85,16 +73,16 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// The name of the resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -112,13 +100,13 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -127,41 +115,52 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (dscpConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dscpConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dscpConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dscpConfigurationName", dscpConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dscpConfigurationName}", System.Uri.EscapeDataString(dscpConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -171,25 +170,24 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -201,55 +199,56 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -259,9 +258,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -272,25 +272,29 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a DSCP Configuration. /// @@ -303,13 +307,13 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -318,35 +322,45 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -356,25 +370,24 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -386,55 +399,56 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -444,9 +458,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -457,25 +472,29 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all dscp configurations in a subscription. /// @@ -485,13 +504,13 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -500,29 +519,38 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -532,25 +560,24 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -562,55 +589,56 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -620,9 +648,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -633,25 +662,29 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a DSCP Configuration. /// @@ -670,13 +703,13 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -685,46 +718,58 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (dscpConfigurationName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dscpConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (dscpConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dscpConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dscpConfigurationName", dscpConfigurationName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dscpConfigurationName}", System.Uri.EscapeDataString(dscpConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -734,25 +779,24 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -764,61 +808,62 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -828,9 +873,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -841,16 +887,16 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -859,25 +905,29 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a DSCP Configuration. /// @@ -893,10 +943,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -905,41 +955,52 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (dscpConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dscpConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dscpConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dscpConfigurationName", dscpConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dscpConfigurationName}", System.Uri.EscapeDataString(dscpConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -949,25 +1010,24 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -979,55 +1039,56 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1037,20 +1098,25 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a DSCP Configuration. /// @@ -1063,13 +1129,13 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1078,51 +1144,54 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1134,55 +1203,56 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1192,9 +1262,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1205,25 +1276,29 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all dscp configurations in a subscription. /// @@ -1236,13 +1311,13 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1251,51 +1326,54 @@ internal DscpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1307,55 +1385,56 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1365,9 +1444,10 @@ internal DscpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1378,24 +1458,28 @@ internal DscpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperationsExtensions.cs index d7ddef3964db..92d0863a961f 100644 --- a/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/DscpConfigurationOperationsExtensions.cs @@ -1,361 +1,331 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DscpConfigurationOperations. + /// Extension methods for DscpConfigurationOperations /// public static partial class DscpConfigurationOperationsExtensions { - /// - /// Creates or updates a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// Parameters supplied to the create or update dscp configuration operation. - /// - public static DscpConfiguration CreateOrUpdate(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// Parameters supplied to the create or update dscp configuration operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - public static void Delete(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName) - { - operations.DeleteAsync(resourceGroupName, dscpConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - public static DscpConfiguration Get(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName) - { - return operations.GetAsync(resourceGroupName, dscpConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Gets a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IDscpConfigurationOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDscpConfigurationOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Creates or updates a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + public static DscpConfiguration CreateOrUpdate(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters) + { + return ((IDscpConfigurationOperations)operations).CreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all dscp configurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IDscpConfigurationOperations operations) + /// + /// Creates or updates a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + public static void Delete(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName) + { + ((IDscpConfigurationOperations)operations).DeleteAsync(resourceGroupName, dscpConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Gets all dscp configurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IDscpConfigurationOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// Parameters supplied to the create or update dscp configuration operation. - /// - public static DscpConfiguration BeginCreateOrUpdate(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + public static DscpConfiguration Get(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName) + { + return ((IDscpConfigurationOperations)operations).GetAsync(resourceGroupName, dscpConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// Parameters supplied to the create or update dscp configuration operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IDscpConfigurationOperations operations, string resourceGroupName) + { + return ((IDscpConfigurationOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - public static void BeginDelete(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName) + /// + /// Gets a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDscpConfigurationOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, dscpConfigurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all dscp configurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IDscpConfigurationOperations operations) + { + return ((IDscpConfigurationOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Deletes a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all dscp configurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IDscpConfigurationOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates or updates a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + public static DscpConfiguration BeginCreateOrUpdate(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters) + { + return ((IDscpConfigurationOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDscpConfigurationOperations operations, string nextPageLink) + /// + /// Creates or updates a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + public static void BeginDelete(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName) + { + ((IDscpConfigurationOperations)operations).BeginDeleteAsync(resourceGroupName, dscpConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Gets a DSCP Configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDscpConfigurationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDscpConfigurationOperations operations, string resourceGroupName, string dscpConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, dscpConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDscpConfigurationOperations operations, string nextPageLink) + { + return ((IDscpConfigurationOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all dscp configurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IDscpConfigurationOperations operations, string nextPageLink) + /// + /// Gets a DSCP Configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDscpConfigurationOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all dscp configurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IDscpConfigurationOperations operations, string nextPageLink) + { + return ((IDscpConfigurationOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all dscp configurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IDscpConfigurationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all dscp configurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IDscpConfigurationOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index 1cbd7a69ca8a..f4f67e761068 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitAuthorizationsOperations operations. /// - internal partial class ExpressRouteCircuitAuthorizationsOperations : IServiceOperations, IExpressRouteCircuitAuthorizationsOperations + internal partial class ExpressRouteCircuitAuthorizationsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitAuthorizationsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitAuthorizationsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteCircuitAuthorizationsOperations : IServiceOpe /// /// Thrown when a required parameter is null /// - internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient client) + internal ExpressRouteCircuitAuthorizationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli public NetworkManagementClient Client { get; private set; } /// - /// Deletes the specified authorization from the specified express route - /// circuit. + /// Deletes the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -64,16 +51,16 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// The name of the authorization. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -94,13 +81,13 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -109,47 +96,59 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -159,25 +158,24 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -189,55 +187,56 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -247,9 +246,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -260,25 +260,29 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an authorization in the specified express route circuit. /// @@ -296,16 +300,16 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// authorization operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -323,13 +327,13 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -338,41 +342,52 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -382,25 +397,24 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -412,55 +426,56 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -470,9 +485,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -483,25 +499,29 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified authorization from the specified express route /// circuit. @@ -521,10 +541,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -533,47 +553,59 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -583,25 +615,24 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -613,55 +644,56 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -671,20 +703,25 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an authorization in the specified express route circuit. /// @@ -707,13 +744,13 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -722,52 +759,65 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (authorizationParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); - } - if (authorizationParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); - tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("authorizationParameters", authorizationParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -777,25 +827,24 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -807,61 +856,62 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(authorizationParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -871,9 +921,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -884,16 +935,16 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -902,25 +953,29 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all authorizations in an express route circuit. /// @@ -933,13 +988,13 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -948,51 +1003,54 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1004,55 +1062,56 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1062,9 +1121,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1075,24 +1135,28 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs index d63929c7e4cd..b8d32fd193d0 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs @@ -1,343 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteCircuitAuthorizationsOperations. + /// Extension methods for ExpressRouteCircuitAuthorizationsOperations /// public static partial class ExpressRouteCircuitAuthorizationsOperationsExtensions { - /// - /// Deletes the specified authorization from the specified express route - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - public static void Delete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) - { - operations.DeleteAsync(resourceGroupName, circuitName, authorizationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified authorization from the specified express route - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified authorization from the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) - { - return operations.GetAsync(resourceGroupName, circuitName, authorizationName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified authorization from the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an authorization in the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// - public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified authorization from the specified express route + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + public static void Delete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + { + ((IExpressRouteCircuitAuthorizationsOperations)operations).DeleteAsync(resourceGroupName, circuitName, authorizationName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an authorization in the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified authorization from the specified express route + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified authorization from the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + { + return ((IExpressRouteCircuitAuthorizationsOperations)operations).GetAsync(resourceGroupName, circuitName, authorizationName).GetAwaiter().GetResult(); + } - /// - /// Gets all authorizations in an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - public static IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) + /// + /// Gets the specified authorization from the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates an authorization in the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + { + return ((IExpressRouteCircuitAuthorizationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all authorizations in an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an authorization in the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all authorizations in an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) + { + return ((IExpressRouteCircuitAuthorizationsOperations)operations).ListAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified authorization from the specified express route - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + /// + /// Gets all authorizations in an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, circuitName, authorizationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified authorization from the specified express route + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + { + ((IExpressRouteCircuitAuthorizationsOperations)operations).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified authorization from the specified express route - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified authorization from the specified express route + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an authorization in the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + { + return ((IExpressRouteCircuitAuthorizationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an authorization in the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// - public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + /// + /// Creates or updates an authorization in the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all authorizations in an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink) + { + return ((IExpressRouteCircuitAuthorizationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an authorization in the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all authorizations in an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all authorizations in an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all authorizations in an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperations.cs index 389b2e7c5f4c..67d667158a06 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitConnectionsOperations operations. /// - internal partial class ExpressRouteCircuitConnectionsOperations : IServiceOperations, IExpressRouteCircuitConnectionsOperations + internal partial class ExpressRouteCircuitConnectionsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitConnectionsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteCircuitConnectionsOperations : IServiceOperat /// /// Thrown when a required parameter is null /// - internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client) + internal ExpressRouteCircuitConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client public NetworkManagementClient Client { get; private set; } /// - /// Deletes the specified Express Route Circuit Connection from the specified - /// express route circuit. + /// Deletes the specified Express Route Circuit Connection from the specified express route circuit. /// /// /// The name of the resource group. @@ -67,16 +54,16 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// The name of the express route circuit connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -101,13 +88,13 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -116,53 +103,66 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -172,25 +172,24 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -202,55 +201,56 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -260,9 +260,10 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -273,28 +274,31 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates or updates a Express Route Circuit Connection in the specified - /// express route circuits. + /// Creates or updates a Express Route Circuit Connection in the specified express route circuits. /// /// /// The name of the resource group. @@ -313,16 +317,16 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// connection operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -344,13 +348,13 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -359,47 +363,59 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -409,25 +425,24 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -439,55 +454,56 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -497,9 +513,10 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -510,25 +527,29 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Express Route Circuit Connection from the specified /// express route circuit. @@ -551,10 +572,10 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -563,53 +584,66 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -619,25 +653,24 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -649,55 +682,56 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -707,20 +741,25 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Express Route Circuit Connection in the specified /// express route circuits. @@ -747,13 +786,13 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -762,58 +801,72 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (expressRouteCircuitConnectionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteCircuitConnectionParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (expressRouteCircuitConnectionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteCircuitConnectionParameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("connectionName", connectionName); - tracingParameters.Add("expressRouteCircuitConnectionParameters", expressRouteCircuitConnectionParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("expressRouteCircuitConnectionParameters", expressRouteCircuitConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -823,25 +876,24 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -853,61 +905,62 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(expressRouteCircuitConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(expressRouteCircuitConnectionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expressRouteCircuitConnectionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -917,9 +970,10 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -930,16 +984,16 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -948,25 +1002,29 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all global reach connections associated with a private peering in an /// express route circuit. @@ -980,13 +1038,13 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -995,51 +1053,54 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1051,55 +1112,56 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1109,9 +1171,10 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1122,24 +1185,28 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs index d801c48a7056..850d91269e06 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs @@ -1,389 +1,357 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteCircuitConnectionsOperations. + /// Extension methods for ExpressRouteCircuitConnectionsOperations /// public static partial class ExpressRouteCircuitConnectionsOperationsExtensions { - /// - /// Deletes the specified Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - public static void Delete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) - { - operations.DeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - public static ExpressRouteCircuitConnection Get(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) - { - return operations.GetAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a Express Route Circuit Connection in the specified - /// express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// connection operation. - /// - public static ExpressRouteCircuitConnection CreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static void Delete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + ((IExpressRouteCircuitConnectionsOperations)operations).DeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Express Route Circuit Connection in the specified - /// express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// connection operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static ExpressRouteCircuitConnection Get(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + return ((IExpressRouteCircuitConnectionsOperations)operations).GetAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Gets all global reach connections associated with a private peering in an - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - public static IPage List(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static ExpressRouteCircuitConnection CreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + { + return ((IExpressRouteCircuitConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all global reach connections associated with a private peering in an - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The name of the peering. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName) + { + return ((IExpressRouteCircuitConnectionsOperations)operations).ListAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - public static void BeginDelete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + /// + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static void BeginDelete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + ((IExpressRouteCircuitConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static ExpressRouteCircuitConnection BeginCreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + { + return ((IExpressRouteCircuitConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Express Route Circuit Connection in the specified - /// express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// connection operation. - /// - public static ExpressRouteCircuitConnection BeginCreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitConnectionsOperations operations, string nextPageLink) + { + return ((IExpressRouteCircuitConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Express Route Circuit Connection in the specified - /// express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the express route circuit connection. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// connection operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteCircuitConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all global reach connections associated with a private peering in an - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteCircuitConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all global reach connections associated with a private peering in an - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteCircuitConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperations.cs index 613484b8e44e..d2be4b236b19 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitPeeringsOperations operations. /// - internal partial class ExpressRouteCircuitPeeringsOperations : IServiceOperations, IExpressRouteCircuitPeeringsOperations + internal partial class ExpressRouteCircuitPeeringsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitPeeringsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitPeeringsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteCircuitPeeringsOperations : IServiceOperation /// /// Thrown when a required parameter is null /// - internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) + internal ExpressRouteCircuitPeeringsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// The name of the peering. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a peering in the specified express route circuits. /// @@ -295,16 +300,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +327,13 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +342,52 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +426,56 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +485,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +499,29 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified peering from the specified express route circuit. /// @@ -519,10 +540,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,47 +552,59 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -581,25 +614,24 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -611,55 +643,56 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,20 +702,25 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a peering in the specified express route circuits. /// @@ -705,13 +743,13 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -720,56 +758,68 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (peeringParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringParameters"); } - if (circuitName == null) + if (peeringParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + peeringParameters.Validate(); } - if (peeringName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (peeringParameters == null) + + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (peeringParameters != null) + + if (peeringName == null) { - peeringParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("peeringParameters", peeringParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -779,25 +829,24 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -809,61 +858,62 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(peeringParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -873,9 +923,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -886,16 +937,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -904,25 +955,29 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all peerings in a specified express route circuit. /// @@ -935,13 +990,13 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -950,51 +1005,54 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1006,55 +1064,56 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1064,9 +1123,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1077,24 +1137,28 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs index a702c506ce75..c8ef087bc920 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteCircuitPeeringsOperations. + /// Extension methods for ExpressRouteCircuitPeeringsOperations /// public static partial class ExpressRouteCircuitPeeringsOperationsExtensions { - /// - /// Deletes the specified peering from the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - public static void Delete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) - { - operations.DeleteAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified peering from the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified peering for the express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) - { - return operations.GetAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified peering for the express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a peering in the specified express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified peering from the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + public static void Delete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + { + ((IExpressRouteCircuitPeeringsOperations)operations).DeleteAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified peering from the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified peering for the express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + { + return ((IExpressRouteCircuitPeeringsOperations)operations).GetAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Gets all peerings in a specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - public static IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) + /// + /// Gets the specified peering for the express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a peering in the specified express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + { + return ((IExpressRouteCircuitPeeringsOperations)operations).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all peerings in a specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a peering in the specified express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all peerings in a specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) + { + return ((IExpressRouteCircuitPeeringsOperations)operations).ListAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified peering from the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// Gets all peerings in a specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified peering from the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + { + ((IExpressRouteCircuitPeeringsOperations)operations).BeginDeleteAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified peering from the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified peering from the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a peering in the specified express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + { + return ((IExpressRouteCircuitPeeringsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + /// + /// Creates or updates a peering in the specified express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all peerings in a specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink) + { + return ((IExpressRouteCircuitPeeringsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified express route circuits. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all peerings in a specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all peerings in a specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all peerings in a specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperations.cs index 84e2e797c594..53b3b4652a09 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitsOperations operations. /// - internal partial class ExpressRouteCircuitsOperations : IServiceOperations, IExpressRouteCircuitsOperations + internal partial class ExpressRouteCircuitsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteCircuitsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ExpressRouteCircuitsOperations(NetworkManagementClient client) + internal ExpressRouteCircuitsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// The name of the express route circuit. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an express route circuit. /// @@ -280,16 +284,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -310,13 +314,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -325,46 +329,57 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (circuitName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -374,25 +389,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -404,61 +418,62 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +483,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,28 +497,31 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express route circuit in a resource group. /// /// /// The name of the resource group. @@ -517,21 +536,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// The path of the device. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. + /// Gets the currently advertised routes table associated with the express route circuit in a resource group. /// /// /// The name of the resource group. @@ -546,21 +564,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// The path of the device. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. + /// Gets the currently advertised routes table summary associated with the express route circuit in a resource group. /// /// /// The name of the resource group. @@ -575,16 +592,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// The path of the device. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -602,13 +619,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -617,41 +634,52 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -661,25 +689,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -691,55 +718,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -749,9 +777,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -762,25 +791,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all stats from an express route circuit in a resource group. /// @@ -799,13 +832,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -814,47 +847,59 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -864,25 +909,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -894,55 +938,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -952,9 +997,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -965,25 +1011,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the express route circuits in a resource group. /// @@ -996,13 +1046,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1011,35 +1061,45 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1049,25 +1109,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1079,55 +1138,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1137,9 +1197,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1150,25 +1211,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the express route circuits in a subscription. /// @@ -1178,13 +1243,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1193,29 +1258,38 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1225,25 +1299,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1255,55 +1328,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1313,9 +1387,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1326,25 +1401,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified express route circuit. /// @@ -1360,10 +1439,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1372,41 +1451,52 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1416,25 +1506,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1446,55 +1535,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1504,20 +1594,25 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an express route circuit. /// @@ -1537,13 +1632,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1552,46 +1647,58 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (circuitName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1601,25 +1708,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1631,61 +1737,62 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1695,9 +1802,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1708,16 +1816,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1726,25 +1834,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the currently advertised ARP table associated with the express route /// circuit in a resource group. @@ -1767,13 +1879,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1782,53 +1894,66 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1838,25 +1963,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1868,55 +1992,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1926,9 +2051,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1939,25 +2065,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the currently advertised routes table associated with the express /// route circuit in a resource group. @@ -1980,13 +2110,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1995,53 +2125,66 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2051,25 +2194,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2081,55 +2223,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2139,9 +2282,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2152,25 +2296,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the currently advertised routes table summary associated with the /// express route circuit in a resource group. @@ -2193,13 +2341,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2208,53 +2356,66 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2264,25 +2425,24 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2294,55 +2454,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2352,9 +2513,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2365,25 +2527,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the express route circuits in a resource group. /// @@ -2396,13 +2562,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2411,51 +2577,54 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2467,55 +2636,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2525,9 +2695,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2538,25 +2709,29 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the express route circuits in a subscription. /// @@ -2569,13 +2744,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2584,51 +2759,54 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2640,55 +2818,56 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2698,9 +2877,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2711,24 +2891,28 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperationsExtensions.cs index 712336d84c10..7aa6d33f8a22 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCircuitsOperationsExtensions.cs @@ -1,821 +1,772 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteCircuitsOperations. + /// Extension methods for ExpressRouteCircuitsOperations /// public static partial class ExpressRouteCircuitsOperationsExtensions { - /// - /// Deletes the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - public static void Delete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) - { - operations.DeleteAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets information about the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of express route circuit. - /// - public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) - { - return operations.GetAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of express route circuit. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. - /// - public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates an express route circuit tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to update express route circuit tags. - /// - public static ExpressRouteCircuit UpdateTags(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates an express route circuit tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to update express route circuit tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) - { - return operations.ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) - { - return operations.ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) - { - return operations.ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the stats from an express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) - { - return operations.GetStatsAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the stats from an express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The cancellation token. - /// - public static async Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all stats from an express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) - { - return operations.GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); - } - - /// - /// Gets all stats from an express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the express route circuits in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the express route circuits in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the express route circuits in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IExpressRouteCircuitsOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all the express route circuits in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) - { - operations.BeginDeleteAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. - /// - public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) - { - return operations.BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) - { - return operations.BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) - { - return operations.BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the express route circuits in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the express route circuits in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the express route circuits in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the express route circuits in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Deletes the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + public static void Delete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) + { + ((IExpressRouteCircuitsOperations)operations).DeleteAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets information about the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of express route circuit. + /// + public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) + { + return ((IExpressRouteCircuitsOperations)operations).GetAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of express route circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) + { + return ((IExpressRouteCircuitsOperations)operations).CreateOrUpdateAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates an express route circuit tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + public static ExpressRouteCircuit UpdateTags(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, TagsObject parameters) + { + return ((IExpressRouteCircuitsOperations)operations).UpdateTagsAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an express route circuit tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + { + return ((IExpressRouteCircuitsOperations)operations).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + { + return ((IExpressRouteCircuitsOperations)operations).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + { + return ((IExpressRouteCircuitsOperations)operations).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the stats from an express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) + { + return ((IExpressRouteCircuitsOperations)operations).GetStatsAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the stats from an express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all stats from an express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) + { + return ((IExpressRouteCircuitsOperations)operations).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Gets all stats from an express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the express route circuits in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) + { + return ((IExpressRouteCircuitsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the express route circuits in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IExpressRouteCircuitsOperations operations) + { + return ((IExpressRouteCircuitsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) + { + ((IExpressRouteCircuitsOperations)operations).BeginDeleteAsync(resourceGroupName, circuitName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) + { + return ((IExpressRouteCircuitsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + { + return ((IExpressRouteCircuitsOperations)operations).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + { + return ((IExpressRouteCircuitsOperations)operations).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + { + return ((IExpressRouteCircuitsOperations)operations).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the express route circuits in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) + { + return ((IExpressRouteCircuitsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the express route circuits in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) + { + return ((IExpressRouteCircuitsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperations.cs index b7cf4ca000a4..138f31b36f9e 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteConnectionsOperations operations. /// - internal partial class ExpressRouteConnectionsOperations : IServiceOperations, IExpressRouteConnectionsOperations + internal partial class ExpressRouteConnectionsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteConnectionsOperations { /// /// Initializes a new instance of the ExpressRouteConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteConnectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ExpressRouteConnectionsOperations(NetworkManagementClient client) + internal ExpressRouteConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates a connection between an ExpressRoute gateway and an ExpressRoute - /// circuit. + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. /// /// /// The name of the resource group. @@ -67,16 +54,16 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// Parameters required in an ExpressRouteConnection PUT operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -97,13 +84,13 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -112,47 +99,59 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -162,25 +161,24 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -192,55 +190,56 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -250,9 +249,10 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -263,25 +263,29 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a connection to a ExpressRoute circuit. /// @@ -295,16 +299,16 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// The name of the connection subresource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +326,13 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +341,52 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +396,24 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +425,56 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +484,10 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +498,29 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates a connection between an ExpressRoute gateway and an ExpressRoute /// circuit. @@ -523,13 +543,13 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,56 +558,68 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (putExpressRouteConnectionParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "putExpressRouteConnectionParameters"); } - if (expressRouteGatewayName == null) + if (putExpressRouteConnectionParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + putExpressRouteConnectionParameters.Validate(); } - if (connectionName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (putExpressRouteConnectionParameters == null) + + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "putExpressRouteConnectionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } - if (putExpressRouteConnectionParameters != null) + + if (connectionName == null) { - putExpressRouteConnectionParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("connectionName", connectionName); - tracingParameters.Add("putExpressRouteConnectionParameters", putExpressRouteConnectionParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("putExpressRouteConnectionParameters", putExpressRouteConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -597,25 +629,24 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -627,61 +658,62 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(putExpressRouteConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(putExpressRouteConnectionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(putExpressRouteConnectionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -691,9 +723,10 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -704,16 +737,16 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -722,25 +755,29 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a connection to a ExpressRoute circuit. /// @@ -759,10 +796,10 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -771,47 +808,59 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -821,25 +870,24 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -851,55 +899,56 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -909,19 +958,24 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperationsExtensions.cs index f0e3d4e67c41..e649262824c7 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteConnectionsOperationsExtensions.cs @@ -1,305 +1,278 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteConnectionsOperations. + /// Extension methods for ExpressRouteConnectionsOperations /// public static partial class ExpressRouteConnectionsOperationsExtensions { - /// - /// Creates a connection between an ExpressRoute gateway and an ExpressRoute - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - /// - /// Parameters required in an ExpressRouteConnection PUT operation. - /// - public static ExpressRouteConnection CreateOrUpdate(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a connection between an ExpressRoute gateway and an ExpressRoute - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - /// - /// Parameters required in an ExpressRouteConnection PUT operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified ExpressRouteConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the ExpressRoute connection. - /// - public static ExpressRouteConnection Get(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName) - { - return operations.GetAsync(resourceGroupName, expressRouteGatewayName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified ExpressRouteConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the ExpressRoute connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + public static ExpressRouteConnection CreateOrUpdate(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters) + { + return ((IExpressRouteConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a connection to a ExpressRoute circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - public static void Delete(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName) + /// + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the specified ExpressRouteConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the ExpressRoute connection. + /// + public static ExpressRouteConnection Get(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName) + { + return ((IExpressRouteConnectionsOperations)operations).GetAsync(resourceGroupName, expressRouteGatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes a connection to a ExpressRoute circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified ExpressRouteConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the ExpressRoute connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a connection to a ExpressRoute circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + public static void Delete(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName) + { + ((IExpressRouteConnectionsOperations)operations).DeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Lists ExpressRouteConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - public static ExpressRouteConnectionList List(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName) - { - return operations.ListAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Lists ExpressRouteConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a connection between an ExpressRoute gateway and an ExpressRoute - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - /// - /// Parameters required in an ExpressRouteConnection PUT operation. - /// - public static ExpressRouteConnection BeginCreateOrUpdate(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a connection between an ExpressRoute gateway and an ExpressRoute - /// circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - /// - /// Parameters required in an ExpressRouteConnection PUT operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a connection to a ExpressRoute circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists ExpressRouteConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + public static ExpressRouteConnectionList List(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName) + { + return ((IExpressRouteConnectionsOperations)operations).ListAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + } - /// - /// Deletes a connection to a ExpressRoute circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - public static void BeginDelete(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName) + /// + /// Lists ExpressRouteConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + public static ExpressRouteConnection BeginCreateOrUpdate(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters) + { + return ((IExpressRouteConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a connection to a ExpressRoute circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The name of the connection subresource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a connection to a ExpressRoute circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + public static void BeginDelete(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName) + { + ((IExpressRouteConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).GetAwaiter().GetResult(); + } + /// + /// Deletes a connection to a ExpressRoute circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The name of the connection subresource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteConnectionsOperations operations, string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs index 6bcfe6faa4d4..b8767622dd78 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCrossConnectionPeeringsOperations operations. /// - internal partial class ExpressRouteCrossConnectionPeeringsOperations : IServiceOperations, IExpressRouteCrossConnectionPeeringsOperations + internal partial class ExpressRouteCrossConnectionPeeringsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCrossConnectionPeeringsOperations { /// /// Initializes a new instance of the ExpressRouteCrossConnectionPeeringsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteCrossConnectionPeeringsOperations : IServiceO /// /// Thrown when a required parameter is null /// - internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient client) + internal ExpressRouteCrossConnectionPeeringsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified peering from the ExpressRouteCrossConnection. /// @@ -257,16 +261,16 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// The name of the peering. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -287,13 +291,13 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -302,47 +306,59 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -352,25 +368,24 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -382,55 +397,56 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -440,9 +456,10 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -453,25 +470,29 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a peering in the specified ExpressRouteCrossConnection. /// @@ -489,16 +510,16 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// peering operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -519,10 +540,10 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,47 +552,59 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -581,25 +614,24 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -611,55 +643,56 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,20 +702,25 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a peering in the specified ExpressRouteCrossConnection. /// @@ -705,13 +743,13 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -720,56 +758,68 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (peeringParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringParameters"); } - if (crossConnectionName == null) + if (peeringParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + peeringParameters.Validate(); } - if (peeringName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (peeringParameters == null) + + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } - if (peeringParameters != null) + + if (peeringName == null) { - peeringParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("peeringParameters", peeringParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -779,25 +829,24 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -809,61 +858,62 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(peeringParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -873,9 +923,10 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -886,16 +937,16 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -904,25 +955,29 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all peerings in a specified ExpressRouteCrossConnection. /// @@ -935,13 +990,13 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -950,51 +1005,54 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1006,55 +1064,56 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1064,9 +1123,10 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1077,24 +1137,28 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs index 3e315c1d307a..edd9078a0a90 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteCrossConnectionPeeringsOperations. + /// Extension methods for ExpressRouteCrossConnectionPeeringsOperations /// public static partial class ExpressRouteCrossConnectionPeeringsOperationsExtensions { - /// - /// Gets all peerings in a specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - public static IPage List(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName) - { - return operations.ListAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets all peerings in a specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified peering from the ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - public static void Delete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) - { - operations.DeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified peering from the ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified peering for the ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - public static ExpressRouteCrossConnectionPeering Get(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) - { - return operations.GetAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); - } + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName) + { + return ((IExpressRouteCrossConnectionPeeringsOperations)operations).ListAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified peering for the ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static void Delete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + ((IExpressRouteCrossConnectionPeeringsOperations)operations).DeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update ExpressRouteCrossConnection - /// peering operation. - /// - public static ExpressRouteCrossConnectionPeering CreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCrossConnectionPeering Get(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + return ((IExpressRouteCrossConnectionPeeringsOperations)operations).GetAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update ExpressRouteCrossConnection - /// peering operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCrossConnectionPeering CreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + { + return ((IExpressRouteCrossConnectionPeeringsOperations)operations).CreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified peering from the ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - public static void BeginDelete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static void BeginDelete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + ((IExpressRouteCrossConnectionPeeringsOperations)operations).BeginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified peering from the ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCrossConnectionPeering BeginCreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + { + return ((IExpressRouteCrossConnectionPeeringsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update ExpressRouteCrossConnection - /// peering operation. - /// - public static ExpressRouteCrossConnectionPeering BeginCreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink) + { + return ((IExpressRouteCrossConnectionPeeringsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update ExpressRouteCrossConnection - /// peering operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all peerings in a specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all peerings in a specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperations.cs index def4fc0348fe..45c59a00b1d1 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCrossConnectionsOperations operations. /// - internal partial class ExpressRouteCrossConnectionsOperations : IServiceOperations, IExpressRouteCrossConnectionsOperations + internal partial class ExpressRouteCrossConnectionsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCrossConnectionsOperations { /// /// Initializes a new instance of the ExpressRouteCrossConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteCrossConnectionsOperations : IServiceOperatio /// /// Thrown when a required parameter is null /// - internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) + internal ExpressRouteCrossConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all the ExpressRouteCrossConnections in a resource group. /// @@ -238,13 +240,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,35 +255,45 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -291,25 +303,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -321,55 +332,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -379,9 +391,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -392,25 +405,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets details about the specified ExpressRouteCrossConnection. /// @@ -426,13 +443,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -441,41 +458,52 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -485,25 +513,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -515,55 +542,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -573,9 +601,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -586,25 +615,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update the specified ExpressRouteCrossConnection. /// @@ -618,16 +651,16 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// Parameters supplied to the update express route crossConnection operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -648,13 +681,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -663,46 +696,57 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (crossConnectionParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionParameters"); } - if (crossConnectionName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (crossConnectionParameters == null) + + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); - tracingParameters.Add("crossConnectionParameters", crossConnectionParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("crossConnectionParameters", crossConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -712,25 +756,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -742,61 +785,62 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(crossConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(crossConnectionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(crossConnectionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -806,9 +850,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -819,28 +864,31 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets the currently advertised ARP table associated with the express route - /// cross connection in a resource group. + /// Gets the currently advertised ARP table associated with the express route cross connection in a resource group. /// /// /// The name of the resource group. @@ -855,21 +903,20 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// The path of the device. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the route table summary associated with the express route cross - /// connection in a resource group. + /// Gets the route table summary associated with the express route cross connection in a resource group. /// /// /// The name of the resource group. @@ -884,21 +931,20 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// The path of the device. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the currently advertised routes table associated with the express - /// route cross connection in a resource group. + /// Gets the currently advertised routes table associated with the express route cross connection in a resource group. /// /// /// The name of the resource group. @@ -913,16 +959,16 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// The path of the device. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -943,13 +989,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -958,46 +1004,58 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (crossConnectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1007,25 +1065,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1037,61 +1094,62 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1101,9 +1159,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1114,25 +1173,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the currently advertised ARP table associated with the express route /// cross connection in a resource group. @@ -1155,13 +1218,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1170,53 +1233,66 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1226,25 +1302,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1256,55 +1331,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1314,9 +1390,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1327,25 +1404,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the route table summary associated with the express route cross /// connection in a resource group. @@ -1368,13 +1449,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1383,53 +1464,66 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1439,25 +1533,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1469,55 +1562,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1527,9 +1621,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1540,25 +1635,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the currently advertised routes table associated with the express /// route cross connection in a resource group. @@ -1581,13 +1680,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1596,53 +1695,66 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (crossConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "crossConnectionName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1652,25 +1764,24 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1682,55 +1793,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1740,9 +1852,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1753,25 +1866,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all the ExpressRouteCrossConnections in a subscription. /// @@ -1784,13 +1901,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1799,51 +1916,54 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1855,55 +1975,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1913,9 +2034,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1926,25 +2048,29 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all the ExpressRouteCrossConnections in a resource group. /// @@ -1957,13 +2083,13 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1972,51 +2098,54 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2028,55 +2157,56 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2086,9 +2216,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2099,24 +2230,28 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs index d977722d61c4..e77e86562fc8 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs @@ -1,657 +1,616 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteCrossConnectionsOperations. + /// Extension methods for ExpressRouteCrossConnectionsOperations /// public static partial class ExpressRouteCrossConnectionsOperationsExtensions { - /// - /// Retrieves all the ExpressRouteCrossConnections in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IExpressRouteCrossConnectionsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteCrossConnectionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets details about the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group (peering location of the circuit). - /// - /// - /// The name of the ExpressRouteCrossConnection (service key of the circuit). - /// - public static ExpressRouteCrossConnection Get(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName) - { - return operations.GetAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); - } + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCrossConnectionsOperations operations) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets details about the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group (peering location of the circuit). - /// - /// - /// The name of the ExpressRouteCrossConnection (service key of the circuit). - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteCrossConnectionsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Update the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// Parameters supplied to the update express route crossConnection operation. - /// - public static ExpressRouteCrossConnection CreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + public static ExpressRouteCrossConnection Get(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName) + { + return ((IExpressRouteCrossConnectionsOperations)operations).GetAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); + } - /// - /// Update the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// Parameters supplied to the update express route crossConnection operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + public static ExpressRouteCrossConnection CreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + { + return ((IExpressRouteCrossConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates an express route cross connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cross connection. - /// - /// - /// Parameters supplied to update express route cross connection tags. - /// - public static ExpressRouteCrossConnection UpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + public static ExpressRouteCrossConnection UpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) + { + return ((IExpressRouteCrossConnectionsOperations)operations).UpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Updates an express route cross connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cross connection. - /// - /// - /// Parameters supplied to update express route cross connection tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } - /// - /// Gets the currently advertised ARP table associated with the express route - /// cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } - /// - /// Gets the currently advertised ARP table associated with the express route - /// cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task ListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } - /// - /// Gets the route table summary associated with the express route cross - /// connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + public static ExpressRouteCrossConnection BeginCreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + { + return ((IExpressRouteCrossConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the route table summary associated with the express route cross - /// connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return ((IExpressRouteCrossConnectionsOperations)operations).BeginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } - /// - /// Gets the currently advertised routes table associated with the express - /// route cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return ((IExpressRouteCrossConnectionsOperations)operations).BeginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } - /// - /// Gets the currently advertised routes table associated with the express - /// route cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task ListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return ((IExpressRouteCrossConnectionsOperations)operations).BeginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } - /// - /// Update the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// Parameters supplied to the update express route crossConnection operation. - /// - public static ExpressRouteCrossConnection BeginCreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Update the specified ExpressRouteCrossConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// Parameters supplied to the update express route crossConnection operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) + { + return ((IExpressRouteCrossConnectionsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the currently advertised ARP table associated with the express route - /// cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the route table summary associated with the express route cross - /// connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) - { - return operations.BeginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the route table summary associated with the express route cross - /// connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) - { - return operations.BeginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route cross connection in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all the ExpressRouteCrossConnections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperations.cs index b898ea0636f9..9fd9a41252c0 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteGatewaysOperations operations. /// - internal partial class ExpressRouteGatewaysOperations : IServiceOperations, IExpressRouteGatewaysOperations + internal partial class ExpressRouteGatewaysOperations : Microsoft.Rest.IServiceOperations, IExpressRouteGatewaysOperations { /// /// Initializes a new instance of the ExpressRouteGatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ExpressRouteGatewaysOperations(NetworkManagementClient client) + internal ExpressRouteGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists ExpressRoute gateways in a given resource group. /// @@ -238,13 +240,13 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,35 +255,45 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -291,25 +303,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -321,55 +332,56 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -379,9 +391,10 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -392,25 +405,29 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a ExpressRoute gateway in a specified resource group. /// @@ -424,16 +441,16 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// Parameters required in an ExpressRoute gateway PUT operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -449,16 +466,16 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update a virtual wan express route gateway tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -476,13 +493,13 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -491,41 +508,52 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -535,25 +563,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -565,55 +592,56 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -623,9 +651,10 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -636,29 +665,31 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Deletes the specified ExpressRoute gateway in a resource group. An - /// ExpressRoute gateway resource can only be deleted when there are no - /// connection subresources. + /// Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources. /// /// /// The name of the resource group. @@ -667,16 +698,16 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// The name of the ExpressRoute gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -697,13 +728,13 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -712,50 +743,58 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (expressRouteGatewayName == null) + + + + + if (putExpressRouteGatewayParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "putExpressRouteGatewayParameters"); } - if (putExpressRouteGatewayParameters == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "putExpressRouteGatewayParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (putExpressRouteGatewayParameters != null) + + if (expressRouteGatewayName == null) { - putExpressRouteGatewayParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); - tracingParameters.Add("putExpressRouteGatewayParameters", putExpressRouteGatewayParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("putExpressRouteGatewayParameters", putExpressRouteGatewayParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -765,25 +804,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -795,61 +833,62 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(putExpressRouteGatewayParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(putExpressRouteGatewayParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(putExpressRouteGatewayParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -859,9 +898,10 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -872,16 +912,16 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -890,25 +930,29 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates express route gateway tags. /// @@ -927,13 +971,13 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -942,46 +986,57 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (expressRouteGatewayParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (expressRouteGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (expressRouteGatewayParameters == null) + + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expressRouteGatewayParameters", expressRouteGatewayParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -991,25 +1046,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1021,61 +1075,62 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(expressRouteGatewayParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(expressRouteGatewayParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expressRouteGatewayParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1085,9 +1140,10 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1098,25 +1154,29 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified ExpressRoute gateway in a resource group. An /// ExpressRoute gateway resource can only be deleted when there are no @@ -1134,10 +1194,10 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1146,41 +1206,52 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRouteGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRouteGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRouteGatewayName", expressRouteGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRouteGatewayName}", System.Uri.EscapeDataString(expressRouteGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1190,25 +1261,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1220,55 +1290,56 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1278,19 +1349,24 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperationsExtensions.cs index 03da17428d68..e0c34fb75f55 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteGatewaysOperationsExtensions.cs @@ -1,393 +1,351 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteGatewaysOperations. + /// Extension methods for ExpressRouteGatewaysOperations /// public static partial class ExpressRouteGatewaysOperationsExtensions { - /// - /// Lists ExpressRoute gateways under a given subscription. - /// - /// - /// The operations group for this extension method. - /// - public static ExpressRouteGatewayList ListBySubscription(this IExpressRouteGatewaysOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists ExpressRoute gateways under a given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListBySubscriptionAsync(this IExpressRouteGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists ExpressRoute gateways in a given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static ExpressRouteGatewayList ListByResourceGroup(this IExpressRouteGatewaysOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists ExpressRoute gateways in a given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task ListByResourceGroupAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a ExpressRoute gateway in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// Parameters required in an ExpressRoute gateway PUT operation. - /// - public static ExpressRouteGateway CreateOrUpdate(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a ExpressRoute gateway in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// Parameters required in an ExpressRoute gateway PUT operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates express route gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ExpressRouteGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan express route gateway tags. - /// - public static ExpressRouteGateway UpdateTags(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters) - { - return operations.UpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates express route gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ExpressRouteGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan express route gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Lists ExpressRoute gateways under a given subscription. + /// + /// + /// The operations group for this extension method. + /// + public static ExpressRouteGatewayList ListBySubscription(this IExpressRouteGatewaysOperations operations) + { + return ((IExpressRouteGatewaysOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Fetches the details of a ExpressRoute gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - public static ExpressRouteGateway Get(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName) + /// + /// Lists ExpressRoute gateways under a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListBySubscriptionAsync(this IExpressRouteGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists ExpressRoute gateways in a given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static ExpressRouteGatewayList ListByResourceGroup(this IExpressRouteGatewaysOperations operations, string resourceGroupName) + { + return ((IExpressRouteGatewaysOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Fetches the details of a ExpressRoute gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists ExpressRoute gateways in a given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListByResourceGroupAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a ExpressRoute gateway in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + public static ExpressRouteGateway CreateOrUpdate(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters) + { + return ((IExpressRouteGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ExpressRoute gateway in a resource group. An - /// ExpressRoute gateway resource can only be deleted when there are no - /// connection subresources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - public static void Delete(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName) + /// + /// Creates or updates a ExpressRoute gateway in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates express route gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ExpressRouteGateway. + /// + /// + /// The name of the gateway. + /// + public static ExpressRouteGateway UpdateTags(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters) + { + return ((IExpressRouteGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ExpressRoute gateway in a resource group. An - /// ExpressRoute gateway resource can only be deleted when there are no - /// connection subresources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates express route gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ExpressRouteGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Fetches the details of a ExpressRoute gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + public static ExpressRouteGateway Get(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName) + { + return ((IExpressRouteGatewaysOperations)operations).GetAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a ExpressRoute gateway in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// Parameters required in an ExpressRoute gateway PUT operation. - /// - public static ExpressRouteGateway BeginCreateOrUpdate(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters) + /// + /// Fetches the details of a ExpressRoute gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified ExpressRoute gateway in a resource group. An + /// ExpressRoute gateway resource can only be deleted when there are no + /// connection subresources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + public static void Delete(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName) + { + ((IExpressRouteGatewaysOperations)operations).DeleteAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a ExpressRoute gateway in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// Parameters required in an ExpressRoute gateway PUT operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates express route gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ExpressRouteGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan express route gateway tags. - /// - public static ExpressRouteGateway BeginUpdateTags(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates express route gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the ExpressRouteGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan express route gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified ExpressRoute gateway in a resource group. An + /// ExpressRoute gateway resource can only be deleted when there are no + /// connection subresources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a ExpressRoute gateway in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + public static ExpressRouteGateway BeginCreateOrUpdate(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters) + { + return ((IExpressRouteGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ExpressRoute gateway in a resource group. An - /// ExpressRoute gateway resource can only be deleted when there are no - /// connection subresources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - public static void BeginDelete(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName) + /// + /// Creates or updates a ExpressRoute gateway in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates express route gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ExpressRouteGateway. + /// + /// + /// The name of the gateway. + /// + public static ExpressRouteGateway BeginUpdateTags(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters) + { + return ((IExpressRouteGatewaysOperations)operations).BeginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ExpressRoute gateway in a resource group. An - /// ExpressRoute gateway resource can only be deleted when there are no - /// connection subresources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoute gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates express route gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the ExpressRouteGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified ExpressRoute gateway in a resource group. An + /// ExpressRoute gateway resource can only be deleted when there are no + /// connection subresources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + public static void BeginDelete(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName) + { + ((IExpressRouteGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, expressRouteGatewayName).GetAwaiter().GetResult(); + } + /// + /// Deletes the specified ExpressRoute gateway in a resource group. An + /// ExpressRoute gateway resource can only be deleted when there are no + /// connection subresources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoute gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteGatewaysOperations operations, string resourceGroupName, string expressRouteGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRouteGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperations.cs index 27505069e671..389905a30214 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteLinksOperations operations. /// - internal partial class ExpressRouteLinksOperations : IServiceOperations, IExpressRouteLinksOperations + internal partial class ExpressRouteLinksOperations : Microsoft.Rest.IServiceOperations, IExpressRouteLinksOperations { /// /// Initializes a new instance of the ExpressRouteLinksOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteLinksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ExpressRouteLinksOperations(NetworkManagementClient client) + internal ExpressRouteLinksOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string linkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string linkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + if (linkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("linkName", linkName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); _url = _url.Replace("{linkName}", System.Uri.EscapeDataString(linkName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,25 +235,29 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieve the ExpressRouteLink sub-resources of the specified /// ExpressRoutePort resource. @@ -269,13 +274,13 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -284,41 +289,52 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -328,25 +344,24 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -358,55 +373,56 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -416,9 +432,10 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -429,25 +446,29 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieve the ExpressRouteLink sub-resources of the specified /// ExpressRoutePort resource. @@ -461,13 +482,13 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -476,51 +497,54 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -532,55 +556,56 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -590,9 +615,10 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -603,24 +629,28 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperationsExtensions.cs index 74b1d0f03c20..65c6df3b6356 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteLinksOperationsExtensions.cs @@ -1,149 +1,137 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteLinksOperations. + /// Extension methods for ExpressRouteLinksOperations /// public static partial class ExpressRouteLinksOperationsExtensions { - /// - /// Retrieves the specified ExpressRouteLink resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// The name of the ExpressRouteLink resource. - /// - public static ExpressRouteLink Get(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName, string linkName) - { - return operations.GetAsync(resourceGroupName, expressRoutePortName, linkName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified ExpressRouteLink resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// The name of the ExpressRouteLink resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName, string linkName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, linkName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Retrieves the specified ExpressRouteLink resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The name of the ExpressRouteLink resource. + /// + public static ExpressRouteLink Get(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName, string linkName) + { + return ((IExpressRouteLinksOperations)operations).GetAsync(resourceGroupName, expressRoutePortName, linkName).GetAwaiter().GetResult(); + } - /// - /// Retrieve the ExpressRouteLink sub-resources of the specified - /// ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - public static IPage List(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName) + /// + /// Retrieves the specified ExpressRouteLink resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The name of the ExpressRouteLink resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName, string linkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, linkName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieve the ExpressRouteLink sub-resources of the specified + /// ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName) + { + return ((IExpressRouteLinksOperations)operations).ListAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + } - /// - /// Retrieve the ExpressRouteLink sub-resources of the specified - /// ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieve the ExpressRouteLink sub-resources of the specified + /// ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteLinksOperations operations, string resourceGroupName, string expressRoutePortName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieve the ExpressRouteLink sub-resources of the specified + /// ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteLinksOperations operations, string nextPageLink) + { + return ((IExpressRouteLinksOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Retrieve the ExpressRouteLink sub-resources of the specified - /// ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteLinksOperations operations, string nextPageLink) + /// + /// Retrieve the ExpressRouteLink sub-resources of the specified + /// ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteLinksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Retrieve the ExpressRouteLink sub-resources of the specified - /// ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteLinksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperations.cs index 79fd4ab61596..36578bb9cfe6 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRoutePortAuthorizationsOperations operations. /// - internal partial class ExpressRoutePortAuthorizationsOperations : IServiceOperations, IExpressRoutePortAuthorizationsOperations + internal partial class ExpressRoutePortAuthorizationsOperations : Microsoft.Rest.IServiceOperations, IExpressRoutePortAuthorizationsOperations { /// /// Initializes a new instance of the ExpressRoutePortAuthorizationsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRoutePortAuthorizationsOperations : IServiceOperat /// /// Thrown when a required parameter is null /// - internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client) + internal ExpressRoutePortAuthorizationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// The name of the authorization. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an authorization in the specified express route port. /// @@ -295,16 +300,16 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// authorization operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +327,13 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +342,52 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +426,56 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +485,10 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +499,29 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified authorization from the specified express route port. /// @@ -519,10 +540,10 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,47 +552,59 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -581,25 +614,24 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -611,55 +643,56 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,20 +702,25 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an authorization in the specified express route port. /// @@ -705,13 +743,13 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -720,52 +758,65 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (authorizationParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } - if (authorizationParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("authorizationName", authorizationName); - tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("authorizationParameters", authorizationParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -775,25 +826,24 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -805,61 +855,62 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(authorizationParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -869,9 +920,10 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -882,16 +934,16 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -900,25 +952,29 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all authorizations in an express route port. /// @@ -931,13 +987,13 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1002,54 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1061,56 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1120,10 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1134,28 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperationsExtensions.cs index febd3e65d853..25e420fa35c4 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortAuthorizationsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRoutePortAuthorizationsOperations. + /// Extension methods for ExpressRoutePortAuthorizationsOperations /// public static partial class ExpressRoutePortAuthorizationsOperationsExtensions { - /// - /// Deletes the specified authorization from the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - public static void Delete(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName) - { - operations.DeleteAsync(resourceGroupName, expressRoutePortName, authorizationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified authorization from the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified authorization from the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - public static ExpressRoutePortAuthorization Get(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName) - { - return operations.GetAsync(resourceGroupName, expressRoutePortName, authorizationName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified authorization from the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an authorization in the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route port - /// authorization operation. - /// - public static ExpressRoutePortAuthorization CreateOrUpdate(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified authorization from the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + public static void Delete(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName) + { + ((IExpressRoutePortAuthorizationsOperations)operations).DeleteAsync(resourceGroupName, expressRoutePortName, authorizationName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an authorization in the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route port - /// authorization operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified authorization from the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified authorization from the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + public static ExpressRoutePortAuthorization Get(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName) + { + return ((IExpressRoutePortAuthorizationsOperations)operations).GetAsync(resourceGroupName, expressRoutePortName, authorizationName).GetAwaiter().GetResult(); + } - /// - /// Gets all authorizations in an express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - public static IPage List(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName) + /// + /// Gets the specified authorization from the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates an authorization in the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + public static ExpressRoutePortAuthorization CreateOrUpdate(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters) + { + return ((IExpressRoutePortAuthorizationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all authorizations in an express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an authorization in the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all authorizations in an express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName) + { + return ((IExpressRoutePortAuthorizationsOperations)operations).ListAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified authorization from the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - public static void BeginDelete(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName) + /// + /// Gets all authorizations in an express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, expressRoutePortName, authorizationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified authorization from the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + public static void BeginDelete(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName) + { + ((IExpressRoutePortAuthorizationsOperations)operations).BeginDeleteAsync(resourceGroupName, expressRoutePortName, authorizationName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified authorization from the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified authorization from the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an authorization in the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + public static ExpressRoutePortAuthorization BeginCreateOrUpdate(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters) + { + return ((IExpressRoutePortAuthorizationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an authorization in the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route port - /// authorization operation. - /// - public static ExpressRoutePortAuthorization BeginCreateOrUpdate(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters) + /// + /// Creates or updates an authorization in the specified express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route port. + /// + /// + /// The name of the authorization. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all authorizations in an express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRoutePortAuthorizationsOperations operations, string nextPageLink) + { + return ((IExpressRoutePortAuthorizationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an authorization in the specified express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route port. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route port - /// authorization operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRoutePortAuthorizationsOperations operations, string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all authorizations in an express route port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRoutePortAuthorizationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all authorizations in an express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRoutePortAuthorizationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all authorizations in an express route port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRoutePortAuthorizationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperations.cs index 0b5801541ad7..40fdf46f9d09 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRoutePortsLocationsOperations operations. /// - internal partial class ExpressRoutePortsLocationsOperations : IServiceOperations, IExpressRoutePortsLocationsOperations + internal partial class ExpressRoutePortsLocationsOperations : Microsoft.Rest.IServiceOperations, IExpressRoutePortsLocationsOperations { /// /// Initializes a new instance of the ExpressRoutePortsLocationsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRoutePortsLocationsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) + internal ExpressRoutePortsLocationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,13 +49,13 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -76,29 +64,38 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -108,25 +105,24 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -138,55 +134,56 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -196,9 +193,10 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -209,25 +207,29 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves a single ExpressRoutePort peering location, including the list of /// available bandwidths available at said peering location. @@ -241,13 +243,13 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -256,35 +258,45 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string locationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (locationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "locationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("locationName", locationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -294,25 +306,24 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -324,55 +335,56 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -382,9 +394,10 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -395,25 +408,29 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all ExpressRoutePort peering locations. Does not return available /// bandwidths for each location. Available bandwidths can only be obtained @@ -428,13 +445,13 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -443,51 +460,54 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -499,55 +519,56 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -557,9 +578,10 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -570,24 +592,28 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperationsExtensions.cs index 7ee35e54a425..bb10bf08c936 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsLocationsOperationsExtensions.cs @@ -1,131 +1,119 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRoutePortsLocationsOperations. + /// Extension methods for ExpressRoutePortsLocationsOperations /// public static partial class ExpressRoutePortsLocationsOperationsExtensions { - /// - /// Retrieves all ExpressRoutePort peering locations. Does not return available - /// bandwidths for each location. Available bandwidths can only be obtained - /// when retrieving a specific peering location. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IExpressRoutePortsLocationsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Retrieves all ExpressRoutePort peering locations. Does not return available - /// bandwidths for each location. Available bandwidths can only be obtained - /// when retrieving a specific peering location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRoutePortsLocationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRoutePortsLocationsOperations operations) + { + return ((IExpressRoutePortsLocationsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Retrieves a single ExpressRoutePort peering location, including the list of - /// available bandwidths available at said peering location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the requested ExpressRoutePort peering location. - /// - public static ExpressRoutePortsLocation Get(this IExpressRoutePortsLocationsOperations operations, string locationName) + /// + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRoutePortsLocationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(locationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves a single ExpressRoutePort peering location, including the list of + /// available bandwidths available at said peering location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the requested ExpressRoutePort peering location. + /// + public static ExpressRoutePortsLocation Get(this IExpressRoutePortsLocationsOperations operations, string locationName) + { + return ((IExpressRoutePortsLocationsOperations)operations).GetAsync(locationName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a single ExpressRoutePort peering location, including the list of - /// available bandwidths available at said peering location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the requested ExpressRoutePort peering location. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRoutePortsLocationsOperations operations, string locationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves a single ExpressRoutePort peering location, including the list of + /// available bandwidths available at said peering location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the requested ExpressRoutePort peering location. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRoutePortsLocationsOperations operations, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(locationName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(locationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRoutePortsLocationsOperations operations, string nextPageLink) + { + return ((IExpressRoutePortsLocationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Retrieves all ExpressRoutePort peering locations. Does not return available - /// bandwidths for each location. Available bandwidths can only be obtained - /// when retrieving a specific peering location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRoutePortsLocationsOperations operations, string nextPageLink) + /// + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRoutePortsLocationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Retrieves all ExpressRoutePort peering locations. Does not return available - /// bandwidths for each location. Available bandwidths can only be obtained - /// when retrieving a specific peering location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRoutePortsLocationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperations.cs index 4d576087b74d..c27e31689a5b 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRoutePortsOperations operations. /// - internal partial class ExpressRoutePortsOperations : IServiceOperations, IExpressRoutePortsOperations + internal partial class ExpressRoutePortsOperations : Microsoft.Rest.IServiceOperations, IExpressRoutePortsOperations { /// /// Initializes a new instance of the ExpressRoutePortsOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRoutePortsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ExpressRoutePortsOperations(NetworkManagementClient client) + internal ExpressRoutePortsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// The name of the ExpressRoutePort resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified ExpressRoutePort resource. /// @@ -279,16 +283,16 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// Parameters supplied to the create ExpressRoutePort operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -309,13 +313,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -324,46 +328,57 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (expressRoutePortName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +388,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,61 +417,62 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -467,9 +482,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -480,25 +496,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all the ExpressRoutePort resources in the specified resource group. /// @@ -511,13 +531,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -526,35 +546,45 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -564,25 +594,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -594,55 +623,56 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -652,9 +682,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -665,25 +696,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all the ExpressRoutePort resources in the specified subscription. /// @@ -693,13 +728,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -708,29 +743,38 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -740,25 +784,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -770,55 +813,56 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -828,9 +872,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -841,25 +886,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Generate a letter of authorization for the requested ExpressRoutePort /// resource. @@ -879,13 +928,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -894,50 +943,61 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GenerateLOAWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GenerateLOAWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request"); } - if (resourceGroupName == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + request.Validate(); } - if (expressRoutePortName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (request == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (request != null) + + if (expressRoutePortName == null) { - request.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateLOA", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GenerateLOA", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -947,25 +1007,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -977,61 +1036,62 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1041,9 +1101,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1054,25 +1115,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified ExpressRoutePort resource. /// @@ -1088,10 +1153,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1100,41 +1165,52 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1144,25 +1220,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1174,55 +1249,56 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1232,20 +1308,25 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified ExpressRoutePort resource. /// @@ -1264,13 +1345,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1279,46 +1360,58 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (expressRoutePortName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (expressRoutePortName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expressRoutePortName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1328,25 +1421,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1358,61 +1450,62 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1422,9 +1515,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1435,16 +1529,16 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1453,25 +1547,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all the ExpressRoutePort resources in the specified resource group. /// @@ -1484,13 +1582,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1499,51 +1597,54 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1555,55 +1656,56 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1613,9 +1715,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1626,25 +1729,29 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all the ExpressRoutePort resources in the specified subscription. /// @@ -1657,13 +1764,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1672,51 +1779,54 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1728,55 +1838,56 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1786,9 +1897,10 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1799,24 +1911,28 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperationsExtensions.cs index ef2f3e4d6a24..7ac4f7614843 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRoutePortsOperationsExtensions.cs @@ -1,455 +1,411 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRoutePortsOperations. + /// Extension methods for ExpressRoutePortsOperations /// public static partial class ExpressRoutePortsOperationsExtensions { - /// - /// Deletes the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - public static void Delete(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName) - { - operations.DeleteAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves the requested ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of ExpressRoutePort. - /// - public static ExpressRoutePort Get(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName) - { - return operations.GetAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the requested ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of ExpressRoutePort. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to the create ExpressRoutePort operation. - /// - public static ExpressRoutePort CreateOrUpdate(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to the create ExpressRoutePort operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update ExpressRoutePort tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to update ExpressRoutePort resource tags. - /// - public static ExpressRoutePort UpdateTags(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update ExpressRoutePort tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to update ExpressRoutePort resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + public static void Delete(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName) + { + ((IExpressRoutePortsOperations)operations).DeleteAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + } - /// - /// List all the ExpressRoutePort resources in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IExpressRoutePortsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the requested ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of ExpressRoutePort. + /// + public static ExpressRoutePort Get(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName) + { + return ((IExpressRoutePortsOperations)operations).GetAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + } - /// - /// List all the ExpressRoutePort resources in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the requested ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of ExpressRoutePort. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + public static ExpressRoutePort CreateOrUpdate(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters) + { + return ((IExpressRoutePortsOperations)operations).CreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); + } - /// - /// List all the ExpressRoutePort resources in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IExpressRoutePortsOperations operations) + /// + /// Creates or updates the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update ExpressRoutePort tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + public static ExpressRoutePort UpdateTags(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, TagsObject parameters) + { + return ((IExpressRoutePortsOperations)operations).UpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); + } - /// - /// List all the ExpressRoutePort resources in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRoutePortsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update ExpressRoutePort tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all the ExpressRoutePort resources in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IExpressRoutePortsOperations operations, string resourceGroupName) + { + return ((IExpressRoutePortsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Generate a letter of authorization for the requested ExpressRoutePort - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of ExpressRoutePort. - /// - /// - /// Request parameters supplied to generate a letter of authorization. - /// - public static GenerateExpressRoutePortsLOAResult GenerateLOA(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request) + /// + /// List all the ExpressRoutePort resources in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GenerateLOAAsync(resourceGroupName, expressRoutePortName, request).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List all the ExpressRoutePort resources in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRoutePortsOperations operations) + { + return ((IExpressRoutePortsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Generate a letter of authorization for the requested ExpressRoutePort - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of ExpressRoutePort. - /// - /// - /// Request parameters supplied to generate a letter of authorization. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateLOAAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all the ExpressRoutePort resources in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRoutePortsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GenerateLOAWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, request, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Generate a letter of authorization for the requested ExpressRoutePort + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of ExpressRoutePort. + /// + public static GenerateExpressRoutePortsLOAResult GenerateLOA(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request) + { + return ((IExpressRoutePortsOperations)operations).GenerateLOAAsync(resourceGroupName, expressRoutePortName, request).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - public static void BeginDelete(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName) + /// + /// Generate a letter of authorization for the requested ExpressRoutePort + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of ExpressRoutePort. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateLOAAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GenerateLOAWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, request, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + public static void BeginDelete(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName) + { + ((IExpressRoutePortsOperations)operations).BeginDeleteAsync(resourceGroupName, expressRoutePortName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + public static ExpressRoutePort BeginCreateOrUpdate(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters) + { + return ((IExpressRoutePortsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to the create ExpressRoutePort operation. - /// - public static ExpressRoutePort BeginCreateOrUpdate(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters) + /// + /// Creates or updates the specified ExpressRoutePort resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRoutePort resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List all the ExpressRoutePort resources in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IExpressRoutePortsOperations operations, string nextPageLink) + { + return ((IExpressRoutePortsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified ExpressRoutePort resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to the create ExpressRoutePort operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all the ExpressRoutePort resources in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IExpressRoutePortsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all the ExpressRoutePort resources in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRoutePortsOperations operations, string nextPageLink) + { + return ((IExpressRoutePortsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all the ExpressRoutePort resources in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IExpressRoutePortsOperations operations, string nextPageLink) + /// + /// List all the ExpressRoutePort resources in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRoutePortsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all the ExpressRoutePort resources in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IExpressRoutePortsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all the ExpressRoutePort resources in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRoutePortsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List all the ExpressRoutePort resources in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRoutePortsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperations.cs index 5006b883dcea..ddf54810e236 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteProviderPortsLocationOperations operations. /// - internal partial class ExpressRouteProviderPortsLocationOperations : IServiceOperations, IExpressRouteProviderPortsLocationOperations + internal partial class ExpressRouteProviderPortsLocationOperations : Microsoft.Rest.IServiceOperations, IExpressRouteProviderPortsLocationOperations { /// /// Initializes a new instance of the ExpressRouteProviderPortsLocationOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteProviderPortsLocationOperations : IServiceOpe /// /// Thrown when a required parameter is null /// - internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient client) + internal ExpressRouteProviderPortsLocationOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -55,7 +43,7 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli /// /// /// The filter to apply on the operation. For example, you can use - /// $filter=location eq '{state}'. + /// $filter=location eq '{state}'. /// /// /// Headers that will be added to request. @@ -63,13 +51,13 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,30 +66,40 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,24 +215,28 @@ internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperationsExtensions.cs index 04b9406a45ea..64971bfb2077 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteProviderPortsLocationOperationsExtensions.cs @@ -1,61 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteProviderPortsLocationOperations. + /// Extension methods for ExpressRouteProviderPortsLocationOperations /// public static partial class ExpressRouteProviderPortsLocationOperationsExtensions { - /// - /// Retrieves all the ExpressRouteProviderPorts in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The filter to apply on the operation. For example, you can use - /// $filter=location eq '{state}'. - /// - public static ExpressRouteProviderPortListResult List(this IExpressRouteProviderPortsLocationOperations operations, string filter = default(string)) - { - return operations.ListAsync(filter).GetAwaiter().GetResult(); - } + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter to apply on the operation. For example, you can use + /// $filter=location eq '{state}'. + /// + public static ExpressRouteProviderPortListResult List(this IExpressRouteProviderPortsLocationOperations operations, string filter = default(string)) + { + return ((IExpressRouteProviderPortsLocationOperations)operations).ListAsync(filter).GetAwaiter().GetResult(); + } - /// - /// Retrieves all the ExpressRouteProviderPorts in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The filter to apply on the operation. For example, you can use - /// $filter=location eq '{state}'. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IExpressRouteProviderPortsLocationOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter to apply on the operation. For example, you can use + /// $filter=location eq '{state}'. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IExpressRouteProviderPortsLocationOperations operations, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperations.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperations.cs index a65b890f8a17..2aac54b72d7e 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteServiceProvidersOperations operations. /// - internal partial class ExpressRouteServiceProvidersOperations : IServiceOperations, IExpressRouteServiceProvidersOperations + internal partial class ExpressRouteServiceProvidersOperations : Microsoft.Rest.IServiceOperations, IExpressRouteServiceProvidersOperations { /// /// Initializes a new instance of the ExpressRouteServiceProvidersOperations class. @@ -36,13 +24,13 @@ internal partial class ExpressRouteServiceProvidersOperations : IServiceOperatio /// /// Thrown when a required parameter is null /// - internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) + internal ExpressRouteServiceProvidersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the available express route service providers. /// @@ -238,13 +240,13 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,51 +255,54 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -309,55 +314,56 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -367,9 +373,10 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -380,24 +387,28 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs index 1cb5e6d76cc2..46927aec07a3 100644 --- a/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs @@ -1,87 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ExpressRouteServiceProvidersOperations. + /// Extension methods for ExpressRouteServiceProvidersOperations /// public static partial class ExpressRouteServiceProvidersOperationsExtensions { - /// - /// Gets all the available express route service providers. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IExpressRouteServiceProvidersOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Gets all the available express route service providers. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteServiceProvidersOperations operations) + { + return ((IExpressRouteServiceProvidersOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all the available express route service providers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IExpressRouteServiceProvidersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the available express route service providers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IExpressRouteServiceProvidersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the available express route service providers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteServiceProvidersOperations operations, string nextPageLink) + { + return ((IExpressRouteServiceProvidersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the available express route service providers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExpressRouteServiceProvidersOperations operations, string nextPageLink) + /// + /// Gets all the available express route service providers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IExpressRouteServiceProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the available express route service providers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IExpressRouteServiceProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperations.cs index d56d1056d9c9..a9774bb4834e 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPoliciesOperations operations. /// - internal partial class FirewallPoliciesOperations : IServiceOperations, IFirewallPoliciesOperations + internal partial class FirewallPoliciesOperations : Microsoft.Rest.IServiceOperations, IFirewallPoliciesOperations { /// /// Initializes a new instance of the FirewallPoliciesOperations class. @@ -36,13 +24,13 @@ internal partial class FirewallPoliciesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal FirewallPoliciesOperations(NetworkManagementClient client) + internal FirewallPoliciesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// The name of the Firewall Policy. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Firewall Policy. /// @@ -287,16 +292,16 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update Firewall Policy operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (firewallPolicyName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Firewall Policies in a resource group. /// @@ -519,13 +540,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -534,35 +555,45 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -572,25 +603,24 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -602,55 +632,56 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -660,9 +691,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -673,25 +705,29 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Firewall Policies in a subscription. /// @@ -701,13 +737,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -716,29 +752,38 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Firewall Policy. /// @@ -883,10 +933,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Firewall Policy. /// @@ -1059,13 +1125,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,50 +1140,61 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (firewallPolicyName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (firewallPolicyName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1127,25 +1204,24 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1157,61 +1233,62 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1221,9 +1298,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1234,16 +1312,16 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1252,25 +1330,29 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Firewall Policies in a resource group. /// @@ -1283,13 +1365,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1298,51 +1380,54 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1354,55 +1439,56 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1412,9 +1498,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1425,25 +1512,29 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Firewall Policies in a subscription. /// @@ -1456,13 +1547,13 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1471,51 +1562,54 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1527,55 +1621,56 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1585,9 +1680,10 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1598,24 +1694,28 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperationsExtensions.cs index 045ebf245ac6..9ccb46dbd4db 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPoliciesOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FirewallPoliciesOperations. + /// Extension methods for FirewallPoliciesOperations /// public static partial class FirewallPoliciesOperationsExtensions { - /// - /// Deletes the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static void Delete(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName) - { - operations.DeleteAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Expands referenced resources. - /// - public static FirewallPolicy Get(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, firewallPolicyName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static void Delete(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName) + { + ((IFirewallPoliciesOperations)operations).DeleteAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// Expands referenced resources. + /// + public static FirewallPolicy Get(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, string expand = default(string)) + { + return ((IFirewallPoliciesOperations)operations).GetAsync(resourceGroupName, firewallPolicyName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Parameters supplied to the create or update Firewall Policy operation. - /// - public static FirewallPolicy CreateOrUpdate(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters) + /// + /// Gets the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static FirewallPolicy CreateOrUpdate(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters) + { + return ((IFirewallPoliciesOperations)operations).CreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Parameters supplied to the create or update Firewall Policy operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates tags of a Azure Firewall Policy resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static FirewallPolicy UpdateTags(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, TagsObject parameters) + { + return ((IFirewallPoliciesOperations)operations).UpdateTagsAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a Azure Firewall Policy resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Parameters supplied to update Azure Firewall Policy tags. - /// - public static FirewallPolicy UpdateTags(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, TagsObject parameters) + /// + /// Updates tags of a Azure Firewall Policy resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Firewall Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IFirewallPoliciesOperations operations, string resourceGroupName) + { + return ((IFirewallPoliciesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a Azure Firewall Policy resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Parameters supplied to update Azure Firewall Policy tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Firewall Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the Firewall Policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IFirewallPoliciesOperations operations) + { + return ((IFirewallPoliciesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all Firewall Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IFirewallPoliciesOperations operations, string resourceGroupName) + /// + /// Gets all the Firewall Policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IFirewallPoliciesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static void BeginDelete(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName) + { + ((IFirewallPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + } - /// - /// Lists all Firewall Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static FirewallPolicy BeginCreateOrUpdate(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters) + { + return ((IFirewallPoliciesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all the Firewall Policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IFirewallPoliciesOperations operations) + /// + /// Creates or updates the specified Firewall Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Firewall Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IFirewallPoliciesOperations operations, string nextPageLink) + { + return ((IFirewallPoliciesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the Firewall Policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IFirewallPoliciesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Firewall Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IFirewallPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the Firewall Policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IFirewallPoliciesOperations operations, string nextPageLink) + { + return ((IFirewallPoliciesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static void BeginDelete(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName) + /// + /// Gets all the Firewall Policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IFirewallPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Parameters supplied to the create or update Firewall Policy operation. - /// - public static FirewallPolicy BeginCreateOrUpdate(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified Firewall Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// Parameters supplied to the create or update Firewall Policy operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all Firewall Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IFirewallPoliciesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Firewall Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IFirewallPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the Firewall Policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IFirewallPoliciesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Firewall Policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IFirewallPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs index fcc5441a47f7..94b11a1250b4 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyIdpsSignaturesFilterValuesOperations operations. /// - internal partial class FirewallPolicyIdpsSignaturesFilterValuesOperations : IServiceOperations, IFirewallPolicyIdpsSignaturesFilterValuesOperations + internal partial class FirewallPolicyIdpsSignaturesFilterValuesOperations : Microsoft.Rest.IServiceOperations, IFirewallPolicyIdpsSignaturesFilterValuesOperations { /// /// Initializes a new instance of the FirewallPolicyIdpsSignaturesFilterValuesOperations class. @@ -36,13 +24,13 @@ internal partial class FirewallPolicyIdpsSignaturesFilterValuesOperations : ISer /// /// Thrown when a required parameter is null /// - internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementClient client) + internal FirewallPolicyIdpsSignaturesFilterValuesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,27 +41,28 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli /// /// Retrieves the current filter values for the signatures overrides /// - /// - /// /// /// The name of the resource group. /// /// /// The name of the Firewall Policy. /// + /// + /// + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -82,46 +71,58 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(SignatureOverridesFilterValuesQuery parameters, string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -131,25 +132,24 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -161,61 +161,62 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -225,9 +226,10 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -238,24 +240,28 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperationsExtensions.cs index 20b84acd01ae..5bc01eebb7e9 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperationsExtensions.cs @@ -1,69 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FirewallPolicyIdpsSignaturesFilterValuesOperations. + /// Extension methods for FirewallPolicyIdpsSignaturesFilterValuesOperations /// public static partial class FirewallPolicyIdpsSignaturesFilterValuesOperationsExtensions { - /// - /// Retrieves the current filter values for the signatures overrides - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static SignatureOverridesFilterValuesResponse List(this IFirewallPolicyIdpsSignaturesFilterValuesOperations operations, SignatureOverridesFilterValuesQuery parameters, string resourceGroupName, string firewallPolicyName) - { - return operations.ListAsync(parameters, resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the current filter values for the signatures overrides + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static SignatureOverridesFilterValuesResponse List(this IFirewallPolicyIdpsSignaturesFilterValuesOperations operations, string resourceGroupName, string firewallPolicyName, SignatureOverridesFilterValuesQuery parameters) + { + return ((IFirewallPolicyIdpsSignaturesFilterValuesOperations)operations).ListAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the current filter values for the signatures overrides - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IFirewallPolicyIdpsSignaturesFilterValuesOperations operations, SignatureOverridesFilterValuesQuery parameters, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the current filter values for the signatures overrides + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IFirewallPolicyIdpsSignaturesFilterValuesOperations operations, string resourceGroupName, string firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(parameters, resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperations.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperations.cs index 45ab5ca6d8ca..e1871a05382f 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyIdpsSignaturesOperations operations. /// - internal partial class FirewallPolicyIdpsSignaturesOperations : IServiceOperations, IFirewallPolicyIdpsSignaturesOperations + internal partial class FirewallPolicyIdpsSignaturesOperations : Microsoft.Rest.IServiceOperations, IFirewallPolicyIdpsSignaturesOperations { /// /// Initializes a new instance of the FirewallPolicyIdpsSignaturesOperations class. @@ -36,13 +24,13 @@ internal partial class FirewallPolicyIdpsSignaturesOperations : IServiceOperatio /// /// Thrown when a required parameter is null /// - internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) + internal FirewallPolicyIdpsSignaturesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,6 +49,7 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) /// The name of the Firewall Policy. /// /// + /// /// /// /// Headers that will be added to request. @@ -68,13 +57,13 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,50 +72,61 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, IDPSQueryObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, IdpsQueryObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (firewallPolicyName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + parameters.Validate(); } - if (Client.SubscriptionId == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (parameters != null) + + if (this.Client.SubscriptionId == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -136,25 +136,24 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -166,61 +165,62 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -230,9 +230,10 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -243,24 +244,28 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperationsExtensions.cs index f3fbaaca487a..9051c1108136 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOperationsExtensions.cs @@ -1,71 +1,57 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FirewallPolicyIdpsSignaturesOperations. + /// Extension methods for FirewallPolicyIdpsSignaturesOperations /// public static partial class FirewallPolicyIdpsSignaturesOperationsExtensions { - /// - /// Retrieves the current status of IDPS signatures for the relevant policy. - /// Maximal amount of returned signatures is 1000. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// - public static QueryResults List(this IFirewallPolicyIdpsSignaturesOperations operations, string resourceGroupName, string firewallPolicyName, IDPSQueryObject parameters) - { - return operations.ListAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); - } + /// + /// Retrieves the current status of IDPS signatures for the relevant policy. + /// Maximal amount of returned signatures is 1000. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static QueryResults List(this IFirewallPolicyIdpsSignaturesOperations operations, string resourceGroupName, string firewallPolicyName, IdpsQueryObject parameters) + { + return ((IFirewallPolicyIdpsSignaturesOperations)operations).ListAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the current status of IDPS signatures for the relevant policy. - /// Maximal amount of returned signatures is 1000. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IFirewallPolicyIdpsSignaturesOperations operations, string resourceGroupName, string firewallPolicyName, IDPSQueryObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the current status of IDPS signatures for the relevant policy. + /// Maximal amount of returned signatures is 1000. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IFirewallPolicyIdpsSignaturesOperations operations, string resourceGroupName, string firewallPolicyName, IdpsQueryObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs index 5cbc473f71ee..7910bc2d0ff3 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyIdpsSignaturesOverridesOperations operations. /// - internal partial class FirewallPolicyIdpsSignaturesOverridesOperations : IServiceOperations, IFirewallPolicyIdpsSignaturesOverridesOperations + internal partial class FirewallPolicyIdpsSignaturesOverridesOperations : Microsoft.Rest.IServiceOperations, IFirewallPolicyIdpsSignaturesOverridesOperations { /// /// Initializes a new instance of the FirewallPolicyIdpsSignaturesOverridesOperations class. @@ -36,13 +24,13 @@ internal partial class FirewallPolicyIdpsSignaturesOverridesOperations : IServic /// /// Thrown when a required parameter is null /// - internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient client) + internal FirewallPolicyIdpsSignaturesOverridesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,30 +39,30 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient public NetworkManagementClient Client { get; private set; } /// - /// Will update the status of policy's signature overrides for IDPS + /// Will update the status of policy's signature overrides for IDPS /// - /// - /// Will contain all properties of the object to put - /// /// /// The name of the resource group. /// /// /// The name of the Firewall Policy. /// + /// + /// Will contain all properties of the object to put + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,46 +71,57 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> PatchWithHttpMessagesAsync(SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -132,25 +131,24 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -162,61 +160,62 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -226,9 +225,10 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -239,50 +239,54 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Will override/create a new signature overrides for the policy's IDPS + /// Will override/create a new signature overrides for the policy's IDPS /// - /// - /// Will contain all properties of the object to put - /// /// /// The name of the resource group. /// /// /// The name of the Firewall Policy. /// + /// + /// Will contain all properties of the object to put + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -291,46 +295,58 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> PutWithHttpMessagesAsync(SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -340,25 +356,24 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -370,61 +385,62 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -434,9 +450,10 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -447,25 +464,29 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all signatures overrides for a specific policy. /// @@ -481,13 +502,13 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -496,41 +517,52 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -540,25 +572,24 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -570,55 +601,56 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -628,9 +660,10 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -641,25 +674,29 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all signatures overrides objects for a specific policy as a list /// containing a single value. @@ -676,13 +713,13 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -691,41 +728,52 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -735,25 +783,24 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -765,55 +812,56 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -823,9 +871,10 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -836,24 +885,28 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperationsExtensions.cs index 86450312d04a..9a1c0d7b3189 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyIdpsSignaturesOverridesOperationsExtensions.cs @@ -1,199 +1,174 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FirewallPolicyIdpsSignaturesOverridesOperations. + /// Extension methods for FirewallPolicyIdpsSignaturesOverridesOperations /// public static partial class FirewallPolicyIdpsSignaturesOverridesOperationsExtensions { - /// - /// Will update the status of policy's signature overrides for IDPS - /// - /// - /// The operations group for this extension method. - /// - /// - /// Will contain all properties of the object to put - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static SignaturesOverrides Patch(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName) - { - return operations.PatchAsync(parameters, resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); - } + /// + /// Will update the status of policy's signature overrides for IDPS + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static SignaturesOverrides Patch(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters) + { + return ((IFirewallPolicyIdpsSignaturesOverridesOperations)operations).PatchAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Will update the status of policy's signature overrides for IDPS - /// - /// - /// The operations group for this extension method. - /// - /// - /// Will contain all properties of the object to put - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task PatchAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Will update the status of policy's signature overrides for IDPS + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PatchAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.PatchWithHttpMessagesAsync(parameters, resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Will override/create a new signature overrides for the policy's IDPS + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static SignaturesOverrides Put(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters) + { + return ((IFirewallPolicyIdpsSignaturesOverridesOperations)operations).PutAsync(resourceGroupName, firewallPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Will override/create a new signature overrides for the policy's IDPS - /// - /// - /// The operations group for this extension method. - /// - /// - /// Will contain all properties of the object to put - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static SignaturesOverrides Put(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName) + /// + /// Will override/create a new signature overrides for the policy's IDPS + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PutAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.PutAsync(parameters, resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Returns all signatures overrides for a specific policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static SignaturesOverrides Get(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName) + { + return ((IFirewallPolicyIdpsSignaturesOverridesOperations)operations).GetAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + } - /// - /// Will override/create a new signature overrides for the policy's IDPS - /// - /// - /// The operations group for this extension method. - /// - /// - /// Will contain all properties of the object to put - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task PutAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Returns all signatures overrides for a specific policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.PutWithHttpMessagesAsync(parameters, resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Returns all signatures overrides objects for a specific policy as a list + /// containing a single value. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static SignaturesOverridesList List(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName) + { + return ((IFirewallPolicyIdpsSignaturesOverridesOperations)operations).ListAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + } - /// - /// Returns all signatures overrides for a specific policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static SignaturesOverrides Get(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName) + /// + /// Returns all signatures overrides objects for a specific policy as a list + /// containing a single value. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Returns all signatures overrides for a specific policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns all signatures overrides objects for a specific policy as a list - /// containing a single value. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static SignaturesOverridesList List(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName) - { - return operations.ListAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Returns all signatures overrides objects for a specific policy as a list - /// containing a single value. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IFirewallPolicyIdpsSignaturesOverridesOperations operations, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs index cbaa0ff5a2a4..faa0bc447e47 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyRuleCollectionGroupsOperations operations. /// - internal partial class FirewallPolicyRuleCollectionGroupsOperations : IServiceOperations, IFirewallPolicyRuleCollectionGroupsOperations + internal partial class FirewallPolicyRuleCollectionGroupsOperations : Microsoft.Rest.IServiceOperations, IFirewallPolicyRuleCollectionGroupsOperations { /// /// Initializes a new instance of the FirewallPolicyRuleCollectionGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class FirewallPolicyRuleCollectionGroupsOperations : IServiceOp /// /// Thrown when a required parameter is null /// - internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient client) + internal FirewallPolicyRuleCollectionGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// The name of the FirewallPolicyRuleCollectionGroup. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } + if (ruleCollectionGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("ruleCollectionGroupName", ruleCollectionGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); _url = _url.Replace("{ruleCollectionGroupName}", System.Uri.EscapeDataString(ruleCollectionGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. /// @@ -295,16 +300,16 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// FirewallPolicyRuleCollectionGroup operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +327,13 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +342,52 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +426,56 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +485,10 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +499,29 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified FirewallPolicyRuleCollectionGroup. /// @@ -519,10 +540,10 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,47 +552,59 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } + if (ruleCollectionGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("ruleCollectionGroupName", ruleCollectionGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); _url = _url.Replace("{ruleCollectionGroupName}", System.Uri.EscapeDataString(ruleCollectionGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -581,25 +614,24 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -611,55 +643,56 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,20 +702,25 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. /// @@ -705,13 +743,13 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -720,56 +758,68 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (firewallPolicyName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); + parameters.Validate(); } - if (ruleCollectionGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (firewallPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "firewallPolicyName"); } - if (parameters != null) + + if (ruleCollectionGroupName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("firewallPolicyName", firewallPolicyName); tracingParameters.Add("ruleCollectionGroupName", ruleCollectionGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); _url = _url.Replace("{ruleCollectionGroupName}", System.Uri.EscapeDataString(ruleCollectionGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -779,25 +829,24 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -809,61 +858,62 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -873,9 +923,10 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -886,16 +937,16 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -904,25 +955,29 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. /// @@ -935,13 +990,13 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -950,51 +1005,54 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1006,55 +1064,56 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1064,9 +1123,10 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1077,24 +1137,28 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperationsExtensions.cs index e9839e443f2b..78a1bdcf44a8 100644 --- a/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/FirewallPolicyRuleCollectionGroupsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FirewallPolicyRuleCollectionGroupsOperations. + /// Extension methods for FirewallPolicyRuleCollectionGroupsOperations /// public static partial class FirewallPolicyRuleCollectionGroupsOperationsExtensions { - /// - /// Deletes the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - public static void Delete(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName) - { - operations.DeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - public static FirewallPolicyRuleCollectionGroup Get(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName) - { - return operations.GetAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// Parameters supplied to the create or update - /// FirewallPolicyRuleCollectionGroup operation. - /// - public static FirewallPolicyRuleCollectionGroup CreateOrUpdate(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + public static void Delete(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName) + { + ((IFirewallPolicyRuleCollectionGroupsOperations)operations).DeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// Parameters supplied to the create or update - /// FirewallPolicyRuleCollectionGroup operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + public static FirewallPolicyRuleCollectionGroup Get(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName) + { + return ((IFirewallPolicyRuleCollectionGroupsOperations)operations).GetAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).GetAwaiter().GetResult(); + } - /// - /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - public static IPage List(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName) + /// + /// Gets the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + public static FirewallPolicyRuleCollectionGroup CreateOrUpdate(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters) + { + return ((IFirewallPolicyRuleCollectionGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + public static Microsoft.Rest.Azure.IPage List(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName) + { + return ((IFirewallPolicyRuleCollectionGroupsOperations)operations).ListAsync(resourceGroupName, firewallPolicyName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - public static void BeginDelete(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName) + /// + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + public static void BeginDelete(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName) + { + ((IFirewallPolicyRuleCollectionGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + public static FirewallPolicyRuleCollectionGroup BeginCreateOrUpdate(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters) + { + return ((IFirewallPolicyRuleCollectionGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// Parameters supplied to the create or update - /// FirewallPolicyRuleCollectionGroup operation. - /// - public static FirewallPolicyRuleCollectionGroup BeginCreateOrUpdate(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters) + /// + /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Firewall Policy. + /// + /// + /// The name of the FirewallPolicyRuleCollectionGroup. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IFirewallPolicyRuleCollectionGroupsOperations operations, string nextPageLink) + { + return ((IFirewallPolicyRuleCollectionGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Firewall Policy. - /// - /// - /// The name of the FirewallPolicyRuleCollectionGroup. - /// - /// - /// Parameters supplied to the create or update - /// FirewallPolicyRuleCollectionGroup operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IFirewallPolicyRuleCollectionGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IFirewallPolicyRuleCollectionGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/FlowLogsOperations.cs b/src/Network/Network.Management.Sdk/Generated/FlowLogsOperations.cs index 4a31afba1575..6a1f221c7c90 100644 --- a/src/Network/Network.Management.Sdk/Generated/FlowLogsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/FlowLogsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// FlowLogsOperations operations. /// - internal partial class FlowLogsOperations : IServiceOperations, IFlowLogsOperations + internal partial class FlowLogsOperations : Microsoft.Rest.IServiceOperations, IFlowLogsOperations { /// /// Initializes a new instance of the FlowLogsOperations class. @@ -36,13 +24,13 @@ internal partial class FlowLogsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal FlowLogsOperations(NetworkManagementClient client) + internal FlowLogsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,16 +54,16 @@ internal FlowLogsOperations(NetworkManagementClient client) /// Parameters that define the create or update flow log resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -99,13 +87,13 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -114,52 +102,64 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (flowLogName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "flowLogName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "flowLogName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("flowLogName", flowLogName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{flowLogName}", System.Uri.EscapeDataString(flowLogName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -169,25 +169,24 @@ internal FlowLogsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -199,56 +198,57 @@ internal FlowLogsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -258,9 +258,10 @@ internal FlowLogsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -271,25 +272,29 @@ internal FlowLogsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a flow log resource by name. /// @@ -308,13 +313,13 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -323,47 +328,59 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (flowLogName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "flowLogName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "flowLogName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("flowLogName", flowLogName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{flowLogName}", System.Uri.EscapeDataString(flowLogName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +390,24 @@ internal FlowLogsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,50 +419,51 @@ internal FlowLogsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -456,9 +473,10 @@ internal FlowLogsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -469,25 +487,29 @@ internal FlowLogsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified flow log resource. /// @@ -501,16 +523,16 @@ internal FlowLogsOperations(NetworkManagementClient client) /// The name of the flow log resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -528,13 +550,13 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -543,41 +565,52 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -587,25 +620,24 @@ internal FlowLogsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -617,50 +649,51 @@ internal FlowLogsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -670,9 +703,10 @@ internal FlowLogsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -683,25 +717,29 @@ internal FlowLogsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a flow log for the specified network security group. /// @@ -723,13 +761,13 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -738,56 +776,65 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (flowLogName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "flowLogName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "flowLogName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("flowLogName", flowLogName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{flowLogName}", System.Uri.EscapeDataString(flowLogName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -797,25 +844,24 @@ internal FlowLogsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -827,56 +873,57 @@ internal FlowLogsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -886,9 +933,10 @@ internal FlowLogsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -899,16 +947,16 @@ internal FlowLogsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -917,25 +965,29 @@ internal FlowLogsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified flow log resource. /// @@ -954,10 +1006,10 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -966,47 +1018,59 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (flowLogName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "flowLogName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "flowLogName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("flowLogName", flowLogName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{flowLogName}", System.Uri.EscapeDataString(flowLogName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1016,25 +1080,24 @@ internal FlowLogsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1046,50 +1109,51 @@ internal FlowLogsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1099,20 +1163,25 @@ internal FlowLogsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all flow log resources for the specified Network Watcher. /// @@ -1125,13 +1194,13 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1140,51 +1209,54 @@ internal FlowLogsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1196,50 +1268,51 @@ internal FlowLogsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1249,9 +1322,10 @@ internal FlowLogsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1262,24 +1336,28 @@ internal FlowLogsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/FlowLogsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/FlowLogsOperationsExtensions.cs index 3ac73c636340..e3c3fd7654f4 100644 --- a/src/Network/Network.Management.Sdk/Generated/FlowLogsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/FlowLogsOperationsExtensions.cs @@ -1,387 +1,352 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FlowLogsOperations. + /// Extension methods for FlowLogsOperations /// public static partial class FlowLogsOperationsExtensions { - /// - /// Create or update a flow log for the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log. - /// - /// - /// Parameters that define the create or update flow log resource. - /// - public static FlowLog CreateOrUpdate(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).GetAwaiter().GetResult(); - } + /// + /// Create or update a flow log for the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log. + /// + public static FlowLog CreateOrUpdate(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters) + { + return ((IFlowLogsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update a flow log for the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log. - /// - /// - /// Parameters that define the create or update flow log resource. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a flow log for the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Update tags of the specified flow log. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log. + /// + public static FlowLog UpdateTags(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters) + { + return ((IFlowLogsOperations)operations).UpdateTagsAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update tags of the specified flow log. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log. - /// - /// - /// Parameters supplied to update flow log tags. - /// - public static FlowLog UpdateTags(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters) + /// + /// Update tags of the specified flow log. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a flow log resource by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log resource. + /// + public static FlowLog Get(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName) + { + return ((IFlowLogsOperations)operations).GetAsync(resourceGroupName, networkWatcherName, flowLogName).GetAwaiter().GetResult(); + } - /// - /// Update tags of the specified flow log. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log. - /// - /// - /// Parameters supplied to update flow log tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a flow log resource by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified flow log resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log resource. + /// + public static void Delete(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName) + { + ((IFlowLogsOperations)operations).DeleteAsync(resourceGroupName, networkWatcherName, flowLogName).GetAwaiter().GetResult(); + } - /// - /// Gets a flow log resource by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log resource. - /// - public static FlowLog Get(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName) - { - return operations.GetAsync(resourceGroupName, networkWatcherName, flowLogName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified flow log resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all flow log resources for the specified Network Watcher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + public static Microsoft.Rest.Azure.IPage List(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName) + { + return ((IFlowLogsOperations)operations).ListAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + } - /// - /// Gets a flow log resource by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all flow log resources for the specified Network Watcher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group containing Network Watcher. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a flow log for the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log. + /// + public static FlowLog BeginCreateOrUpdate(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters) + { + return ((IFlowLogsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified flow log resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log resource. - /// - public static void Delete(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName) + /// + /// Create or update a flow log for the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, networkWatcherName, flowLogName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified flow log resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log resource. + /// + public static void BeginDelete(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName) + { + ((IFlowLogsOperations)operations).BeginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified flow log resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log resource. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified flow log resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the flow log resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all flow log resources for the specified Network Watcher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IFlowLogsOperations operations, string nextPageLink) + { + return ((IFlowLogsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all flow log resources for the specified Network Watcher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - public static IPage List(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName) + /// + /// Lists all flow log resources for the specified Network Watcher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IFlowLogsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all flow log resources for the specified Network Watcher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group containing Network Watcher. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a flow log for the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log. - /// - /// - /// Parameters that define the create or update flow log resource. - /// - public static FlowLog BeginCreateOrUpdate(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a flow log for the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log. - /// - /// - /// Parameters that define the create or update flow log resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified flow log resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log resource. - /// - public static void BeginDelete(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName) - { - operations.BeginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified flow log resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the flow log resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IFlowLogsOperations operations, string resourceGroupName, string networkWatcherName, string flowLogName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, flowLogName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all flow log resources for the specified Network Watcher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IFlowLogsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all flow log resources for the specified Network Watcher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IFlowLogsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperations.cs b/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperations.cs index 9c4716a4d79e..7f81cc8f2d16 100644 --- a/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// HubRouteTablesOperations operations. /// - internal partial class HubRouteTablesOperations : IServiceOperations, IHubRouteTablesOperations + internal partial class HubRouteTablesOperations : Microsoft.Rest.IServiceOperations, IHubRouteTablesOperations { /// /// Initializes a new instance of the HubRouteTablesOperations class. @@ -36,13 +24,13 @@ internal partial class HubRouteTablesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal HubRouteTablesOperations(NetworkManagementClient client) + internal HubRouteTablesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates a RouteTable resource if it doesn't exist else updates the existing - /// RouteTable. + /// Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. /// /// /// The resource group name of the VirtualHub. @@ -67,16 +54,16 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// Parameters supplied to create or update RouteTable. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -97,13 +84,13 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -112,47 +99,59 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -162,25 +161,24 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -192,55 +190,56 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -250,9 +249,10 @@ internal HubRouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -263,25 +263,29 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a RouteTable. /// @@ -295,16 +299,16 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// The name of the RouteTable. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +326,13 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +341,52 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +396,24 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +425,56 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +484,10 @@ internal HubRouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,27 +498,31 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// Creates a RouteTable resource if it doesn't exist else updates the existing /// RouteTable. /// /// @@ -523,13 +543,13 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,52 +558,65 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (routeTableParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); - } - if (routeTableParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("routeTableParameters", routeTableParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -593,25 +626,24 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -623,61 +655,62 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(routeTableParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeTableParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeTableParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -687,9 +720,10 @@ internal HubRouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -700,16 +734,16 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -718,25 +752,29 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a RouteTable. /// @@ -755,10 +793,10 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -767,47 +805,59 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +867,24 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +896,56 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,20 +955,25 @@ internal HubRouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all RouteTables. /// @@ -931,13 +986,13 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1001,54 @@ internal HubRouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1060,56 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1119,10 @@ internal HubRouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1133,28 @@ internal HubRouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperationsExtensions.cs index e99ccbd22ade..32e7bece2cd9 100644 --- a/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/HubRouteTablesOperationsExtensions.cs @@ -1,339 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for HubRouteTablesOperations. + /// Extension methods for HubRouteTablesOperations /// public static partial class HubRouteTablesOperationsExtensions { - /// - /// Creates a RouteTable resource if it doesn't exist else updates the existing - /// RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// Parameters supplied to create or update RouteTable. - /// - public static HubRouteTable CreateOrUpdate(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a RouteTable resource if it doesn't exist else updates the existing - /// RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// Parameters supplied to create or update RouteTable. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the details of a RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - public static HubRouteTable Get(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteTable. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - public static void Delete(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); - } + /// + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + public static HubRouteTable CreateOrUpdate(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters) + { + return ((IHubRouteTablesOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteTable. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Retrieves the details of a RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + public static HubRouteTable Get(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + return ((IHubRouteTablesOperations)operations).GetAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all RouteTables. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static IPage List(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName) + /// + /// Retrieves the details of a RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteTable. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + public static void Delete(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + ((IHubRouteTablesOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all RouteTables. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteTable. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all RouteTables. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage List(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IHubRouteTablesOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Creates a RouteTable resource if it doesn't exist else updates the existing - /// RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// Parameters supplied to create or update RouteTable. - /// - public static HubRouteTable BeginCreateOrUpdate(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters) + /// + /// Retrieves the details of all RouteTables. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + public static HubRouteTable BeginCreateOrUpdate(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters) + { + return ((IHubRouteTablesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a RouteTable resource if it doesn't exist else updates the existing - /// RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// Parameters supplied to create or update RouteTable. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteTable. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + public static void BeginDelete(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + ((IHubRouteTablesOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Deletes a RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteTable. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - public static void BeginDelete(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); - } + /// + /// Deletes a RouteTable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteTable. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RouteTable. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all RouteTables. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IHubRouteTablesOperations operations, string nextPageLink) + { + return ((IHubRouteTablesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a RouteTable. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteTable. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RouteTable. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IHubRouteTablesOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all RouteTables. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IHubRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves the details of all RouteTables. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IHubRouteTablesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all RouteTables. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IHubRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperations.cs index bc4314f216d2..ec25e5e8897f 100644 --- a/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// HubVirtualNetworkConnectionsOperations operations. /// - internal partial class HubVirtualNetworkConnectionsOperations : IServiceOperations, IHubVirtualNetworkConnectionsOperations + internal partial class HubVirtualNetworkConnectionsOperations : Microsoft.Rest.IServiceOperations, IHubVirtualNetworkConnectionsOperations { /// /// Initializes a new instance of the HubVirtualNetworkConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class HubVirtualNetworkConnectionsOperations : IServiceOperatio /// /// Thrown when a required parameter is null /// - internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) + internal HubVirtualNetworkConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates a hub virtual network connection if it doesn't exist else updates - /// the existing one. + /// Creates a hub virtual network connection if it doesn't exist else updates the existing one. /// /// /// The resource group name of the HubVirtualNetworkConnection. @@ -67,16 +54,16 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// Parameters supplied to create or update a hub virtual network connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -92,16 +79,16 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// The name of the HubVirtualNetworkConnection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -122,13 +109,13 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -137,47 +124,59 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -187,25 +186,24 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -217,55 +215,56 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -275,9 +274,10 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -288,25 +288,29 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all HubVirtualNetworkConnections. /// @@ -322,13 +326,13 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +341,52 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +396,24 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +425,56 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +484,10 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,27 +498,31 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a hub virtual network connection if it doesn't exist else updates + /// Creates a hub virtual network connection if it doesn't exist else updates /// the existing one. /// /// @@ -523,13 +543,13 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,52 +558,65 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (hubVirtualNetworkConnectionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hubVirtualNetworkConnectionParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); - } - if (hubVirtualNetworkConnectionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hubVirtualNetworkConnectionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("hubVirtualNetworkConnectionParameters", hubVirtualNetworkConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -593,25 +626,24 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -623,61 +655,62 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(hubVirtualNetworkConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hubVirtualNetworkConnectionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(hubVirtualNetworkConnectionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -687,9 +720,10 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -700,16 +734,16 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -718,25 +752,29 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a HubVirtualNetworkConnection. /// @@ -755,10 +793,10 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -767,47 +805,59 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +867,24 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +896,56 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,20 +955,25 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all HubVirtualNetworkConnections. /// @@ -931,13 +986,13 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1001,54 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1060,56 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1119,10 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1133,28 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperationsExtensions.cs index 525cad622aed..f4b0229e045f 100644 --- a/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/HubVirtualNetworkConnectionsOperationsExtensions.cs @@ -1,339 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for HubVirtualNetworkConnectionsOperations. + /// Extension methods for HubVirtualNetworkConnectionsOperations /// public static partial class HubVirtualNetworkConnectionsOperationsExtensions { - /// - /// Creates a hub virtual network connection if it doesn't exist else updates - /// the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the HubVirtualNetworkConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - /// - /// Parameters supplied to create or update a hub virtual network connection. - /// - public static HubVirtualNetworkConnection CreateOrUpdate(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a hub virtual network connection if it doesn't exist else updates - /// the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the HubVirtualNetworkConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - /// - /// Parameters supplied to create or update a hub virtual network connection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a HubVirtualNetworkConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - public static void Delete(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a HubVirtualNetworkConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves the details of a HubVirtualNetworkConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the vpn connection. - /// - public static HubVirtualNetworkConnection Get(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); - } + /// + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the HubVirtualNetworkConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + public static HubVirtualNetworkConnection CreateOrUpdate(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters) + { + return ((IHubVirtualNetworkConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of a HubVirtualNetworkConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the HubVirtualNetworkConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a HubVirtualNetworkConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + public static void Delete(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName) + { + ((IHubVirtualNetworkConnectionsOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all HubVirtualNetworkConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static IPage List(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName) - { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); - } + /// + /// Deletes a HubVirtualNetworkConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of a HubVirtualNetworkConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the vpn connection. + /// + public static HubVirtualNetworkConnection Get(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName) + { + return ((IHubVirtualNetworkConnectionsOperations)operations).GetAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all HubVirtualNetworkConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a HubVirtualNetworkConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves the details of all HubVirtualNetworkConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage List(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IHubVirtualNetworkConnectionsOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Creates a hub virtual network connection if it doesn't exist else updates - /// the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the HubVirtualNetworkConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - /// - /// Parameters supplied to create or update a hub virtual network connection. - /// - public static HubVirtualNetworkConnection BeginCreateOrUpdate(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters) + /// + /// Retrieves the details of all HubVirtualNetworkConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the HubVirtualNetworkConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + public static HubVirtualNetworkConnection BeginCreateOrUpdate(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters) + { + return ((IHubVirtualNetworkConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a hub virtual network connection if it doesn't exist else updates - /// the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the HubVirtualNetworkConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - /// - /// Parameters supplied to create or update a hub virtual network connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the HubVirtualNetworkConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a HubVirtualNetworkConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + public static void BeginDelete(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName) + { + ((IHubVirtualNetworkConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes a HubVirtualNetworkConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - public static void BeginDelete(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); - } + /// + /// Deletes a HubVirtualNetworkConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the HubVirtualNetworkConnection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all HubVirtualNetworkConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IHubVirtualNetworkConnectionsOperations operations, string nextPageLink) + { + return ((IHubVirtualNetworkConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a HubVirtualNetworkConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the HubVirtualNetworkConnection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IHubVirtualNetworkConnectionsOperations operations, string resourceGroupName, string virtualHubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all HubVirtualNetworkConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IHubVirtualNetworkConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves the details of all HubVirtualNetworkConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IHubVirtualNetworkConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all HubVirtualNetworkConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IHubVirtualNetworkConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/IAdminRuleCollectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAdminRuleCollectionsOperations.cs index 9a455de91055..bf6f322f2221 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAdminRuleCollectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAdminRuleCollectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AdminRuleCollectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IAdminRuleCollectionsOperations { /// - /// Lists all the rule collections in a security admin configuration, - /// in a paginated format. + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. /// + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// /// /// The name of the resource group. /// @@ -37,14 +31,14 @@ public partial interface IAdminRuleCollectionsOperations /// The name of the network manager Security Configuration. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -58,14 +52,14 @@ public partial interface IAdminRuleCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a network manager security admin configuration rule - /// collection. + /// Gets a network manager security admin configuration rule collection. /// + /// + /// Gets a network manager security admin configuration rule collection. + /// /// /// The name of the resource group. /// @@ -76,8 +70,7 @@ public partial interface IAdminRuleCollectionsOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// /// The headers that will be added to request. @@ -91,16 +84,14 @@ public partial interface IAdminRuleCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an admin rule collection. /// - /// - /// The Rule Collection to create or update - /// + /// + /// Creates or updates an admin rule collection. + /// /// /// The name of the resource group. /// @@ -111,8 +102,10 @@ public partial interface IAdminRuleCollectionsOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The Rule Collection to create or update /// /// /// The headers that will be added to request. @@ -126,13 +119,14 @@ public partial interface IAdminRuleCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(AdminRuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, AdminRuleCollection ruleCollection, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes an admin rule collection. /// + /// + /// Deletes an admin rule collection. + /// /// /// The name of the resource group. /// @@ -143,14 +137,12 @@ public partial interface IAdminRuleCollectionsOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -161,13 +153,14 @@ public partial interface IAdminRuleCollectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes an admin rule collection. /// + /// + /// Deletes an admin rule collection. + /// /// /// The name of the resource group. /// @@ -178,14 +171,12 @@ public partial interface IAdminRuleCollectionsOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -196,14 +187,16 @@ public partial interface IAdminRuleCollectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the rule collections in a security admin configuration, - /// in a paginated format. + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. /// + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -219,9 +212,7 @@ public partial interface IAdminRuleCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAdminRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAdminRulesOperations.cs index 74285d019678..a30db5deef85 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAdminRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAdminRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AdminRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface IAdminRulesOperations /// /// List all network manager security configuration admin rules. /// + /// + /// List all network manager security configuration admin rules. + /// /// /// The name of the resource group. /// @@ -36,18 +29,17 @@ public partial interface IAdminRulesOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -61,13 +53,14 @@ public partial interface IAdminRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a network manager security configuration admin rule. /// + /// + /// Gets a network manager security configuration admin rule. + /// /// /// The name of the resource group. /// @@ -78,8 +71,7 @@ public partial interface IAdminRulesOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// /// The name of the rule. @@ -96,16 +88,14 @@ public partial interface IAdminRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an admin rule. /// - /// - /// The admin rule to create or update - /// + /// + /// Creates or updates an admin rule. + /// /// /// The name of the resource group. /// @@ -116,12 +106,14 @@ public partial interface IAdminRulesOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// /// The name of the rule. /// + /// + /// The admin rule to create or update + /// /// /// The headers that will be added to request. /// @@ -134,13 +126,14 @@ public partial interface IAdminRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, BaseAdminRule adminRule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes an admin rule. /// + /// + /// Deletes an admin rule. + /// /// /// The name of the resource group. /// @@ -151,17 +144,15 @@ public partial interface IAdminRulesOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// /// The name of the rule. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -172,13 +163,14 @@ public partial interface IAdminRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes an admin rule. /// + /// + /// Deletes an admin rule. + /// /// /// The name of the resource group. /// @@ -189,17 +181,15 @@ public partial interface IAdminRulesOperations /// The name of the network manager Security Configuration. /// /// - /// The name of the network manager security Configuration rule - /// collection. + /// The name of the network manager security Configuration rule collection. /// /// /// The name of the rule. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -210,13 +200,14 @@ public partial interface IAdminRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all network manager security configuration admin rules. /// + /// + /// List all network manager security configuration admin rules. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -232,9 +223,7 @@ public partial interface IAdminRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateEndpointConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateEndpointConnectionsOperations.cs index 7b8459c92408..84f7b3ec4bc2 100644 --- a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateEndpointConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateEndpointConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayPrivateEndpointConnectionsOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations { /// - /// Deletes the specified private endpoint connection on application - /// gateway. + /// Deletes the specified private endpoint connection on application gateway. /// + /// + /// Deletes the specified private endpoint connection on application gateway. + /// /// /// The name of the resource group. /// @@ -45,14 +37,14 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Updates the specified private endpoint connection on application - /// gateway. + /// Updates the specified private endpoint connection on application gateway. /// + /// + /// Updates the specified private endpoint connection on application gateway. + /// /// /// The name of the resource group. /// @@ -78,14 +70,14 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the specified private endpoint connection on application - /// gateway. + /// Gets the specified private endpoint connection on application gateway. /// + /// + /// Gets the specified private endpoint connection on application gateway. + /// /// /// The name of the resource group. /// @@ -107,13 +99,14 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all private endpoint connections on an application gateway. /// + /// + /// Lists all private endpoint connections on an application gateway. + /// /// /// The name of the resource group. /// @@ -132,14 +125,14 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes the specified private endpoint connection on application - /// gateway. + /// Deletes the specified private endpoint connection on application gateway. /// + /// + /// Deletes the specified private endpoint connection on application gateway. + /// /// /// The name of the resource group. /// @@ -158,14 +151,14 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Updates the specified private endpoint connection on application - /// gateway. + /// Updates the specified private endpoint connection on application gateway. /// + /// + /// Updates the specified private endpoint connection on application gateway. + /// /// /// The name of the resource group. /// @@ -191,13 +184,14 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string connectionName, ApplicationGatewayPrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all private endpoint connections on an application gateway. /// + /// + /// Lists all private endpoint connections on an application gateway. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -213,9 +207,7 @@ public partial interface IApplicationGatewayPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateLinkResourcesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateLinkResourcesOperations.cs index 147b6ccff191..11713afe3e42 100644 --- a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateLinkResourcesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayPrivateLinkResourcesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayPrivateLinkResourcesOperations operations. @@ -26,6 +16,9 @@ public partial interface IApplicationGatewayPrivateLinkResourcesOperations /// /// Lists all private link resources on an application gateway. /// + /// + /// Lists all private link resources on an application gateway. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IApplicationGatewayPrivateLinkResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all private link resources on an application gateway. /// + /// + /// Lists all private link resources on an application gateway. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -66,9 +60,7 @@ public partial interface IApplicationGatewayPrivateLinkResourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsDefaultOperations.cs b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsDefaultOperations.cs index 3c55202af6ca..a6139ae153d3 100644 --- a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsDefaultOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsDefaultOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayWafDynamicManifestsDefaultOperations operations. @@ -26,6 +16,9 @@ public partial interface IApplicationGatewayWafDynamicManifestsDefaultOperations /// /// Gets the regional application gateway waf manifest. /// + /// + /// Gets the regional application gateway waf manifest. + /// /// /// The region where the nrp are located at. /// @@ -41,9 +34,7 @@ public partial interface IApplicationGatewayWafDynamicManifestsDefaultOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsOperations.cs index 1b24c00ebade..2ead54fe8857 100644 --- a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewayWafDynamicManifestsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewayWafDynamicManifestsOperations operations. @@ -26,6 +16,9 @@ public partial interface IApplicationGatewayWafDynamicManifestsOperations /// /// Gets the regional application gateway waf manifest. /// + /// + /// Gets the regional application gateway waf manifest. + /// /// /// The region where the nrp are located at. /// @@ -41,13 +34,14 @@ public partial interface IApplicationGatewayWafDynamicManifestsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the regional application gateway waf manifest. /// + /// + /// Gets the regional application gateway waf manifest. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -63,9 +57,7 @@ public partial interface IApplicationGatewayWafDynamicManifestsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewaysOperations.cs index 905d2ab3a58c..ac1c56ebf805 100644 --- a/src/Network/Network.Management.Sdk/Generated/IApplicationGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IApplicationGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationGatewaysOperations operations. @@ -26,6 +16,9 @@ public partial interface IApplicationGatewaysOperations /// /// Deletes the specified application gateway. /// + /// + /// Deletes the specified application gateway. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified application gateway. /// + /// + /// Gets the specified application gateway. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified application gateway. /// + /// + /// Creates or updates the specified application gateway. + /// /// /// The name of the resource group. /// @@ -80,8 +75,7 @@ public partial interface IApplicationGatewaysOperations /// The name of the application gateway. /// /// - /// Parameters supplied to the create or update application gateway - /// operation. + /// Parameters supplied to the create or update application gateway operation. /// /// /// The headers that will be added to request. @@ -95,13 +89,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates the specified application gateway tags. /// + /// + /// Updates the specified application gateway tags. + /// /// /// The name of the resource group. /// @@ -123,13 +118,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all application gateways in a resource group. /// + /// + /// Lists all application gateways in a resource group. + /// /// /// The name of the resource group. /// @@ -145,13 +141,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the application gateways in a subscription. /// + /// + /// Gets all the application gateways in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,13 +161,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts the specified application gateway. /// + /// + /// Starts the specified application gateway. + /// /// /// The name of the resource group. /// @@ -186,13 +184,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stops the specified application gateway in a resource group. /// + /// + /// Stops the specified application gateway in a resource group. + /// /// /// The name of the resource group. /// @@ -208,14 +207,16 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the backend health of the specified application gateway in a - /// resource group. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// /// /// The name of the resource group. /// @@ -223,8 +224,8 @@ public partial interface IApplicationGatewaysOperations /// The name of the application gateway. /// /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in - /// backend health. + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. /// /// /// The headers that will be added to request. @@ -238,28 +239,29 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the backend health for given combination of backend pool and - /// http setting of the specified application gateway in a resource - /// group. + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. /// + /// + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. + /// /// /// The name of the resource group. /// /// /// The name of the application gateway. /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// /// /// Request body for on-demand test probe operation. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in - /// backend health. - /// /// /// The headers that will be added to request. /// @@ -272,70 +274,74 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all available server variables. /// + /// + /// Lists all available server variables. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableServerVariablesWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableServerVariablesWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all available request headers. /// + /// + /// Lists all available request headers. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableRequestHeadersWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableRequestHeadersWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all available response headers. /// + /// + /// Lists all available response headers. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableResponseHeadersWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableResponseHeadersWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all available web application firewall rule sets. /// + /// + /// Lists all available web application firewall rule sets. + /// /// /// The headers that will be added to request. /// @@ -348,13 +354,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListAvailableWafRuleSetsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListAvailableWafRuleSetsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists available Ssl options for configuring Ssl policy. /// + /// + /// Lists available Ssl options for configuring Ssl policy. + /// /// /// The headers that will be added to request. /// @@ -367,13 +374,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListAvailableSslOptionsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListAvailableSslOptionsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all SSL predefined policies for configuring Ssl policy. /// + /// + /// Lists all SSL predefined policies for configuring Ssl policy. + /// /// /// The headers that will be added to request. /// @@ -386,13 +394,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets Ssl predefined policy with the specified policy name. /// + /// + /// Gets Ssl predefined policy with the specified policy name. + /// /// /// Name of Ssl predefined policy. /// @@ -408,13 +417,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetSslPredefinedPolicyWithHttpMessagesAsync(string predefinedPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetSslPredefinedPolicyWithHttpMessagesAsync(string predefinedPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified application gateway. /// + /// + /// Deletes the specified application gateway. + /// /// /// The name of the resource group. /// @@ -430,13 +440,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified application gateway. /// + /// + /// Creates or updates the specified application gateway. + /// /// /// The name of the resource group. /// @@ -444,8 +455,7 @@ public partial interface IApplicationGatewaysOperations /// The name of the application gateway. /// /// - /// Parameters supplied to the create or update application gateway - /// operation. + /// Parameters supplied to the create or update application gateway operation. /// /// /// The headers that will be added to request. @@ -459,13 +469,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts the specified application gateway. /// + /// + /// Starts the specified application gateway. + /// /// /// The name of the resource group. /// @@ -481,13 +492,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stops the specified application gateway in a resource group. /// + /// + /// Stops the specified application gateway in a resource group. + /// /// /// The name of the resource group. /// @@ -503,14 +515,16 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the backend health of the specified application gateway in a - /// resource group. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// /// /// The name of the resource group. /// @@ -518,8 +532,8 @@ public partial interface IApplicationGatewaysOperations /// The name of the application gateway. /// /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in - /// backend health. + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. /// /// /// The headers that will be added to request. @@ -533,28 +547,29 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the backend health for given combination of backend pool and - /// http setting of the specified application gateway in a resource - /// group. + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. /// + /// + /// Gets the backend health for given combination of backend pool and http + /// setting of the specified application gateway in a resource group. + /// /// /// The name of the resource group. /// /// /// The name of the application gateway. /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// /// /// Request body for on-demand test probe operation. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in - /// backend health. - /// /// /// The headers that will be added to request. /// @@ -567,13 +582,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginBackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginBackendHealthOnDemandWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all application gateways in a resource group. /// + /// + /// Lists all application gateways in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -589,13 +605,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the application gateways in a subscription. /// + /// + /// Gets all the application gateways in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -611,13 +628,14 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all SSL predefined policies for configuring Ssl policy. /// + /// + /// Lists all SSL predefined policies for configuring Ssl policy. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -633,9 +651,7 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableSslPredefinedPoliciesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IApplicationSecurityGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IApplicationSecurityGroupsOperations.cs index 0acf6119286e..604e10664d6e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IApplicationSecurityGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IApplicationSecurityGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ApplicationSecurityGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Deletes the specified application security group. /// + /// + /// Deletes the specified application security group. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about the specified application security group. /// + /// + /// Gets information about the specified application security group. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an application security group. /// + /// + /// Creates or updates an application security group. + /// /// /// The name of the resource group. /// @@ -80,8 +75,8 @@ public partial interface IApplicationSecurityGroupsOperations /// The name of the application security group. /// /// - /// Parameters supplied to the create or update - /// ApplicationSecurityGroup operation. + /// Parameters supplied to the create or update ApplicationSecurityGroup + /// operation. /// /// /// The headers that will be added to request. @@ -95,13 +90,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Updates an application security group's tags. + /// Updates an application security group's tags. /// + /// + /// Updates an application security group's tags. + /// /// /// The name of the resource group. /// @@ -123,13 +119,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all application security groups in a subscription. /// + /// + /// Gets all application security groups in a subscription. + /// /// /// The headers that will be added to request. /// @@ -142,13 +139,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the application security groups in a resource group. /// + /// + /// Gets all the application security groups in a resource group. + /// /// /// The name of the resource group. /// @@ -164,13 +162,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified application security group. /// + /// + /// Deletes the specified application security group. + /// /// /// The name of the resource group. /// @@ -186,13 +185,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an application security group. /// + /// + /// Creates or updates an application security group. + /// /// /// The name of the resource group. /// @@ -200,8 +200,8 @@ public partial interface IApplicationSecurityGroupsOperations /// The name of the application security group. /// /// - /// Parameters supplied to the create or update - /// ApplicationSecurityGroup operation. + /// Parameters supplied to the create or update ApplicationSecurityGroup + /// operation. /// /// /// The headers that will be added to request. @@ -215,13 +215,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all application security groups in a subscription. /// + /// + /// Gets all application security groups in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -237,13 +238,14 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the application security groups in a resource group. /// + /// + /// Gets all the application security groups in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,9 +261,7 @@ public partial interface IApplicationSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAvailableDelegationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAvailableDelegationsOperations.cs index c95ce73951e4..48b279d8e6ab 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAvailableDelegationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAvailableDelegationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableDelegationsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IAvailableDelegationsOperations { /// - /// Gets all of the available subnet delegations for this subscription - /// in this region. + /// Gets all of the available subnet delegations for this subscription in this + /// region. /// + /// + /// Gets all of the available subnet delegations for this subscription in this + /// region. + /// /// /// The location of the subnet. /// @@ -42,14 +36,16 @@ public partial interface IAvailableDelegationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all of the available subnet delegations for this subscription - /// in this region. + /// Gets all of the available subnet delegations for this subscription in this + /// region. /// + /// + /// Gets all of the available subnet delegations for this subscription in this + /// region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -65,9 +61,7 @@ public partial interface IAvailableDelegationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAvailableEndpointServicesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAvailableEndpointServicesOperations.cs index 349f0acde18a..97ae54e0b9c0 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAvailableEndpointServicesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAvailableEndpointServicesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableEndpointServicesOperations operations. @@ -26,6 +16,9 @@ public partial interface IAvailableEndpointServicesOperations /// /// List what values of endpoint services are available for use. /// + /// + /// List what values of endpoint services are available for use. + /// /// /// The location to check available endpoint services. /// @@ -41,13 +34,14 @@ public partial interface IAvailableEndpointServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List what values of endpoint services are available for use. /// + /// + /// List what values of endpoint services are available for use. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -63,9 +57,7 @@ public partial interface IAvailableEndpointServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAvailablePrivateEndpointTypesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAvailablePrivateEndpointTypesOperations.cs index e0660ec3ed00..fe2ee907a51c 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAvailablePrivateEndpointTypesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAvailablePrivateEndpointTypesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailablePrivateEndpointTypesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IAvailablePrivateEndpointTypesOperations { /// - /// Returns all of the resource types that can be linked to a Private - /// Endpoint in this subscription in this region. + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. /// + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// /// /// The location of the domain name. /// @@ -42,14 +36,16 @@ public partial interface IAvailablePrivateEndpointTypesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the resource types that can be linked to a Private - /// Endpoint in this subscription in this region. + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. /// + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// /// /// The location of the domain name. /// @@ -68,14 +64,16 @@ public partial interface IAvailablePrivateEndpointTypesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the resource types that can be linked to a Private - /// Endpoint in this subscription in this region. + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. /// + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -91,14 +89,16 @@ public partial interface IAvailablePrivateEndpointTypesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the resource types that can be linked to a Private - /// Endpoint in this subscription in this region. + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. /// + /// + /// Returns all of the resource types that can be linked to a Private Endpoint + /// in this subscription in this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -114,9 +114,7 @@ public partial interface IAvailablePrivateEndpointTypesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAvailableResourceGroupDelegationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAvailableResourceGroupDelegationsOperations.cs index 7dcccf9df387..9c788cfb28ba 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAvailableResourceGroupDelegationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAvailableResourceGroupDelegationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableResourceGroupDelegationsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IAvailableResourceGroupDelegationsOperations { /// - /// Gets all of the available subnet delegations for this resource - /// group in this region. + /// Gets all of the available subnet delegations for this resource group in + /// this region. /// + /// + /// Gets all of the available subnet delegations for this resource group in + /// this region. + /// /// /// The location of the domain name. /// @@ -45,14 +39,16 @@ public partial interface IAvailableResourceGroupDelegationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all of the available subnet delegations for this resource - /// group in this region. + /// Gets all of the available subnet delegations for this resource group in + /// this region. /// + /// + /// Gets all of the available subnet delegations for this resource group in + /// this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -68,9 +64,7 @@ public partial interface IAvailableResourceGroupDelegationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAvailableServiceAliasesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAvailableServiceAliasesOperations.cs index 06d82d50eaed..9ef5f428f4de 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAvailableServiceAliasesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAvailableServiceAliasesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableServiceAliasesOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface IAvailableServiceAliasesOperations { /// - /// Gets all available service aliases for this subscription in this - /// region. + /// Gets all available service aliases for this subscription in this region. /// + /// + /// Gets all available service aliases for this subscription in this region. + /// /// /// The location. /// @@ -42,14 +34,14 @@ public partial interface IAvailableServiceAliasesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all available service aliases for this resource group in this - /// region. + /// Gets all available service aliases for this resource group in this region. /// + /// + /// Gets all available service aliases for this resource group in this region. + /// /// /// The name of the resource group. /// @@ -68,14 +60,14 @@ public partial interface IAvailableServiceAliasesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all available service aliases for this subscription in this - /// region. + /// Gets all available service aliases for this subscription in this region. /// + /// + /// Gets all available service aliases for this subscription in this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -91,14 +83,14 @@ public partial interface IAvailableServiceAliasesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all available service aliases for this resource group in this - /// region. + /// Gets all available service aliases for this resource group in this region. /// + /// + /// Gets all available service aliases for this resource group in this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -114,9 +106,7 @@ public partial interface IAvailableServiceAliasesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAzureFirewallFqdnTagsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAzureFirewallFqdnTagsOperations.cs index a43d77c7fad4..97c2b0a63fde 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAzureFirewallFqdnTagsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAzureFirewallFqdnTagsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AzureFirewallFqdnTagsOperations operations. @@ -26,6 +16,9 @@ public partial interface IAzureFirewallFqdnTagsOperations /// /// Gets all the Azure Firewall FQDN Tags in a subscription. /// + /// + /// Gets all the Azure Firewall FQDN Tags in a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IAzureFirewallFqdnTagsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Azure Firewall FQDN Tags in a subscription. /// + /// + /// Gets all the Azure Firewall FQDN Tags in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface IAzureFirewallFqdnTagsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IAzureFirewallsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IAzureFirewallsOperations.cs index 5d7bbf1f7f9b..52eb9b5431f4 100644 --- a/src/Network/Network.Management.Sdk/Generated/IAzureFirewallsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IAzureFirewallsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AzureFirewallsOperations operations. @@ -26,6 +16,9 @@ public partial interface IAzureFirewallsOperations /// /// Deletes the specified Azure Firewall. /// + /// + /// Deletes the specified Azure Firewall. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Azure Firewall. /// + /// + /// Gets the specified Azure Firewall. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Azure Firewall. /// + /// + /// Creates or updates the specified Azure Firewall. + /// /// /// The name of the resource group. /// @@ -80,8 +75,7 @@ public partial interface IAzureFirewallsOperations /// The name of the Azure Firewall. /// /// - /// Parameters supplied to the create or update Azure Firewall - /// operation. + /// Parameters supplied to the create or update Azure Firewall operation. /// /// /// The headers that will be added to request. @@ -95,13 +89,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of an Azure Firewall resource. /// + /// + /// Updates tags of an Azure Firewall resource. + /// /// /// The name of the resource group. /// @@ -123,13 +118,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Azure Firewalls in a resource group. /// + /// + /// Lists all Azure Firewalls in a resource group. + /// /// /// The name of the resource group. /// @@ -145,13 +141,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Azure Firewalls in a subscription. /// + /// + /// Gets all the Azure Firewalls in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,14 +161,16 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a list of all IP prefixes that azure firewall has learned - /// to not SNAT. + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. /// + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// /// /// The name of the resource group. /// @@ -190,13 +189,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Runs a packet capture on AzureFirewall. /// + /// + /// Runs a packet capture on AzureFirewall. + /// /// /// The name of the resource group. /// @@ -215,13 +215,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> PacketCaptureMethodWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PacketCaptureWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Azure Firewall. /// + /// + /// Deletes the specified Azure Firewall. + /// /// /// The name of the resource group. /// @@ -237,13 +238,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Azure Firewall. /// + /// + /// Creates or updates the specified Azure Firewall. + /// /// /// The name of the resource group. /// @@ -251,8 +253,7 @@ public partial interface IAzureFirewallsOperations /// The name of the Azure Firewall. /// /// - /// Parameters supplied to the create or update Azure Firewall - /// operation. + /// Parameters supplied to the create or update Azure Firewall operation. /// /// /// The headers that will be added to request. @@ -266,13 +267,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of an Azure Firewall resource. /// + /// + /// Updates tags of an Azure Firewall resource. + /// /// /// The name of the resource group. /// @@ -294,14 +296,16 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a list of all IP prefixes that azure firewall has learned - /// to not SNAT. + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. /// + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// /// /// The name of the resource group. /// @@ -320,13 +324,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Runs a packet capture on AzureFirewall. /// + /// + /// Runs a packet capture on AzureFirewall. + /// /// /// The name of the resource group. /// @@ -345,13 +350,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginPacketCaptureMethodWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, FirewallPacketCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Azure Firewalls in a resource group. /// + /// + /// Lists all Azure Firewalls in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -367,13 +373,14 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Azure Firewalls in a subscription. /// + /// + /// Gets all the Azure Firewalls in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -389,9 +396,7 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IBastionHostsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IBastionHostsOperations.cs index ecbfa87faa1f..1e7c1258f48f 100644 --- a/src/Network/Network.Management.Sdk/Generated/IBastionHostsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IBastionHostsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// BastionHostsOperations operations. @@ -26,6 +16,9 @@ public partial interface IBastionHostsOperations /// /// Deletes the specified Bastion Host. /// + /// + /// Deletes the specified Bastion Host. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Bastion Host. /// + /// + /// Gets the specified Bastion Host. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Bastion Host. /// + /// + /// Creates or updates the specified Bastion Host. + /// /// /// The name of the resource group. /// @@ -94,13 +89,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates Tags for BastionHost resource /// + /// + /// Updates Tags for BastionHost resource + /// /// /// The name of the resource group. /// @@ -122,13 +118,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Bastion Hosts in a subscription. /// + /// + /// Lists all Bastion Hosts in a subscription. + /// /// /// The headers that will be added to request. /// @@ -141,13 +138,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Bastion Hosts in a resource group. /// + /// + /// Lists all Bastion Hosts in a resource group. + /// /// /// The name of the resource group. /// @@ -163,13 +161,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Bastion Host. /// + /// + /// Deletes the specified Bastion Host. + /// /// /// The name of the resource group. /// @@ -185,13 +184,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Bastion Host. /// + /// + /// Creates or updates the specified Bastion Host. + /// /// /// The name of the resource group. /// @@ -213,13 +213,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates Tags for BastionHost resource /// + /// + /// Updates Tags for BastionHost resource + /// /// /// The name of the resource group. /// @@ -241,13 +242,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Bastion Hosts in a subscription. /// + /// + /// Lists all Bastion Hosts in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -263,13 +265,14 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Bastion Hosts in a resource group. /// + /// + /// Lists all Bastion Hosts in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -285,9 +288,7 @@ public partial interface IBastionHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IBgpServiceCommunitiesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IBgpServiceCommunitiesOperations.cs index e9fe13b19e9e..0d129d207580 100644 --- a/src/Network/Network.Management.Sdk/Generated/IBgpServiceCommunitiesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IBgpServiceCommunitiesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// BgpServiceCommunitiesOperations operations. @@ -26,6 +16,9 @@ public partial interface IBgpServiceCommunitiesOperations /// /// Gets all the available bgp service communities. /// + /// + /// Gets all the available bgp service communities. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IBgpServiceCommunitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the available bgp service communities. /// + /// + /// Gets all the available bgp service communities. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface IBgpServiceCommunitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IConfigurationPolicyGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IConfigurationPolicyGroupsOperations.cs index b6ab46cf27e6..50c937624925 100644 --- a/src/Network/Network.Management.Sdk/Generated/IConfigurationPolicyGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IConfigurationPolicyGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ConfigurationPolicyGroupsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IConfigurationPolicyGroupsOperations { /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates - /// the existing one. + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. /// + /// + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. + /// /// /// The resource group name of the ConfigurationPolicyGroup. /// @@ -52,13 +46,14 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a ConfigurationPolicyGroup. /// + /// + /// Deletes a ConfigurationPolicyGroup. + /// /// /// The resource group name of the ConfigurationPolicyGroup. /// @@ -77,13 +72,14 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of a ConfigurationPolicyGroup. /// + /// + /// Retrieves the details of a ConfigurationPolicyGroup. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -105,14 +101,16 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the configurationPolicyGroups in a resource group for a /// vpnServerConfiguration. /// + /// + /// Lists all the configurationPolicyGroups in a resource group for a + /// vpnServerConfiguration. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -131,14 +129,16 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnServerConfigurationWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnServerConfigurationWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates - /// the existing one. + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. /// + /// + /// Creates a ConfigurationPolicyGroup if it doesn't exist else updates the + /// existing one. + /// /// /// The resource group name of the ConfigurationPolicyGroup. /// @@ -164,13 +164,14 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroupParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a ConfigurationPolicyGroup. /// + /// + /// Deletes a ConfigurationPolicyGroup. + /// /// /// The resource group name of the ConfigurationPolicyGroup. /// @@ -189,14 +190,16 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, string configurationPolicyGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the configurationPolicyGroups in a resource group for a /// vpnServerConfiguration. /// + /// + /// Lists all the configurationPolicyGroups in a resource group for a + /// vpnServerConfiguration. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -212,9 +215,7 @@ public partial interface IConfigurationPolicyGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnServerConfigurationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnServerConfigurationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IConnectionMonitorsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IConnectionMonitorsOperations.cs index 77ac65c5428f..00a4ca3ab0f5 100644 --- a/src/Network/Network.Management.Sdk/Generated/IConnectionMonitorsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IConnectionMonitorsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ConnectionMonitorsOperations operations. @@ -26,6 +16,9 @@ public partial interface IConnectionMonitorsOperations /// /// Create or update a connection monitor. /// + /// + /// Create or update a connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -35,13 +28,12 @@ public partial interface IConnectionMonitorsOperations /// /// The name of the connection monitor. /// - /// - /// Parameters that define the operation to create a connection - /// monitor. - /// /// - /// Value indicating whether connection monitor V1 should be migrated - /// to V2 format. + /// Value indicating whether connection monitor V1 should be migrated to V2 + /// format. + /// + /// + /// Parameters that define the operation to create a connection monitor. /// /// /// The headers that will be added to request. @@ -49,19 +41,20 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a connection monitor by name. /// + /// + /// Gets a connection monitor by name. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -77,19 +70,20 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified connection monitor. /// + /// + /// Deletes the specified connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -105,16 +99,17 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update tags of the specified connection monitor. /// + /// + /// Update tags of the specified connection monitor. + /// /// /// The name of the resource group. /// @@ -133,19 +128,20 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stops the specified connection monitor. /// + /// + /// Stops the specified connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -161,16 +157,17 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts the specified connection monitor. /// + /// + /// Starts the specified connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -186,16 +183,17 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Query a snapshot of the most recent connection states. /// + /// + /// Query a snapshot of the most recent connection states. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -211,19 +209,20 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> QueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> QueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all connection monitors for the specified Network Watcher. /// + /// + /// Lists all connection monitors for the specified Network Watcher. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -236,19 +235,20 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a connection monitor. /// + /// + /// Create or update a connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -258,13 +258,12 @@ public partial interface IConnectionMonitorsOperations /// /// The name of the connection monitor. /// - /// - /// Parameters that define the operation to create a connection - /// monitor. - /// /// - /// Value indicating whether connection monitor V1 should be migrated - /// to V2 format. + /// Value indicating whether connection monitor V1 should be migrated to V2 + /// format. + /// + /// + /// Parameters that define the operation to create a connection monitor. /// /// /// The headers that will be added to request. @@ -272,19 +271,20 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, ConnectionMonitor parameters, string migrate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified connection monitor. /// + /// + /// Deletes the specified connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -300,16 +300,17 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stops the specified connection monitor. /// + /// + /// Stops the specified connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -325,16 +326,17 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts the specified connection monitor. /// + /// + /// Starts the specified connection monitor. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -350,16 +352,17 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Query a snapshot of the most recent connection states. /// + /// + /// Query a snapshot of the most recent connection states. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -375,15 +378,13 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginQueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginQueryWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string connectionMonitorName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IConnectivityConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IConnectivityConfigurationsOperations.cs index 017452b5654c..878a55ba22e4 100644 --- a/src/Network/Network.Management.Sdk/Generated/IConnectivityConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IConnectivityConfigurationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ConnectivityConfigurationsOperations operations. @@ -24,10 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IConnectivityConfigurationsOperations { /// - /// Gets a Network Connectivity Configuration, specified by the - /// resource group, network manager name, and connectivity - /// Configuration name + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name /// + /// + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name + /// /// /// The name of the resource group. /// @@ -49,17 +42,14 @@ public partial interface IConnectivityConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates/Updates a new network manager connectivity configuration /// - /// - /// Parameters supplied to create/update a network manager connectivity - /// configuration - /// + /// + /// Creates/Updates a new network manager connectivity configuration + /// /// /// The name of the resource group. /// @@ -69,6 +59,10 @@ public partial interface IConnectivityConfigurationsOperations /// /// The name of the network manager connectivity configuration. /// + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration + /// /// /// The headers that will be added to request. /// @@ -81,15 +75,16 @@ public partial interface IConnectivityConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, ConnectivityConfiguration connectivityConfiguration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a network manager connectivity configuration, specified by - /// the resource group, network manager name, and connectivity - /// configuration name + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name /// + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// /// /// The name of the resource group. /// @@ -100,10 +95,9 @@ public partial interface IConnectivityConfigurationsOperations /// The name of the network manager connectivity configuration. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -114,14 +108,16 @@ public partial interface IConnectivityConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the network manager connectivity configuration in a - /// specified network manager. + /// Lists all the network manager connectivity configuration in a specified + /// network manager. /// + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// /// /// The name of the resource group. /// @@ -129,14 +125,14 @@ public partial interface IConnectivityConfigurationsOperations /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -150,15 +146,16 @@ public partial interface IConnectivityConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a network manager connectivity configuration, specified by - /// the resource group, network manager name, and connectivity - /// configuration name + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name /// + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// /// /// The name of the resource group. /// @@ -169,10 +166,9 @@ public partial interface IConnectivityConfigurationsOperations /// The name of the network manager connectivity configuration. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -183,14 +179,16 @@ public partial interface IConnectivityConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the network manager connectivity configuration in a - /// specified network manager. + /// Lists all the network manager connectivity configuration in a specified + /// network manager. /// + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -206,9 +204,7 @@ public partial interface IConnectivityConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ICustomIPPrefixesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ICustomIPPrefixesOperations.cs index 6aa9604e6c01..3609feb7266d 100644 --- a/src/Network/Network.Management.Sdk/Generated/ICustomIPPrefixesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ICustomIPPrefixesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CustomIPPrefixesOperations operations. @@ -26,6 +16,9 @@ public partial interface ICustomIPPrefixesOperations /// /// Deletes the specified custom IP prefix. /// + /// + /// Deletes the specified custom IP prefix. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified custom IP prefix in a specified resource group. /// + /// + /// Gets the specified custom IP prefix in a specified resource group. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a custom IP prefix. /// + /// + /// Creates or updates a custom IP prefix. + /// /// /// The name of the resource group. /// @@ -83,8 +78,7 @@ public partial interface ICustomIPPrefixesOperations /// The name of the custom IP prefix. /// /// - /// Parameters supplied to the create or update custom IP prefix - /// operation. + /// Parameters supplied to the create or update custom IP prefix operation. /// /// /// The headers that will be added to request. @@ -98,13 +92,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates custom IP prefix tags. /// + /// + /// Updates custom IP prefix tags. + /// /// /// The name of the resource group. /// @@ -126,13 +121,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the custom IP prefixes in a subscription. /// + /// + /// Gets all the custom IP prefixes in a subscription. + /// /// /// The headers that will be added to request. /// @@ -145,13 +141,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all custom IP prefixes in a resource group. /// + /// + /// Gets all custom IP prefixes in a resource group. + /// /// /// The name of the resource group. /// @@ -167,13 +164,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified custom IP prefix. /// + /// + /// Deletes the specified custom IP prefix. + /// /// /// The name of the resource group. /// @@ -189,13 +187,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a custom IP prefix. /// + /// + /// Creates or updates a custom IP prefix. + /// /// /// The name of the resource group. /// @@ -203,8 +202,7 @@ public partial interface ICustomIPPrefixesOperations /// The name of the custom IP prefix. /// /// - /// Parameters supplied to the create or update custom IP prefix - /// operation. + /// Parameters supplied to the create or update custom IP prefix operation. /// /// /// The headers that will be added to request. @@ -218,13 +216,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string customIpPrefixName, CustomIpPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the custom IP prefixes in a subscription. /// + /// + /// Gets all the custom IP prefixes in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -240,13 +239,14 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all custom IP prefixes in a resource group. /// + /// + /// Gets all custom IP prefixes in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -262,9 +262,7 @@ public partial interface ICustomIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IDdosCustomPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IDdosCustomPoliciesOperations.cs index 01792ba32d56..e4a07ac02265 100644 --- a/src/Network/Network.Management.Sdk/Generated/IDdosCustomPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IDdosCustomPoliciesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DdosCustomPoliciesOperations operations. @@ -26,6 +16,9 @@ public partial interface IDdosCustomPoliciesOperations /// /// Deletes the specified DDoS custom policy. /// + /// + /// Deletes the specified DDoS custom policy. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IDdosCustomPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about the specified DDoS custom policy. /// + /// + /// Gets information about the specified DDoS custom policy. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IDdosCustomPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a DDoS custom policy. /// + /// + /// Creates or updates a DDoS custom policy. + /// /// /// The name of the resource group. /// @@ -94,13 +89,14 @@ public partial interface IDdosCustomPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a DDoS custom policy tags. /// + /// + /// Update a DDoS custom policy tags. + /// /// /// The name of the resource group. /// @@ -122,13 +118,14 @@ public partial interface IDdosCustomPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified DDoS custom policy. /// + /// + /// Deletes the specified DDoS custom policy. + /// /// /// The name of the resource group. /// @@ -144,13 +141,14 @@ public partial interface IDdosCustomPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a DDoS custom policy. /// + /// + /// Creates or updates a DDoS custom policy. + /// /// /// The name of the resource group. /// @@ -172,9 +170,7 @@ public partial interface IDdosCustomPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IDdosProtectionPlansOperations.cs b/src/Network/Network.Management.Sdk/Generated/IDdosProtectionPlansOperations.cs index b2ae25d3bbdf..5e7c4f0581c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/IDdosProtectionPlansOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IDdosProtectionPlansOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DdosProtectionPlansOperations operations. @@ -26,6 +16,9 @@ public partial interface IDdosProtectionPlansOperations /// /// Deletes the specified DDoS protection plan. /// + /// + /// Deletes the specified DDoS protection plan. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about the specified DDoS protection plan. /// + /// + /// Gets information about the specified DDoS protection plan. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a DDoS protection plan. /// + /// + /// Creates or updates a DDoS protection plan. + /// /// /// The name of the resource group. /// @@ -94,13 +89,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a DDoS protection plan tags. /// + /// + /// Update a DDoS protection plan tags. + /// /// /// The name of the resource group. /// @@ -108,8 +104,7 @@ public partial interface IDdosProtectionPlansOperations /// The name of the DDoS protection plan. /// /// - /// Parameters supplied to the update DDoS protection plan resource - /// tags. + /// Parameters supplied to the update DDoS protection plan resource tags. /// /// /// The headers that will be added to request. @@ -123,13 +118,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all DDoS protection plans in a subscription. /// + /// + /// Gets all DDoS protection plans in a subscription. + /// /// /// The headers that will be added to request. /// @@ -142,13 +138,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the DDoS protection plans in a resource group. /// + /// + /// Gets all the DDoS protection plans in a resource group. + /// /// /// The name of the resource group. /// @@ -164,13 +161,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified DDoS protection plan. /// + /// + /// Deletes the specified DDoS protection plan. + /// /// /// The name of the resource group. /// @@ -186,13 +184,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a DDoS protection plan. /// + /// + /// Creates or updates a DDoS protection plan. + /// /// /// The name of the resource group. /// @@ -214,13 +213,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all DDoS protection plans in a subscription. /// + /// + /// Gets all DDoS protection plans in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -236,13 +236,14 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the DDoS protection plans in a resource group. /// + /// + /// Gets all the DDoS protection plans in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -258,9 +259,7 @@ public partial interface IDdosProtectionPlansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IDefaultSecurityRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IDefaultSecurityRulesOperations.cs index 590759c32197..b38663427e38 100644 --- a/src/Network/Network.Management.Sdk/Generated/IDefaultSecurityRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IDefaultSecurityRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DefaultSecurityRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface IDefaultSecurityRulesOperations /// /// Gets all default security rules in a network security group. /// + /// + /// Gets all default security rules in a network security group. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IDefaultSecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified default network security rule. /// + /// + /// Get the specified default network security rule. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface IDefaultSecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all default security rules in a network security group. /// + /// + /// Gets all default security rules in a network security group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface IDefaultSecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IDscpConfigurationOperations.cs b/src/Network/Network.Management.Sdk/Generated/IDscpConfigurationOperations.cs index 4c9282dd01d4..544b447af60e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IDscpConfigurationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IDscpConfigurationOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DscpConfigurationOperations operations. @@ -26,6 +16,9 @@ public partial interface IDscpConfigurationOperations /// /// Creates or updates a DSCP Configuration. /// + /// + /// Creates or updates a DSCP Configuration. + /// /// /// The name of the resource group. /// @@ -33,8 +26,7 @@ public partial interface IDscpConfigurationOperations /// The name of the resource. /// /// - /// Parameters supplied to the create or update dscp configuration - /// operation. + /// Parameters supplied to the create or update dscp configuration operation. /// /// /// The headers that will be added to request. @@ -48,13 +40,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a DSCP Configuration. /// + /// + /// Deletes a DSCP Configuration. + /// /// /// The name of the resource group. /// @@ -70,13 +63,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a DSCP Configuration. /// + /// + /// Gets a DSCP Configuration. + /// /// /// The name of the resource group. /// @@ -95,13 +89,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a DSCP Configuration. /// + /// + /// Gets a DSCP Configuration. + /// /// /// The name of the resource group. /// @@ -117,13 +112,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all dscp configurations in a subscription. /// + /// + /// Gets all dscp configurations in a subscription. + /// /// /// The headers that will be added to request. /// @@ -136,13 +132,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a DSCP Configuration. /// + /// + /// Creates or updates a DSCP Configuration. + /// /// /// The name of the resource group. /// @@ -150,8 +147,7 @@ public partial interface IDscpConfigurationOperations /// The name of the resource. /// /// - /// Parameters supplied to the create or update dscp configuration - /// operation. + /// Parameters supplied to the create or update dscp configuration operation. /// /// /// The headers that will be added to request. @@ -165,13 +161,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, DscpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a DSCP Configuration. /// + /// + /// Deletes a DSCP Configuration. + /// /// /// The name of the resource group. /// @@ -187,13 +184,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dscpConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a DSCP Configuration. /// + /// + /// Gets a DSCP Configuration. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -209,13 +207,14 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all dscp configurations in a subscription. /// + /// + /// Gets all dscp configurations in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -231,9 +230,7 @@ public partial interface IDscpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitAuthorizationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitAuthorizationsOperations.cs index d22576ef9f82..c71a10205330 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitAuthorizationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitAuthorizationsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitAuthorizationsOperations { /// - /// Deletes the specified authorization from the specified express - /// route circuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// + /// + /// Deletes the specified authorization from the specified express route + /// circuit. + /// /// /// The name of the resource group. /// @@ -45,14 +39,14 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the specified authorization from the specified express route - /// circuit. + /// Gets the specified authorization from the specified express route circuit. /// + /// + /// Gets the specified authorization from the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -74,14 +68,14 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an authorization in the specified express route - /// circuit. + /// Creates or updates an authorization in the specified express route circuit. /// + /// + /// Creates or updates an authorization in the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -107,13 +101,14 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all authorizations in an express route circuit. /// + /// + /// Gets all authorizations in an express route circuit. + /// /// /// The name of the resource group. /// @@ -132,14 +127,16 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes the specified authorization from the specified express - /// route circuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// + /// + /// Deletes the specified authorization from the specified express route + /// circuit. + /// /// /// The name of the resource group. /// @@ -158,14 +155,14 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an authorization in the specified express route - /// circuit. + /// Creates or updates an authorization in the specified express route circuit. /// + /// + /// Creates or updates an authorization in the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -191,13 +188,14 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all authorizations in an express route circuit. /// + /// + /// Gets all authorizations in an express route circuit. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -213,9 +211,7 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitConnectionsOperations.cs index 5f4d2174f413..a4c88db838e8 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitConnectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitConnectionsOperations { /// - /// Deletes the specified Express Route Circuit Connection from the - /// specified express route circuit. + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. /// + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// /// /// The name of the resource group. /// @@ -48,14 +42,16 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the specified Express Route Circuit Connection from the - /// specified express route circuit. + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. /// + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// /// /// The name of the resource group. /// @@ -80,14 +76,16 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a Express Route Circuit Connection in the - /// specified express route circuits. + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. /// + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// /// /// The name of the resource group. /// @@ -116,14 +114,16 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all global reach connections associated with a private peering - /// in an express route circuit. + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. /// + /// + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. + /// /// /// The name of the resource group. /// @@ -145,14 +145,16 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes the specified Express Route Circuit Connection from the - /// specified express route circuit. + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. /// + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// /// /// The name of the resource group. /// @@ -174,14 +176,16 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a Express Route Circuit Connection in the - /// specified express route circuits. + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. /// + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// /// /// The name of the resource group. /// @@ -210,14 +214,16 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all global reach connections associated with a private peering - /// in an express route circuit. + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. /// + /// + /// Gets all global reach connections associated with a private peering in an + /// express route circuit. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -233,9 +239,7 @@ public partial interface IExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitPeeringsOperations.cs index 5e077d204b98..d8c6001b16ad 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitPeeringsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitPeeringsOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitPeeringsOperations { /// - /// Deletes the specified peering from the specified express route - /// circuit. + /// Deletes the specified peering from the specified express route circuit. /// + /// + /// Deletes the specified peering from the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -45,13 +37,14 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified peering for the express route circuit. /// + /// + /// Gets the specified peering for the express route circuit. + /// /// /// The name of the resource group. /// @@ -73,14 +66,14 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a peering in the specified express route - /// circuits. + /// Creates or updates a peering in the specified express route circuits. /// + /// + /// Creates or updates a peering in the specified express route circuits. + /// /// /// The name of the resource group. /// @@ -91,8 +84,8 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create or update express route circuit - /// peering operation. + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// The headers that will be added to request. @@ -106,13 +99,14 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all peerings in a specified express route circuit. /// + /// + /// Gets all peerings in a specified express route circuit. + /// /// /// The name of the resource group. /// @@ -131,14 +125,14 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes the specified peering from the specified express route - /// circuit. + /// Deletes the specified peering from the specified express route circuit. /// + /// + /// Deletes the specified peering from the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -157,14 +151,14 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a peering in the specified express route - /// circuits. + /// Creates or updates a peering in the specified express route circuits. /// + /// + /// Creates or updates a peering in the specified express route circuits. + /// /// /// The name of the resource group. /// @@ -175,8 +169,8 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create or update express route circuit - /// peering operation. + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// The headers that will be added to request. @@ -190,13 +184,14 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all peerings in a specified express route circuit. /// + /// + /// Gets all peerings in a specified express route circuit. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -212,9 +207,7 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitsOperations.cs index 727cc7987102..12d6be164f7d 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCircuitsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCircuitsOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRouteCircuitsOperations /// /// Deletes the specified express route circuit. /// + /// + /// Deletes the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about the specified express route circuit. /// + /// + /// Gets information about the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an express route circuit. /// + /// + /// Creates or updates an express route circuit. + /// /// /// The name of the resource group. /// @@ -95,13 +90,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates an express route circuit tags. /// + /// + /// Updates an express route circuit tags. + /// /// /// The name of the resource group. /// @@ -123,14 +119,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised ARP table associated with the express - /// route circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -155,14 +153,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised routes table associated with the - /// express route circuit in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -187,14 +187,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised routes table summary associated with - /// the express route circuit in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -219,14 +221,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all the stats from an express route circuit in a resource - /// group. + /// Gets all the stats from an express route circuit in a resource group. /// + /// + /// Gets all the stats from an express route circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -245,13 +247,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all stats from an express route circuit in a resource group. /// + /// + /// Gets all stats from an express route circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -273,13 +276,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the express route circuits in a resource group. /// + /// + /// Gets all the express route circuits in a resource group. + /// /// /// The name of the resource group. /// @@ -295,13 +299,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the express route circuits in a subscription. /// + /// + /// Gets all the express route circuits in a subscription. + /// /// /// The headers that will be added to request. /// @@ -314,13 +319,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified express route circuit. /// + /// + /// Deletes the specified express route circuit. + /// /// /// The name of the resource group. /// @@ -336,13 +342,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an express route circuit. /// + /// + /// Creates or updates an express route circuit. + /// /// /// The name of the resource group. /// @@ -365,14 +372,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised ARP table associated with the express - /// route circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -397,14 +406,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised routes table associated with the - /// express route circuit in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -429,14 +440,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised routes table summary associated with - /// the express route circuit in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// /// /// The name of the resource group. /// @@ -461,13 +474,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the express route circuits in a resource group. /// + /// + /// Gets all the express route circuits in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -483,13 +497,14 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the express route circuits in a subscription. /// + /// + /// Gets all the express route circuits in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -505,9 +520,7 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteConnectionsOperations.cs index 5542e4d11ddc..8394e4780bf3 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteConnectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteConnectionsOperations { /// - /// Creates a connection between an ExpressRoute gateway and an - /// ExpressRoute circuit. + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. /// + /// + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. + /// /// /// The name of the resource group. /// @@ -51,13 +45,14 @@ public partial interface IExpressRouteConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified ExpressRouteConnection. /// + /// + /// Gets the specified ExpressRouteConnection. + /// /// /// The name of the resource group. /// @@ -79,13 +74,14 @@ public partial interface IExpressRouteConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a connection to a ExpressRoute circuit. /// + /// + /// Deletes a connection to a ExpressRoute circuit. + /// /// /// The name of the resource group. /// @@ -104,13 +100,14 @@ public partial interface IExpressRouteConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists ExpressRouteConnections. /// + /// + /// Lists ExpressRouteConnections. + /// /// /// The name of the resource group. /// @@ -129,14 +126,16 @@ public partial interface IExpressRouteConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a connection between an ExpressRoute gateway and an - /// ExpressRoute circuit. + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. /// + /// + /// Creates a connection between an ExpressRoute gateway and an ExpressRoute + /// circuit. + /// /// /// The name of the resource group. /// @@ -161,13 +160,14 @@ public partial interface IExpressRouteConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, ExpressRouteConnection putExpressRouteConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a connection to a ExpressRoute circuit. /// + /// + /// Deletes a connection to a ExpressRoute circuit. + /// /// /// The name of the resource group. /// @@ -186,9 +186,7 @@ public partial interface IExpressRouteConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs index d52ca3ae64c6..d78983e93588 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCrossConnectionPeeringsOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Gets all peerings in a specified ExpressRouteCrossConnection. /// + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified peering from the ExpressRouteCrossConnection. /// + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified peering for the ExpressRouteCrossConnection. /// + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -97,14 +92,14 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a peering in the specified - /// ExpressRouteCrossConnection. + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. /// + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -115,8 +110,8 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create or update - /// ExpressRouteCrossConnection peering operation. + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. /// /// /// The headers that will be added to request. @@ -130,13 +125,14 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified peering from the ExpressRouteCrossConnection. /// + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -155,14 +151,14 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a peering in the specified - /// ExpressRouteCrossConnection. + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. /// + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -173,8 +169,8 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create or update - /// ExpressRouteCrossConnection peering operation. + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. /// /// /// The headers that will be added to request. @@ -188,13 +184,14 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all peerings in a specified ExpressRouteCrossConnection. /// + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +207,7 @@ public partial interface IExpressRouteCrossConnectionPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionsOperations.cs index fe3c7278fe27..0484a952a2c0 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteCrossConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteCrossConnectionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Retrieves all the ExpressRouteCrossConnections in a subscription. /// + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all the ExpressRouteCrossConnections in a resource group. /// + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// /// /// The name of the resource group. /// @@ -60,19 +54,19 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets details about the specified ExpressRouteCrossConnection. /// + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// /// /// The name of the resource group (peering location of the circuit). /// /// - /// The name of the ExpressRouteCrossConnection (service key of the - /// circuit). + /// The name of the ExpressRouteCrossConnection (service key of the circuit). /// /// /// The headers that will be added to request. @@ -86,13 +80,14 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update the specified ExpressRouteCrossConnection. /// + /// + /// Update the specified ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -100,8 +95,7 @@ public partial interface IExpressRouteCrossConnectionsOperations /// The name of the ExpressRouteCrossConnection. /// /// - /// Parameters supplied to the update express route crossConnection - /// operation. + /// Parameters supplied to the update express route crossConnection operation. /// /// /// The headers that will be added to request. @@ -115,13 +109,14 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates an express route cross connection tags. /// + /// + /// Updates an express route cross connection tags. + /// /// /// The name of the resource group. /// @@ -143,14 +138,16 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised ARP table associated with the express - /// route cross connection in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. /// + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// /// /// The name of the resource group. /// @@ -175,14 +172,16 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the route table summary associated with the express route - /// cross connection in a resource group. + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. /// + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// /// /// The name of the resource group. /// @@ -207,14 +206,16 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised routes table associated with the - /// express route cross connection in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. /// + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// /// /// The name of the resource group. /// @@ -239,13 +240,14 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update the specified ExpressRouteCrossConnection. /// + /// + /// Update the specified ExpressRouteCrossConnection. + /// /// /// The name of the resource group. /// @@ -253,8 +255,7 @@ public partial interface IExpressRouteCrossConnectionsOperations /// The name of the ExpressRouteCrossConnection. /// /// - /// Parameters supplied to the update express route crossConnection - /// operation. + /// Parameters supplied to the update express route crossConnection operation. /// /// /// The headers that will be added to request. @@ -268,14 +269,16 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised ARP table associated with the express - /// route cross connection in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. /// + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// /// /// The name of the resource group. /// @@ -300,14 +303,16 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the route table summary associated with the express route - /// cross connection in a resource group. + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. /// + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// /// /// The name of the resource group. /// @@ -332,14 +337,16 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the currently advertised routes table associated with the - /// express route cross connection in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. /// + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// /// /// The name of the resource group. /// @@ -364,13 +371,14 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all the ExpressRouteCrossConnections in a subscription. /// + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -386,13 +394,14 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all the ExpressRouteCrossConnections in a resource group. /// + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -408,9 +417,7 @@ public partial interface IExpressRouteCrossConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteGatewaysOperations.cs index 4e4c295b4831..7da9bad355ad 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteGatewaysOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRouteGatewaysOperations /// /// Lists ExpressRoute gateways under a given subscription. /// + /// + /// Lists ExpressRoute gateways under a given subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists ExpressRoute gateways in a given resource group. /// + /// + /// Lists ExpressRoute gateways in a given resource group. + /// /// /// The name of the resource group. /// @@ -60,14 +54,14 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a ExpressRoute gateway in a specified resource - /// group. + /// Creates or updates a ExpressRoute gateway in a specified resource group. /// + /// + /// Creates or updates a ExpressRoute gateway in a specified resource group. + /// /// /// The name of the resource group. /// @@ -89,13 +83,14 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates express route gateway tags. /// + /// + /// Updates express route gateway tags. + /// /// /// The resource group name of the ExpressRouteGateway. /// @@ -103,8 +98,7 @@ public partial interface IExpressRouteGatewaysOperations /// The name of the gateway. /// /// - /// Parameters supplied to update a virtual wan express route gateway - /// tags. + /// Parameters supplied to update a virtual wan express route gateway tags. /// /// /// The headers that will be added to request. @@ -118,13 +112,14 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Fetches the details of a ExpressRoute gateway in a resource group. /// + /// + /// Fetches the details of a ExpressRoute gateway in a resource group. + /// /// /// The name of the resource group. /// @@ -143,15 +138,18 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified ExpressRoute gateway in a resource group. An /// ExpressRoute gateway resource can only be deleted when there are no /// connection subresources. /// + /// + /// Deletes the specified ExpressRoute gateway in a resource group. An + /// ExpressRoute gateway resource can only be deleted when there are no + /// connection subresources. + /// /// /// The name of the resource group. /// @@ -167,14 +165,14 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a ExpressRoute gateway in a specified resource - /// group. + /// Creates or updates a ExpressRoute gateway in a specified resource group. /// + /// + /// Creates or updates a ExpressRoute gateway in a specified resource group. + /// /// /// The name of the resource group. /// @@ -196,13 +194,14 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway putExpressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates express route gateway tags. /// + /// + /// Updates express route gateway tags. + /// /// /// The resource group name of the ExpressRouteGateway. /// @@ -210,8 +209,7 @@ public partial interface IExpressRouteGatewaysOperations /// The name of the gateway. /// /// - /// Parameters supplied to update a virtual wan express route gateway - /// tags. + /// Parameters supplied to update a virtual wan express route gateway tags. /// /// /// The headers that will be added to request. @@ -225,15 +223,18 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, TagsObject expressRouteGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified ExpressRoute gateway in a resource group. An /// ExpressRoute gateway resource can only be deleted when there are no /// connection subresources. /// + /// + /// Deletes the specified ExpressRoute gateway in a resource group. An + /// ExpressRoute gateway resource can only be deleted when there are no + /// connection subresources. + /// /// /// The name of the resource group. /// @@ -249,9 +250,7 @@ public partial interface IExpressRouteGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRouteGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteLinksOperations.cs index 090173d7d0f0..c75f84428784 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteLinksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteLinksOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRouteLinksOperations /// /// Retrieves the specified ExpressRouteLink resource. /// + /// + /// Retrieves the specified ExpressRouteLink resource. + /// /// /// The name of the resource group. /// @@ -47,14 +40,16 @@ public partial interface IExpressRouteLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string linkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string linkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieve the ExpressRouteLink sub-resources of the specified /// ExpressRoutePort resource. /// + /// + /// Retrieve the ExpressRouteLink sub-resources of the specified + /// ExpressRoutePort resource. + /// /// /// The name of the resource group. /// @@ -73,14 +68,16 @@ public partial interface IExpressRouteLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieve the ExpressRouteLink sub-resources of the specified /// ExpressRoutePort resource. /// + /// + /// Retrieve the ExpressRouteLink sub-resources of the specified + /// ExpressRoutePort resource. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -96,9 +93,7 @@ public partial interface IExpressRouteLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortAuthorizationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortAuthorizationsOperations.cs index 95e1a287e8b2..affc9fe9bb94 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortAuthorizationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortAuthorizationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRoutePortAuthorizationsOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRoutePortAuthorizationsOperations { /// - /// Deletes the specified authorization from the specified express - /// route port. + /// Deletes the specified authorization from the specified express route port. /// + /// + /// Deletes the specified authorization from the specified express route port. + /// /// /// The name of the resource group. /// @@ -45,14 +37,14 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the specified authorization from the specified express route - /// port. + /// Gets the specified authorization from the specified express route port. /// + /// + /// Gets the specified authorization from the specified express route port. + /// /// /// The name of the resource group. /// @@ -74,14 +66,14 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an authorization in the specified express route - /// port. + /// Creates or updates an authorization in the specified express route port. /// + /// + /// Creates or updates an authorization in the specified express route port. + /// /// /// The name of the resource group. /// @@ -107,13 +99,14 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all authorizations in an express route port. /// + /// + /// Gets all authorizations in an express route port. + /// /// /// The name of the resource group. /// @@ -132,14 +125,14 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes the specified authorization from the specified express - /// route port. + /// Deletes the specified authorization from the specified express route port. /// + /// + /// Deletes the specified authorization from the specified express route port. + /// /// /// The name of the resource group. /// @@ -158,14 +151,14 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an authorization in the specified express route - /// port. + /// Creates or updates an authorization in the specified express route port. /// + /// + /// Creates or updates an authorization in the specified express route port. + /// /// /// The name of the resource group. /// @@ -191,13 +184,14 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, string authorizationName, ExpressRoutePortAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all authorizations in an express route port. /// + /// + /// Gets all authorizations in an express route port. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -213,9 +207,7 @@ public partial interface IExpressRoutePortAuthorizationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsLocationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsLocationsOperations.cs index dd5324351038..f4ee53818a7e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsLocationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsLocationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRoutePortsLocationsOperations operations. @@ -24,10 +14,15 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRoutePortsLocationsOperations { /// - /// Retrieves all ExpressRoutePort peering locations. Does not return - /// available bandwidths for each location. Available bandwidths can - /// only be obtained when retrieving a specific peering location. + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. /// + /// + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. + /// /// /// The headers that will be added to request. /// @@ -40,14 +35,16 @@ public partial interface IExpressRoutePortsLocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a single ExpressRoutePort peering location, including the - /// list of available bandwidths available at said peering location. + /// Retrieves a single ExpressRoutePort peering location, including the list of + /// available bandwidths available at said peering location. /// + /// + /// Retrieves a single ExpressRoutePort peering location, including the list of + /// available bandwidths available at said peering location. + /// /// /// Name of the requested ExpressRoutePort peering location. /// @@ -63,15 +60,18 @@ public partial interface IExpressRoutePortsLocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string locationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all ExpressRoutePort peering locations. Does not return - /// available bandwidths for each location. Available bandwidths can - /// only be obtained when retrieving a specific peering location. + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. /// + /// + /// Retrieves all ExpressRoutePort peering locations. Does not return available + /// bandwidths for each location. Available bandwidths can only be obtained + /// when retrieving a specific peering location. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -87,9 +87,7 @@ public partial interface IExpressRoutePortsLocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsOperations.cs index f043ed7c5088..3dbad19e3a65 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRoutePortsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRoutePortsOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRoutePortsOperations /// /// Deletes the specified ExpressRoutePort resource. /// + /// + /// Deletes the specified ExpressRoutePort resource. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the requested ExpressRoutePort resource. /// + /// + /// Retrieves the requested ExpressRoutePort resource. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified ExpressRoutePort resource. /// + /// + /// Creates or updates the specified ExpressRoutePort resource. + /// /// /// The name of the resource group. /// @@ -94,13 +89,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update ExpressRoutePort tags. /// + /// + /// Update ExpressRoutePort tags. + /// /// /// The name of the resource group. /// @@ -122,14 +118,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all the ExpressRoutePort resources in the specified resource - /// group. + /// List all the ExpressRoutePort resources in the specified resource group. /// + /// + /// List all the ExpressRoutePort resources in the specified resource group. + /// /// /// The name of the resource group. /// @@ -145,14 +141,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all the ExpressRoutePort resources in the specified - /// subscription. + /// List all the ExpressRoutePort resources in the specified subscription. /// + /// + /// List all the ExpressRoutePort resources in the specified subscription. + /// /// /// The headers that will be added to request. /// @@ -165,14 +161,16 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generate a letter of authorization for the requested - /// ExpressRoutePort resource. + /// Generate a letter of authorization for the requested ExpressRoutePort + /// resource. /// + /// + /// Generate a letter of authorization for the requested ExpressRoutePort + /// resource. + /// /// /// The name of the resource group. /// @@ -194,13 +192,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateLOAWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GenerateLOAWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, GenerateExpressRoutePortsLOARequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified ExpressRoutePort resource. /// + /// + /// Deletes the specified ExpressRoutePort resource. + /// /// /// The name of the resource group. /// @@ -216,13 +215,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified ExpressRoutePort resource. /// + /// + /// Creates or updates the specified ExpressRoutePort resource. + /// /// /// The name of the resource group. /// @@ -244,14 +244,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all the ExpressRoutePort resources in the specified resource - /// group. + /// List all the ExpressRoutePort resources in the specified resource group. /// + /// + /// List all the ExpressRoutePort resources in the specified resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -267,14 +267,14 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all the ExpressRoutePort resources in the specified - /// subscription. + /// List all the ExpressRoutePort resources in the specified subscription. /// + /// + /// List all the ExpressRoutePort resources in the specified subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -290,9 +290,7 @@ public partial interface IExpressRoutePortsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteProviderPortsLocationOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteProviderPortsLocationOperations.cs index b6d575312a0f..4d04144d6e96 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteProviderPortsLocationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteProviderPortsLocationOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteProviderPortsLocationOperations operations. @@ -26,9 +16,12 @@ public partial interface IExpressRouteProviderPortsLocationOperations /// /// Retrieves all the ExpressRouteProviderPorts in a subscription. /// + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// /// /// The filter to apply on the operation. For example, you can use - /// $filter=location eq '{state}'. + /// $filter=location eq '{state}'. /// /// /// The headers that will be added to request. @@ -42,9 +35,7 @@ public partial interface IExpressRouteProviderPortsLocationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IExpressRouteServiceProvidersOperations.cs b/src/Network/Network.Management.Sdk/Generated/IExpressRouteServiceProvidersOperations.cs index ba1e3c67b31f..a69e709957b2 100644 --- a/src/Network/Network.Management.Sdk/Generated/IExpressRouteServiceProvidersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IExpressRouteServiceProvidersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ExpressRouteServiceProvidersOperations operations. @@ -26,6 +16,9 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// Gets all the available express route service providers. /// + /// + /// Gets all the available express route service providers. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the available express route service providers. /// + /// + /// Gets all the available express route service providers. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IFirewallPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IFirewallPoliciesOperations.cs index e353cdd888b3..b1fb8ac677a3 100644 --- a/src/Network/Network.Management.Sdk/Generated/IFirewallPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IFirewallPoliciesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPoliciesOperations operations. @@ -26,6 +16,9 @@ public partial interface IFirewallPoliciesOperations /// /// Deletes the specified Firewall Policy. /// + /// + /// Deletes the specified Firewall Policy. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Firewall Policy. /// + /// + /// Gets the specified Firewall Policy. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Firewall Policy. /// + /// + /// Creates or updates the specified Firewall Policy. + /// /// /// The name of the resource group. /// @@ -83,8 +78,7 @@ public partial interface IFirewallPoliciesOperations /// The name of the Firewall Policy. /// /// - /// Parameters supplied to the create or update Firewall Policy - /// operation. + /// Parameters supplied to the create or update Firewall Policy operation. /// /// /// The headers that will be added to request. @@ -98,13 +92,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of a Azure Firewall Policy resource. /// + /// + /// Updates tags of a Azure Firewall Policy resource. + /// /// /// The name of the resource group. /// @@ -126,13 +121,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Firewall Policies in a resource group. /// + /// + /// Lists all Firewall Policies in a resource group. + /// /// /// The name of the resource group. /// @@ -148,13 +144,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Firewall Policies in a subscription. /// + /// + /// Gets all the Firewall Policies in a subscription. + /// /// /// The headers that will be added to request. /// @@ -167,13 +164,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Firewall Policy. /// + /// + /// Deletes the specified Firewall Policy. + /// /// /// The name of the resource group. /// @@ -189,13 +187,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Firewall Policy. /// + /// + /// Creates or updates the specified Firewall Policy. + /// /// /// The name of the resource group. /// @@ -203,8 +202,7 @@ public partial interface IFirewallPoliciesOperations /// The name of the Firewall Policy. /// /// - /// Parameters supplied to the create or update Firewall Policy - /// operation. + /// Parameters supplied to the create or update Firewall Policy operation. /// /// /// The headers that will be added to request. @@ -218,13 +216,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, FirewallPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Firewall Policies in a resource group. /// + /// + /// Lists all Firewall Policies in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -240,13 +239,14 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Firewall Policies in a subscription. /// + /// + /// Gets all the Firewall Policies in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -262,9 +262,7 @@ public partial interface IFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesFilterValuesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesFilterValuesOperations.cs index 8d907f2f8689..69338fc8871d 100644 --- a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesFilterValuesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesFilterValuesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyIdpsSignaturesFilterValuesOperations operations. @@ -26,14 +16,18 @@ public partial interface IFirewallPolicyIdpsSignaturesFilterValuesOperations /// /// Retrieves the current filter values for the signatures overrides /// - /// - /// + /// + /// Retrieves the current filter values for the signatures overrides + /// /// /// The name of the resource group. /// /// /// The name of the Firewall Policy. /// + /// + /// + /// /// /// The headers that will be added to request. /// @@ -46,9 +40,7 @@ public partial interface IFirewallPolicyIdpsSignaturesFilterValuesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(SignatureOverridesFilterValuesQuery parameters, string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOperations.cs index f2bfabfff79f..f6d0052796b1 100644 --- a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyIdpsSignaturesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IFirewallPolicyIdpsSignaturesOperations { /// - /// Retrieves the current status of IDPS signatures for the relevant - /// policy. Maximal amount of returned signatures is 1000. + /// Retrieves the current status of IDPS signatures for the relevant policy. + /// Maximal amount of returned signatures is 1000. /// + /// + /// Retrieves the current status of IDPS signatures for the relevant policy. + /// Maximal amount of returned signatures is 1000. + /// /// /// The name of the resource group. /// @@ -34,6 +28,7 @@ public partial interface IFirewallPolicyIdpsSignaturesOperations /// The name of the Firewall Policy. /// /// + /// /// /// /// The headers that will be added to request. @@ -47,9 +42,7 @@ public partial interface IFirewallPolicyIdpsSignaturesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, IDPSQueryObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, IdpsQueryObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOverridesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOverridesOperations.cs index 98de42c51bfb..c5d55eb1ef54 100644 --- a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOverridesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyIdpsSignaturesOverridesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyIdpsSignaturesOverridesOperations operations. @@ -24,17 +14,20 @@ namespace Microsoft.Azure.Management.Network public partial interface IFirewallPolicyIdpsSignaturesOverridesOperations { /// - /// Will update the status of policy's signature overrides for IDPS + /// Will update the status of policy's signature overrides for IDPS /// - /// - /// Will contain all properties of the object to put - /// + /// + /// Will update the status of policy's signature overrides for IDPS + /// /// /// The name of the resource group. /// /// /// The name of the Firewall Policy. /// + /// + /// Will contain all properties of the object to put + /// /// /// The headers that will be added to request. /// @@ -47,23 +40,23 @@ public partial interface IFirewallPolicyIdpsSignaturesOverridesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PatchWithHttpMessagesAsync(SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Will override/create a new signature overrides for the policy's - /// IDPS + /// Will override/create a new signature overrides for the policy's IDPS /// - /// - /// Will contain all properties of the object to put - /// + /// + /// Will override/create a new signature overrides for the policy's IDPS + /// /// /// The name of the resource group. /// /// /// The name of the Firewall Policy. /// + /// + /// Will contain all properties of the object to put + /// /// /// The headers that will be added to request. /// @@ -76,13 +69,14 @@ public partial interface IFirewallPolicyIdpsSignaturesOverridesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PutWithHttpMessagesAsync(SignaturesOverrides parameters, string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, SignaturesOverrides parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Returns all signatures overrides for a specific policy. /// + /// + /// Returns all signatures overrides for a specific policy. + /// /// /// The name of the resource group. /// @@ -101,14 +95,16 @@ public partial interface IFirewallPolicyIdpsSignaturesOverridesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all signatures overrides objects for a specific policy as a - /// list containing a single value. + /// Returns all signatures overrides objects for a specific policy as a list + /// containing a single value. /// + /// + /// Returns all signatures overrides objects for a specific policy as a list + /// containing a single value. + /// /// /// The name of the resource group. /// @@ -127,9 +123,7 @@ public partial interface IFirewallPolicyIdpsSignaturesOverridesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyRuleCollectionGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyRuleCollectionGroupsOperations.cs index 040d59a1855d..cc27a506f2b4 100644 --- a/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyRuleCollectionGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IFirewallPolicyRuleCollectionGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FirewallPolicyRuleCollectionGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Deletes the specified FirewallPolicyRuleCollectionGroup. /// + /// + /// Deletes the specified FirewallPolicyRuleCollectionGroup. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified FirewallPolicyRuleCollectionGroup. /// + /// + /// Gets the specified FirewallPolicyRuleCollectionGroup. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. /// + /// + /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. + /// /// /// The name of the resource group. /// @@ -104,14 +99,14 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy - /// resource. + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. /// + /// + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + /// /// /// The name of the resource group. /// @@ -130,13 +125,14 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified FirewallPolicyRuleCollectionGroup. /// + /// + /// Deletes the specified FirewallPolicyRuleCollectionGroup. + /// /// /// The name of the resource group. /// @@ -155,13 +151,14 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. /// + /// + /// Creates or updates the specified FirewallPolicyRuleCollectionGroup. + /// /// /// The name of the resource group. /// @@ -187,14 +184,14 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string ruleCollectionGroupName, FirewallPolicyRuleCollectionGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy - /// resource. + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. /// + /// + /// Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +207,7 @@ public partial interface IFirewallPolicyRuleCollectionGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IFlowLogsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IFlowLogsOperations.cs index 897371652185..ead9c3b21bf9 100644 --- a/src/Network/Network.Management.Sdk/Generated/IFlowLogsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IFlowLogsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FlowLogsOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface IFlowLogsOperations { /// - /// Create or update a flow log for the specified network security - /// group. + /// Create or update a flow log for the specified network security group. /// + /// + /// Create or update a flow log for the specified network security group. + /// /// /// The name of the resource group. /// @@ -45,19 +37,20 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update tags of the specified flow log. /// + /// + /// Update tags of the specified flow log. + /// /// /// The name of the resource group. /// @@ -76,19 +69,20 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a flow log resource by name. /// + /// + /// Gets a flow log resource by name. + /// /// /// The name of the resource group. /// @@ -104,19 +98,20 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified flow log resource. /// + /// + /// Deletes the specified flow log resource. + /// /// /// The name of the resource group. /// @@ -132,16 +127,17 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all flow log resources for the specified Network Watcher. /// + /// + /// Lists all flow log resources for the specified Network Watcher. + /// /// /// The name of the resource group containing Network Watcher. /// @@ -154,20 +150,20 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or update a flow log for the specified network security - /// group. + /// Create or update a flow log for the specified network security group. /// + /// + /// Create or update a flow log for the specified network security group. + /// /// /// The name of the resource group. /// @@ -186,19 +182,20 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, FlowLog parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified flow log resource. /// + /// + /// Deletes the specified flow log resource. + /// /// /// The name of the resource group. /// @@ -214,16 +211,17 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string flowLogName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all flow log resources for the specified Network Watcher. /// + /// + /// Lists all flow log resources for the specified Network Watcher. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -233,15 +231,13 @@ public partial interface IFlowLogsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IHubRouteTablesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IHubRouteTablesOperations.cs index 320976cb373d..1c4ccb70ffce 100644 --- a/src/Network/Network.Management.Sdk/Generated/IHubRouteTablesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IHubRouteTablesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// HubRouteTablesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IHubRouteTablesOperations { /// - /// Creates a RouteTable resource if it doesn't exist else updates the - /// existing RouteTable. + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. /// + /// + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. + /// /// /// The resource group name of the VirtualHub. /// @@ -51,13 +45,14 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of a RouteTable. /// + /// + /// Retrieves the details of a RouteTable. + /// /// /// The resource group name of the VirtualHub. /// @@ -79,13 +74,14 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a RouteTable. /// + /// + /// Deletes a RouteTable. + /// /// /// The resource group name of the RouteTable. /// @@ -104,13 +100,14 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all RouteTables. /// + /// + /// Retrieves the details of all RouteTables. + /// /// /// The resource group name of the VirtualHub. /// @@ -129,14 +126,16 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a RouteTable resource if it doesn't exist else updates the - /// existing RouteTable. + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. /// + /// + /// Creates a RouteTable resource if it doesn't exist else updates the existing + /// RouteTable. + /// /// /// The resource group name of the VirtualHub. /// @@ -161,13 +160,14 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a RouteTable. /// + /// + /// Deletes a RouteTable. + /// /// /// The resource group name of the RouteTable. /// @@ -186,13 +186,14 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all RouteTables. /// + /// + /// Retrieves the details of all RouteTables. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +209,7 @@ public partial interface IHubRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IHubVirtualNetworkConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IHubVirtualNetworkConnectionsOperations.cs index 336f86340887..bf1069756804 100644 --- a/src/Network/Network.Management.Sdk/Generated/IHubVirtualNetworkConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IHubVirtualNetworkConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// HubVirtualNetworkConnectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IHubVirtualNetworkConnectionsOperations { /// - /// Creates a hub virtual network connection if it doesn't exist else - /// updates the existing one. + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. /// + /// + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. + /// /// /// The resource group name of the HubVirtualNetworkConnection. /// @@ -37,8 +31,7 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// The name of the HubVirtualNetworkConnection. /// /// - /// Parameters supplied to create or update a hub virtual network - /// connection. + /// Parameters supplied to create or update a hub virtual network connection. /// /// /// The headers that will be added to request. @@ -52,13 +45,14 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a HubVirtualNetworkConnection. /// + /// + /// Deletes a HubVirtualNetworkConnection. + /// /// /// The resource group name of the VirtualHub. /// @@ -77,13 +71,14 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of a HubVirtualNetworkConnection. /// + /// + /// Retrieves the details of a HubVirtualNetworkConnection. + /// /// /// The resource group name of the VirtualHub. /// @@ -105,13 +100,14 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all HubVirtualNetworkConnections. /// + /// + /// Retrieves the details of all HubVirtualNetworkConnections. + /// /// /// The resource group name of the VirtualHub. /// @@ -130,14 +126,16 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a hub virtual network connection if it doesn't exist else - /// updates the existing one. + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. /// + /// + /// Creates a hub virtual network connection if it doesn't exist else updates + /// the existing one. + /// /// /// The resource group name of the HubVirtualNetworkConnection. /// @@ -148,8 +146,7 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// The name of the HubVirtualNetworkConnection. /// /// - /// Parameters supplied to create or update a hub virtual network - /// connection. + /// Parameters supplied to create or update a hub virtual network connection. /// /// /// The headers that will be added to request. @@ -163,13 +160,14 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, HubVirtualNetworkConnection hubVirtualNetworkConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a HubVirtualNetworkConnection. /// + /// + /// Deletes a HubVirtualNetworkConnection. + /// /// /// The resource group name of the VirtualHub. /// @@ -188,13 +186,14 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all HubVirtualNetworkConnections. /// + /// + /// Retrieves the details of all HubVirtualNetworkConnections. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +209,7 @@ public partial interface IHubVirtualNetworkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IInboundNatRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IInboundNatRulesOperations.cs index 52e4fb97a766..2e573abf5a2c 100644 --- a/src/Network/Network.Management.Sdk/Generated/IInboundNatRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IInboundNatRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// InboundNatRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface IInboundNatRulesOperations /// /// Gets all the inbound NAT rules in a load balancer. /// + /// + /// Gets all the inbound NAT rules in a load balancer. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified load balancer inbound NAT rule. /// + /// + /// Deletes the specified load balancer inbound NAT rule. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified load balancer inbound NAT rule. /// + /// + /// Gets the specified load balancer inbound NAT rule. + /// /// /// The name of the resource group. /// @@ -100,13 +95,14 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a load balancer inbound NAT rule. /// + /// + /// Creates or updates a load balancer inbound NAT rule. + /// /// /// The name of the resource group. /// @@ -117,8 +113,7 @@ public partial interface IInboundNatRulesOperations /// The name of the inbound NAT rule. /// /// - /// Parameters supplied to the create or update inbound NAT rule - /// operation. + /// Parameters supplied to the create or update inbound NAT rule operation. /// /// /// The headers that will be added to request. @@ -132,13 +127,14 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified load balancer inbound NAT rule. /// + /// + /// Deletes the specified load balancer inbound NAT rule. + /// /// /// The name of the resource group. /// @@ -157,13 +153,14 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a load balancer inbound NAT rule. /// + /// + /// Creates or updates a load balancer inbound NAT rule. + /// /// /// The name of the resource group. /// @@ -174,8 +171,7 @@ public partial interface IInboundNatRulesOperations /// The name of the inbound NAT rule. /// /// - /// Parameters supplied to the create or update inbound NAT rule - /// operation. + /// Parameters supplied to the create or update inbound NAT rule operation. /// /// /// The headers that will be added to request. @@ -189,13 +185,14 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the inbound NAT rules in a load balancer. /// + /// + /// Gets all the inbound NAT rules in a load balancer. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -211,9 +208,7 @@ public partial interface IInboundNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IInboundSecurityRuleOperations.cs b/src/Network/Network.Management.Sdk/Generated/IInboundSecurityRuleOperations.cs index dacb7f8e235e..d7dfc532d3cc 100644 --- a/src/Network/Network.Management.Sdk/Generated/IInboundSecurityRuleOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IInboundSecurityRuleOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// InboundSecurityRuleOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IInboundSecurityRuleOperations { /// - /// Creates or updates the specified Network Virtual Appliance Inbound - /// Security Rules. + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. /// + /// + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. + /// /// /// The name of the resource group. /// @@ -37,8 +31,8 @@ public partial interface IInboundSecurityRuleOperations /// The name of security rule collection. /// /// - /// Parameters supplied to the create or update Network Virtual - /// Appliance Inbound Security Rules operation. + /// Parameters supplied to the create or update Network Virtual Appliance + /// Inbound Security Rules operation. /// /// /// The headers that will be added to request. @@ -52,14 +46,16 @@ public partial interface IInboundSecurityRuleOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates the specified Network Virtual Appliance Inbound - /// Security Rules. + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. /// + /// + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. + /// /// /// The name of the resource group. /// @@ -70,8 +66,8 @@ public partial interface IInboundSecurityRuleOperations /// The name of security rule collection. /// /// - /// Parameters supplied to the create or update Network Virtual - /// Appliance Inbound Security Rules operation. + /// Parameters supplied to the create or update Network Virtual Appliance + /// Inbound Security Rules operation. /// /// /// The headers that will be added to request. @@ -85,9 +81,7 @@ public partial interface IInboundSecurityRuleOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IIpAllocationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IIpAllocationsOperations.cs index 860951aab485..1dff0c1c94f1 100644 --- a/src/Network/Network.Management.Sdk/Generated/IIpAllocationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IIpAllocationsOperations.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// IpAllocationsOperations operations. + /// IPAllocationsOperations operations. /// - public partial interface IIpAllocationsOperations + public partial interface IIPAllocationsOperations { /// /// Deletes the specified IpAllocation. /// + /// + /// Deletes the specified IpAllocation. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified IpAllocation by resource group. /// + /// + /// Gets the specified IpAllocation by resource group. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an IpAllocation in the specified resource group. /// + /// + /// Creates or updates an IpAllocation in the specified resource group. + /// /// /// The name of the resource group. /// @@ -83,8 +78,7 @@ public partial interface IIpAllocationsOperations /// The name of the IpAllocation. /// /// - /// Parameters supplied to the create or update virtual network - /// operation. + /// Parameters supplied to the create or update virtual network operation. /// /// /// The headers that will be added to request. @@ -98,13 +92,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a IpAllocation tags. /// + /// + /// Updates a IpAllocation tags. + /// /// /// The name of the resource group. /// @@ -126,13 +121,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpAllocations in a subscription. /// + /// + /// Gets all IpAllocations in a subscription. + /// /// /// The headers that will be added to request. /// @@ -145,13 +141,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpAllocations in a resource group. /// + /// + /// Gets all IpAllocations in a resource group. + /// /// /// The name of the resource group. /// @@ -167,13 +164,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified IpAllocation. /// + /// + /// Deletes the specified IpAllocation. + /// /// /// The name of the resource group. /// @@ -189,13 +187,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an IpAllocation in the specified resource group. /// + /// + /// Creates or updates an IpAllocation in the specified resource group. + /// /// /// The name of the resource group. /// @@ -203,8 +202,7 @@ public partial interface IIpAllocationsOperations /// The name of the IpAllocation. /// /// - /// Parameters supplied to the create or update virtual network - /// operation. + /// Parameters supplied to the create or update virtual network operation. /// /// /// The headers that will be added to request. @@ -218,13 +216,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpAllocations in a subscription. /// + /// + /// Gets all IpAllocations in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -240,13 +239,14 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpAllocations in a resource group. /// + /// + /// Gets all IpAllocations in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -262,9 +262,7 @@ public partial interface IIpAllocationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IIpGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IIpGroupsOperations.cs index 333ba6067d72..c6ef50f2deef 100644 --- a/src/Network/Network.Management.Sdk/Generated/IIpGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IIpGroupsOperations.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// IpGroupsOperations operations. + /// IPGroupsOperations operations. /// - public partial interface IIpGroupsOperations + public partial interface IIPGroupsOperations { /// /// Gets the specified ipGroups. /// + /// + /// Gets the specified ipGroups. + /// /// /// The name of the resource group. /// @@ -33,8 +26,8 @@ public partial interface IIpGroupsOperations /// The name of the ipGroups. /// /// - /// Expands resourceIds (of Firewalls/Network Security Groups etc.) - /// back referenced by the IpGroups resource. + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back + /// referenced by the IpGroups resource. /// /// /// The headers that will be added to request. @@ -42,19 +35,20 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an ipGroups in a specified resource group. /// + /// + /// Creates or updates an ipGroups in a specified resource group. + /// /// /// The name of the resource group. /// @@ -70,19 +64,20 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of an IpGroups resource. /// + /// + /// Updates tags of an IpGroups resource. + /// /// /// The name of the resource group. /// @@ -98,19 +93,20 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateGroupsWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateGroupsWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified ipGroups. /// + /// + /// Deletes the specified ipGroups. + /// /// /// The name of the resource group. /// @@ -123,16 +119,17 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpGroups in a resource group. /// + /// + /// Gets all IpGroups in a resource group. + /// /// /// The name of the resource group. /// @@ -142,38 +139,40 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpGroups in a subscription. /// + /// + /// Gets all IpGroups in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates an ipGroups in a specified resource group. /// + /// + /// Creates or updates an ipGroups in a specified resource group. + /// /// /// The name of the resource group. /// @@ -189,19 +188,20 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified ipGroups. /// + /// + /// Deletes the specified ipGroups. + /// /// /// The name of the resource group. /// @@ -214,16 +214,17 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpGroups in a resource group. /// + /// + /// Gets all IpGroups in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -233,19 +234,20 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all IpGroups in a subscription. /// + /// + /// Gets all IpGroups in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -255,15 +257,13 @@ public partial interface IIpGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerBackendAddressPoolsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerBackendAddressPoolsOperations.cs index e97f4cc1bfee..6fdcc3d48783 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerBackendAddressPoolsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerBackendAddressPoolsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerBackendAddressPoolsOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Gets all the load balancer backed address pools. /// + /// + /// Gets all the load balancer backed address pools. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets load balancer backend address pool. /// + /// + /// Gets load balancer backend address pool. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a load balancer backend address pool. /// + /// + /// Creates or updates a load balancer backend address pool. + /// /// /// The name of the resource group. /// @@ -89,8 +84,8 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// The name of the backend address pool. /// /// - /// Parameters supplied to the create or update load balancer backend - /// address pool operation. + /// Parameters supplied to the create or update load balancer backend address + /// pool operation. /// /// /// The headers that will be added to request. @@ -104,13 +99,14 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified load balancer backend address pool. /// + /// + /// Deletes the specified load balancer backend address pool. + /// /// /// The name of the resource group. /// @@ -129,13 +125,14 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a load balancer backend address pool. /// + /// + /// Creates or updates a load balancer backend address pool. + /// /// /// The name of the resource group. /// @@ -146,8 +143,8 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// The name of the backend address pool. /// /// - /// Parameters supplied to the create or update load balancer backend - /// address pool operation. + /// Parameters supplied to the create or update load balancer backend address + /// pool operation. /// /// /// The headers that will be added to request. @@ -161,13 +158,14 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified load balancer backend address pool. /// + /// + /// Deletes the specified load balancer backend address pool. + /// /// /// The name of the resource group. /// @@ -186,13 +184,14 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancer backed address pools. /// + /// + /// Gets all the load balancer backed address pools. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +207,7 @@ public partial interface ILoadBalancerBackendAddressPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerFrontendIPConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerFrontendIPConfigurationsOperations.cs index 6532d01c7e4a..a9c235310f6c 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerFrontendIPConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerFrontendIPConfigurationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerFrontendIPConfigurationsOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancerFrontendIPConfigurationsOperations /// /// Gets all the load balancer frontend IP configurations. /// + /// + /// Gets all the load balancer frontend IP configurations. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ILoadBalancerFrontendIPConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets load balancer frontend IP configuration. /// + /// + /// Gets load balancer frontend IP configuration. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface ILoadBalancerFrontendIPConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancer frontend IP configurations. /// + /// + /// Gets all the load balancer frontend IP configurations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface ILoadBalancerFrontendIPConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerLoadBalancingRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerLoadBalancingRulesOperations.cs index bf988169faeb..382f567b8c2a 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerLoadBalancingRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerLoadBalancingRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerLoadBalancingRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancerLoadBalancingRulesOperations /// /// Gets all the load balancing rules in a load balancer. /// + /// + /// Gets all the load balancing rules in a load balancer. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ILoadBalancerLoadBalancingRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified load balancer load balancing rule. /// + /// + /// Gets the specified load balancer load balancing rule. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface ILoadBalancerLoadBalancingRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string loadBalancingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string loadBalancingRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancing rules in a load balancer. /// + /// + /// Gets all the load balancing rules in a load balancer. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface ILoadBalancerLoadBalancingRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerNetworkInterfacesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerNetworkInterfacesOperations.cs index 3c9fffa349f8..e9aef5e6349e 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerNetworkInterfacesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerNetworkInterfacesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerNetworkInterfacesOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancerNetworkInterfacesOperations /// /// Gets associated load balancer network interfaces. /// + /// + /// Gets associated load balancer network interfaces. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ILoadBalancerNetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets associated load balancer network interfaces. /// + /// + /// Gets associated load balancer network interfaces. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -66,9 +60,7 @@ public partial interface ILoadBalancerNetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerOutboundRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerOutboundRulesOperations.cs index a9cdd2024030..d6e54d612786 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerOutboundRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerOutboundRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerOutboundRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancerOutboundRulesOperations /// /// Gets all the outbound rules in a load balancer. /// + /// + /// Gets all the outbound rules in a load balancer. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ILoadBalancerOutboundRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified load balancer outbound rule. /// + /// + /// Gets the specified load balancer outbound rule. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface ILoadBalancerOutboundRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string outboundRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string outboundRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the outbound rules in a load balancer. /// + /// + /// Gets all the outbound rules in a load balancer. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface ILoadBalancerOutboundRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerProbesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerProbesOperations.cs index a308c386be0c..51951e59e61f 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancerProbesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancerProbesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerProbesOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancerProbesOperations /// /// Gets all the load balancer probes. /// + /// + /// Gets all the load balancer probes. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ILoadBalancerProbesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets load balancer probe. /// + /// + /// Gets load balancer probe. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface ILoadBalancerProbesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string probeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string probeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancer probes. /// + /// + /// Gets all the load balancer probes. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface ILoadBalancerProbesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILoadBalancersOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILoadBalancersOperations.cs index f8830636dcc2..e82c9f70d6c9 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILoadBalancersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILoadBalancersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancersOperations operations. @@ -26,6 +16,9 @@ public partial interface ILoadBalancersOperations /// /// Deletes the specified load balancer. /// + /// + /// Deletes the specified load balancer. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified load balancer. /// + /// + /// Gets the specified load balancer. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a load balancer. /// + /// + /// Creates or updates a load balancer. + /// /// /// The name of the resource group. /// @@ -83,8 +78,7 @@ public partial interface ILoadBalancersOperations /// The name of the load balancer. /// /// - /// Parameters supplied to the create or update load balancer - /// operation. + /// Parameters supplied to the create or update load balancer operation. /// /// /// The headers that will be added to request. @@ -98,13 +92,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a load balancer tags. /// + /// + /// Updates a load balancer tags. + /// /// /// The name of the resource group. /// @@ -126,13 +121,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancers in a subscription. /// + /// + /// Gets all the load balancers in a subscription. + /// /// /// The headers that will be added to request. /// @@ -145,13 +141,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancers in a resource group. /// + /// + /// Gets all the load balancers in a resource group. + /// /// /// The name of the resource group. /// @@ -167,13 +164,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Swaps VIPs between two load balancers. /// + /// + /// Swaps VIPs between two load balancers. + /// /// /// The region where load balancers are located at. /// @@ -189,13 +187,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task SwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task SwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List of inbound NAT rule port mappings. /// + /// + /// List of inbound NAT rule port mappings. + /// /// /// The name of the resource group. /// @@ -220,13 +219,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Migrate load balancer to IP Based /// + /// + /// Migrate load balancer to IP Based + /// /// /// The name of the resource group. /// @@ -248,13 +248,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> MigrateToIpBasedWithHttpMessagesAsync(string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> MigrateToIpBasedWithHttpMessagesAsync(string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified load balancer. /// + /// + /// Deletes the specified load balancer. + /// /// /// The name of the resource group. /// @@ -270,13 +271,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a load balancer. /// + /// + /// Creates or updates a load balancer. + /// /// /// The name of the resource group. /// @@ -284,8 +286,7 @@ public partial interface ILoadBalancersOperations /// The name of the load balancer. /// /// - /// Parameters supplied to the create or update load balancer - /// operation. + /// Parameters supplied to the create or update load balancer operation. /// /// /// The headers that will be added to request. @@ -299,13 +300,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Swaps VIPs between two load balancers. /// + /// + /// Swaps VIPs between two load balancers. + /// /// /// The region where load balancers are located at. /// @@ -321,13 +323,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List of inbound NAT rule port mappings. /// + /// + /// List of inbound NAT rule port mappings. + /// /// /// The name of the resource group. /// @@ -352,13 +355,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancers in a subscription. /// + /// + /// Gets all the load balancers in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -374,13 +378,14 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the load balancers in a resource group. /// + /// + /// Gets all the load balancers in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -396,9 +401,7 @@ public partial interface ILoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ILocalNetworkGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/ILocalNetworkGatewaysOperations.cs index 43f65ce03ce9..917103eef1e0 100644 --- a/src/Network/Network.Management.Sdk/Generated/ILocalNetworkGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ILocalNetworkGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LocalNetworkGatewaysOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface ILocalNetworkGatewaysOperations { /// - /// Creates or updates a local network gateway in the specified - /// resource group. + /// Creates or updates a local network gateway in the specified resource group. /// + /// + /// Creates or updates a local network gateway in the specified resource group. + /// /// /// The name of the resource group. /// @@ -49,13 +41,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified local network gateway in a resource group. /// + /// + /// Gets the specified local network gateway in a resource group. + /// /// /// The name of the resource group. /// @@ -74,13 +67,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified local network gateway. /// + /// + /// Deletes the specified local network gateway. + /// /// /// The name of the resource group. /// @@ -96,13 +90,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a local network gateway tags. /// + /// + /// Updates a local network gateway tags. + /// /// /// The name of the resource group. /// @@ -124,13 +119,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the local network gateways in a resource group. /// + /// + /// Gets all the local network gateways in a resource group. + /// /// /// The name of the resource group. /// @@ -146,14 +142,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a local network gateway in the specified - /// resource group. + /// Creates or updates a local network gateway in the specified resource group. /// + /// + /// Creates or updates a local network gateway in the specified resource group. + /// /// /// The name of the resource group. /// @@ -176,13 +172,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified local network gateway. /// + /// + /// Deletes the specified local network gateway. + /// /// /// The name of the resource group. /// @@ -198,13 +195,14 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the local network gateways in a resource group. /// + /// + /// Gets all the local network gateways in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -220,9 +218,7 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs index 47f90fdc8292..a3f7160cd459 100644 --- a/src/Network/Network.Management.Sdk/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ManagementGroupNetworkManagerConnectionsOperations operations. @@ -26,9 +16,9 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Create a network manager connection on this management group. /// - /// - /// Network manager connection to be created/updated. - /// + /// + /// Create a network manager connection on this management group. + /// /// /// The management group Id which uniquely identify the Microsoft Azure /// management group. @@ -36,6 +26,9 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Name for the network manager connection. /// + /// + /// Network manager connection to be created/updated. + /// /// /// The headers that will be added to request. /// @@ -48,13 +41,14 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, NetworkManagerConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a specified connection created by this management group. /// + /// + /// Get a specified connection created by this management group. + /// /// /// The management group Id which uniquely identify the Microsoft Azure /// management group. @@ -74,14 +68,14 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete specified pending connection created by this management - /// group. + /// Delete specified pending connection created by this management group. /// + /// + /// Delete specified pending connection created by this management group. + /// /// /// The management group Id which uniquely identify the Microsoft Azure /// management group. @@ -98,27 +92,27 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all network manager connections created by this management - /// group. + /// List all network manager connections created by this management group. /// + /// + /// List all network manager connections created by this management group. + /// /// /// The management group Id which uniquely identify the Microsoft Azure /// management group. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -132,14 +126,14 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string managementGroupId, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string managementGroupId, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all network manager connections created by this management - /// group. + /// List all network manager connections created by this management group. /// + /// + /// List all network manager connections created by this management group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -155,9 +149,7 @@ public partial interface IManagementGroupNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INatGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/INatGatewaysOperations.cs index 4d7827cf0d44..f6a8c926d1d1 100644 --- a/src/Network/Network.Management.Sdk/Generated/INatGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INatGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NatGatewaysOperations operations. @@ -26,6 +16,9 @@ public partial interface INatGatewaysOperations /// /// Deletes the specified nat gateway. /// + /// + /// Deletes the specified nat gateway. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified nat gateway in a specified resource group. /// + /// + /// Gets the specified nat gateway in a specified resource group. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a nat gateway. /// + /// + /// Creates or updates a nat gateway. + /// /// /// The name of the resource group. /// @@ -97,13 +92,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates nat gateway tags. /// + /// + /// Updates nat gateway tags. + /// /// /// The name of the resource group. /// @@ -125,13 +121,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Nat Gateways in a subscription. /// + /// + /// Gets all the Nat Gateways in a subscription. + /// /// /// The headers that will be added to request. /// @@ -144,13 +141,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all nat gateways in a resource group. /// + /// + /// Gets all nat gateways in a resource group. + /// /// /// The name of the resource group. /// @@ -166,13 +164,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified nat gateway. /// + /// + /// Deletes the specified nat gateway. + /// /// /// The name of the resource group. /// @@ -188,13 +187,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a nat gateway. /// + /// + /// Creates or updates a nat gateway. + /// /// /// The name of the resource group. /// @@ -216,13 +216,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Nat Gateways in a subscription. /// + /// + /// Gets all the Nat Gateways in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -238,13 +239,14 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all nat gateways in a resource group. /// + /// + /// Gets all nat gateways in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -260,9 +262,7 @@ public partial interface INatGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INatRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/INatRulesOperations.cs index 2004e8e31428..1bbac89612ad 100644 --- a/src/Network/Network.Management.Sdk/Generated/INatRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INatRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NatRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface INatRulesOperations /// /// Retrieves the details of a nat ruleGet. /// + /// + /// Retrieves the details of a nat ruleGet. + /// /// /// The resource group name of the VpnGateway. /// @@ -47,14 +40,16 @@ public partial interface INatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist - /// else updates the existing nat rules. + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. /// + /// + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. + /// /// /// The resource group name of the VpnGateway. /// @@ -79,13 +74,14 @@ public partial interface INatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a nat rule. /// + /// + /// Deletes a nat rule. + /// /// /// The resource group name of the VpnGateway. /// @@ -104,13 +100,14 @@ public partial interface INatRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all nat rules for a particular virtual wan vpn gateway. /// + /// + /// Retrieves all nat rules for a particular virtual wan vpn gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -129,14 +126,16 @@ public partial interface INatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist - /// else updates the existing nat rules. + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. /// + /// + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. + /// /// /// The resource group name of the VpnGateway. /// @@ -161,13 +160,14 @@ public partial interface INatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a nat rule. /// + /// + /// Deletes a nat rule. + /// /// /// The resource group name of the VpnGateway. /// @@ -186,13 +186,14 @@ public partial interface INatRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all nat rules for a particular virtual wan vpn gateway. /// + /// + /// Retrieves all nat rules for a particular virtual wan vpn gateway. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +209,7 @@ public partial interface INatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkGroupsOperations.cs index d8ac5f6a7d4d..fe1cb8257cce 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkGroupsOperations /// /// Gets the specified network group. /// + /// + /// Gets the specified network group. + /// /// /// The name of the resource group. /// @@ -47,17 +40,14 @@ public partial interface INetworkGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a network group. /// - /// - /// Parameters supplied to the specify which network group need to - /// create - /// + /// + /// Creates or updates a network group. + /// /// /// The name of the resource group. /// @@ -68,9 +58,12 @@ public partial interface INetworkGroupsOperations /// The name of the network group. /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Parameters supplied to the specify which network group need to create /// /// /// The headers that will be added to request. @@ -84,13 +77,14 @@ public partial interface INetworkGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, NetworkGroup parameters, string ifMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a network group. /// + /// + /// Deletes a network group. + /// /// /// The name of the resource group. /// @@ -101,10 +95,9 @@ public partial interface INetworkGroupsOperations /// The name of the network group. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -115,13 +108,14 @@ public partial interface INetworkGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists the specified network group. /// + /// + /// Lists the specified network group. + /// /// /// The name of the resource group. /// @@ -129,14 +123,14 @@ public partial interface INetworkGroupsOperations /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -150,13 +144,14 @@ public partial interface INetworkGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a network group. /// + /// + /// Deletes a network group. + /// /// /// The name of the resource group. /// @@ -167,10 +162,9 @@ public partial interface INetworkGroupsOperations /// The name of the network group. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -181,13 +175,14 @@ public partial interface INetworkGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists the specified network group. /// + /// + /// Lists the specified network group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -203,9 +198,7 @@ public partial interface INetworkGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceIPConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceIPConfigurationsOperations.cs index 8cc36dcda3a5..706277b61697 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceIPConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceIPConfigurationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfaceIPConfigurationsOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkInterfaceIPConfigurationsOperations /// /// Get all ip configurations in a network interface. /// + /// + /// Get all ip configurations in a network interface. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface INetworkInterfaceIPConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified network interface ip configuration. /// + /// + /// Gets the specified network interface ip configuration. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface INetworkInterfaceIPConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string ipConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all ip configurations in a network interface. /// + /// + /// Get all ip configurations in a network interface. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface INetworkInterfaceIPConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceLoadBalancersOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceLoadBalancersOperations.cs index b2007369246e..e1338dc31669 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceLoadBalancersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceLoadBalancersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfaceLoadBalancersOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkInterfaceLoadBalancersOperations /// /// List all load balancers in a network interface. /// + /// + /// List all load balancers in a network interface. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface INetworkInterfaceLoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all load balancers in a network interface. /// + /// + /// List all load balancers in a network interface. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -66,9 +60,7 @@ public partial interface INetworkInterfaceLoadBalancersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceTapConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceTapConfigurationsOperations.cs index fc28115d1862..505320c94478 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceTapConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkInterfaceTapConfigurationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfaceTapConfigurationsOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Deletes the specified tap configuration from the NetworkInterface. /// + /// + /// Deletes the specified tap configuration from the NetworkInterface. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified tap configuration on a network interface. /// + /// + /// Get the specified tap configuration on a network interface. + /// /// /// The name of the resource group. /// @@ -72,14 +66,14 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a Tap configuration in the specified - /// NetworkInterface. + /// Creates or updates a Tap configuration in the specified NetworkInterface. /// + /// + /// Creates or updates a Tap configuration in the specified NetworkInterface. + /// /// /// The name of the resource group. /// @@ -90,8 +84,7 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// The name of the tap configuration. /// /// - /// Parameters supplied to the create or update tap configuration - /// operation. + /// Parameters supplied to the create or update tap configuration operation. /// /// /// The headers that will be added to request. @@ -105,13 +98,14 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all Tap configurations in a network interface. /// + /// + /// Get all Tap configurations in a network interface. + /// /// /// The name of the resource group. /// @@ -130,13 +124,14 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified tap configuration from the NetworkInterface. /// + /// + /// Deletes the specified tap configuration from the NetworkInterface. + /// /// /// The name of the resource group. /// @@ -155,14 +150,14 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a Tap configuration in the specified - /// NetworkInterface. + /// Creates or updates a Tap configuration in the specified NetworkInterface. /// + /// + /// Creates or updates a Tap configuration in the specified NetworkInterface. + /// /// /// The name of the resource group. /// @@ -173,8 +168,7 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// The name of the tap configuration. /// /// - /// Parameters supplied to the create or update tap configuration - /// operation. + /// Parameters supplied to the create or update tap configuration operation. /// /// /// The headers that will be added to request. @@ -188,13 +182,14 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get all Tap configurations in a network interface. /// + /// + /// Get all Tap configurations in a network interface. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +205,7 @@ public partial interface INetworkInterfaceTapConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkInterfacesOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkInterfacesOperations.cs index 869d291bfb33..39e8bb0a9ef6 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkInterfacesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkInterfacesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfacesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkInterfacesOperations { /// - /// Gets information about all network interfaces in a role instance in - /// a cloud service. + /// Gets information about all network interfaces in a role instance in a cloud + /// service. /// + /// + /// Gets information about all network interfaces in a role instance in a cloud + /// service. + /// /// /// The name of the resource group. /// @@ -48,13 +42,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServiceRoleInstanceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServiceRoleInstanceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a cloud service. /// + /// + /// Gets all network interfaces in a cloud service. + /// /// /// The name of the resource group. /// @@ -73,13 +68,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServiceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServiceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified network interface in a cloud service. /// + /// + /// Get the specified network interface in a cloud service. + /// /// /// The name of the resource group. /// @@ -107,13 +103,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetCloudServiceNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetCloudServiceNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network interface. /// + /// + /// Deletes the specified network interface. + /// /// /// The name of the resource group. /// @@ -129,13 +126,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about the specified network interface. /// + /// + /// Gets information about the specified network interface. + /// /// /// The name of the resource group. /// @@ -157,13 +155,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a network interface. /// + /// + /// Creates or updates a network interface. + /// /// /// The name of the resource group. /// @@ -171,8 +170,7 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create or update network interface - /// operation. + /// Parameters supplied to the create or update network interface operation. /// /// /// The headers that will be added to request. @@ -186,13 +184,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a network interface tags. /// + /// + /// Updates a network interface tags. + /// /// /// The name of the resource group. /// @@ -214,13 +213,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a subscription. /// + /// + /// Gets all network interfaces in a subscription. + /// /// /// The headers that will be added to request. /// @@ -233,13 +233,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a resource group. /// + /// + /// Gets all network interfaces in a resource group. + /// /// /// The name of the resource group. /// @@ -255,13 +256,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route tables applied to a network interface. /// + /// + /// Gets all route tables applied to a network interface. + /// /// /// The name of the resource group. /// @@ -280,13 +282,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network security groups applied to a network interface. /// + /// + /// Gets all network security groups applied to a network interface. + /// /// /// The name of the resource group. /// @@ -305,14 +308,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all network interfaces in a virtual machine - /// in a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// /// /// The name of the resource group. /// @@ -334,13 +339,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a virtual machine scale set. /// + /// + /// Gets all network interfaces in a virtual machine scale set. + /// /// /// The name of the resource group. /// @@ -359,13 +365,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified network interface in a virtual machine scale set. /// + /// + /// Get the specified network interface in a virtual machine scale set. + /// /// /// The name of the resource group. /// @@ -393,14 +400,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the specified network interface ip configuration in a virtual - /// machine scale set. + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. /// + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// /// /// The name of the resource group. /// @@ -428,14 +437,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetIpConfigurationsWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetIpConfigurationsWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the specified network interface ip configuration in a virtual - /// machine scale set. + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. /// + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// /// /// The name of the resource group. /// @@ -466,13 +477,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVirtualMachineScaleSetIpConfigurationWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVirtualMachineScaleSetIpConfigurationWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network interface. /// + /// + /// Deletes the specified network interface. + /// /// /// The name of the resource group. /// @@ -488,13 +500,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a network interface. /// + /// + /// Creates or updates a network interface. + /// /// /// The name of the resource group. /// @@ -502,8 +515,7 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create or update network interface - /// operation. + /// Parameters supplied to the create or update network interface operation. /// /// /// The headers that will be added to request. @@ -517,13 +529,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route tables applied to a network interface. /// + /// + /// Gets all route tables applied to a network interface. + /// /// /// The name of the resource group. /// @@ -542,13 +555,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network security groups applied to a network interface. /// + /// + /// Gets all network security groups applied to a network interface. + /// /// /// The name of the resource group. /// @@ -567,14 +581,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all network interfaces in a role instance in - /// a cloud service. + /// Gets information about all network interfaces in a role instance in a cloud + /// service. /// + /// + /// Gets information about all network interfaces in a role instance in a cloud + /// service. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -590,13 +606,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServiceRoleInstanceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServiceRoleInstanceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a cloud service. /// + /// + /// Gets all network interfaces in a cloud service. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -612,13 +629,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServiceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServiceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a subscription. /// + /// + /// Gets all network interfaces in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -634,13 +652,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a resource group. /// + /// + /// Gets all network interfaces in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -656,14 +675,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all network interfaces in a virtual machine - /// in a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -679,13 +700,14 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network interfaces in a virtual machine scale set. /// + /// + /// Gets all network interfaces in a virtual machine scale set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -701,14 +723,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the specified network interface ip configuration in a virtual - /// machine scale set. + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. /// + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -724,9 +748,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetIpConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetIpConfigurationsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkManagementClient.cs b/src/Network/Network.Management.Sdk/Generated/INetworkManagementClient.cs index 106edf612210..19877748198e 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkManagementClient.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkManagementClient.cs @@ -1,27 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// + /// The Microsoft Azure Network management API provides a RESTful set of web + /// services that interact with Microsoft Azure Networks service to manage your + /// network resources. The API has entities that capture the relationship + /// between an end user and the Microsoft Azure Networks service. /// - public partial interface INetworkManagementClient : System.IDisposable + public partial interface INetworkManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -31,713 +25,714 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} - /// - /// The subscription credentials which uniquely identify the Microsoft - /// Azure subscription. The subscription ID forms part of the URI for - /// every service call. - /// - string SubscriptionId { get; set; } /// - /// Client API version. + /// The subscription credentials which uniquely identify the Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every service + /// call. /// - string ApiVersion { get; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// 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. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IApplicationGatewaysOperations. + /// Gets the IApplicationGatewaysOperations /// IApplicationGatewaysOperations ApplicationGateways { get; } /// - /// Gets the IApplicationGatewayPrivateLinkResourcesOperations. + /// Gets the IApplicationGatewayPrivateLinkResourcesOperations /// IApplicationGatewayPrivateLinkResourcesOperations ApplicationGatewayPrivateLinkResources { get; } /// - /// Gets the IApplicationGatewayPrivateEndpointConnectionsOperations. + /// Gets the IApplicationGatewayPrivateEndpointConnectionsOperations /// IApplicationGatewayPrivateEndpointConnectionsOperations ApplicationGatewayPrivateEndpointConnections { get; } /// - /// Gets the IApplicationGatewayWafDynamicManifestsDefaultOperations. + /// Gets the IApplicationGatewayWafDynamicManifestsDefaultOperations /// IApplicationGatewayWafDynamicManifestsDefaultOperations ApplicationGatewayWafDynamicManifestsDefault { get; } /// - /// Gets the IApplicationGatewayWafDynamicManifestsOperations. + /// Gets the IApplicationGatewayWafDynamicManifestsOperations /// IApplicationGatewayWafDynamicManifestsOperations ApplicationGatewayWafDynamicManifests { get; } /// - /// Gets the IApplicationSecurityGroupsOperations. + /// Gets the IApplicationSecurityGroupsOperations /// IApplicationSecurityGroupsOperations ApplicationSecurityGroups { get; } /// - /// Gets the IAvailableDelegationsOperations. + /// Gets the IAvailableDelegationsOperations /// IAvailableDelegationsOperations AvailableDelegations { get; } /// - /// Gets the IAvailableResourceGroupDelegationsOperations. + /// Gets the IAvailableResourceGroupDelegationsOperations /// IAvailableResourceGroupDelegationsOperations AvailableResourceGroupDelegations { get; } /// - /// Gets the IAvailableServiceAliasesOperations. + /// Gets the IAvailableServiceAliasesOperations /// IAvailableServiceAliasesOperations AvailableServiceAliases { get; } /// - /// Gets the IAzureFirewallsOperations. + /// Gets the IAzureFirewallsOperations /// IAzureFirewallsOperations AzureFirewalls { get; } /// - /// Gets the IAzureFirewallFqdnTagsOperations. + /// Gets the IAzureFirewallFqdnTagsOperations /// IAzureFirewallFqdnTagsOperations AzureFirewallFqdnTags { get; } /// - /// Gets the IWebCategoriesOperations. + /// Gets the IWebCategoriesOperations /// IWebCategoriesOperations WebCategories { get; } /// - /// Gets the IBastionHostsOperations. + /// Gets the IBastionHostsOperations /// IBastionHostsOperations BastionHosts { get; } /// - /// Gets the INetworkInterfacesOperations. + /// Gets the INetworkInterfacesOperations /// INetworkInterfacesOperations NetworkInterfaces { get; } /// - /// Gets the IPublicIPAddressesOperations. + /// Gets the IPublicIPAddressesOperations /// IPublicIPAddressesOperations PublicIPAddresses { get; } /// - /// Gets the IVipSwapOperations. + /// Gets the IVipSwapOperations /// IVipSwapOperations VipSwap { get; } /// - /// Gets the ICustomIPPrefixesOperations. + /// Gets the ICustomIPPrefixesOperations /// ICustomIPPrefixesOperations CustomIPPrefixes { get; } /// - /// Gets the IDdosCustomPoliciesOperations. + /// Gets the IDdosCustomPoliciesOperations /// IDdosCustomPoliciesOperations DdosCustomPolicies { get; } /// - /// Gets the IDdosProtectionPlansOperations. + /// Gets the IDdosProtectionPlansOperations /// IDdosProtectionPlansOperations DdosProtectionPlans { get; } /// - /// Gets the IDscpConfigurationOperations. + /// Gets the IDscpConfigurationOperations /// IDscpConfigurationOperations DscpConfiguration { get; } /// - /// Gets the IAvailableEndpointServicesOperations. + /// Gets the IAvailableEndpointServicesOperations /// IAvailableEndpointServicesOperations AvailableEndpointServices { get; } /// - /// Gets the IExpressRouteCircuitAuthorizationsOperations. + /// Gets the IExpressRouteCircuitAuthorizationsOperations /// IExpressRouteCircuitAuthorizationsOperations ExpressRouteCircuitAuthorizations { get; } /// - /// Gets the IExpressRouteCircuitPeeringsOperations. + /// Gets the IExpressRouteCircuitPeeringsOperations /// IExpressRouteCircuitPeeringsOperations ExpressRouteCircuitPeerings { get; } /// - /// Gets the IExpressRouteCircuitConnectionsOperations. + /// Gets the IExpressRouteCircuitConnectionsOperations /// IExpressRouteCircuitConnectionsOperations ExpressRouteCircuitConnections { get; } /// - /// Gets the IPeerExpressRouteCircuitConnectionsOperations. + /// Gets the IPeerExpressRouteCircuitConnectionsOperations /// IPeerExpressRouteCircuitConnectionsOperations PeerExpressRouteCircuitConnections { get; } /// - /// Gets the IExpressRouteCircuitsOperations. + /// Gets the IExpressRouteCircuitsOperations /// IExpressRouteCircuitsOperations ExpressRouteCircuits { get; } /// - /// Gets the IExpressRouteServiceProvidersOperations. + /// Gets the IExpressRouteServiceProvidersOperations /// IExpressRouteServiceProvidersOperations ExpressRouteServiceProviders { get; } /// - /// Gets the IExpressRouteCrossConnectionsOperations. + /// Gets the IExpressRouteCrossConnectionsOperations /// IExpressRouteCrossConnectionsOperations ExpressRouteCrossConnections { get; } /// - /// Gets the IExpressRouteCrossConnectionPeeringsOperations. + /// Gets the IExpressRouteCrossConnectionPeeringsOperations /// IExpressRouteCrossConnectionPeeringsOperations ExpressRouteCrossConnectionPeerings { get; } /// - /// Gets the IExpressRoutePortsLocationsOperations. + /// Gets the IExpressRoutePortsLocationsOperations /// IExpressRoutePortsLocationsOperations ExpressRoutePortsLocations { get; } /// - /// Gets the IExpressRoutePortsOperations. + /// Gets the IExpressRoutePortsOperations /// IExpressRoutePortsOperations ExpressRoutePorts { get; } /// - /// Gets the IExpressRouteLinksOperations. + /// Gets the IExpressRouteLinksOperations /// IExpressRouteLinksOperations ExpressRouteLinks { get; } /// - /// Gets the IExpressRoutePortAuthorizationsOperations. + /// Gets the IExpressRoutePortAuthorizationsOperations /// IExpressRoutePortAuthorizationsOperations ExpressRoutePortAuthorizations { get; } /// - /// Gets the IExpressRouteProviderPortsLocationOperations. + /// Gets the IExpressRouteProviderPortsLocationOperations /// IExpressRouteProviderPortsLocationOperations ExpressRouteProviderPortsLocation { get; } /// - /// Gets the IFirewallPoliciesOperations. + /// Gets the IFirewallPoliciesOperations /// IFirewallPoliciesOperations FirewallPolicies { get; } /// - /// Gets the IFirewallPolicyRuleCollectionGroupsOperations. + /// Gets the IFirewallPolicyRuleCollectionGroupsOperations /// IFirewallPolicyRuleCollectionGroupsOperations FirewallPolicyRuleCollectionGroups { get; } /// - /// Gets the IFirewallPolicyIdpsSignaturesOperations. + /// Gets the IFirewallPolicyIdpsSignaturesOperations /// IFirewallPolicyIdpsSignaturesOperations FirewallPolicyIdpsSignatures { get; } /// - /// Gets the IFirewallPolicyIdpsSignaturesOverridesOperations. + /// Gets the IFirewallPolicyIdpsSignaturesOverridesOperations /// IFirewallPolicyIdpsSignaturesOverridesOperations FirewallPolicyIdpsSignaturesOverrides { get; } /// - /// Gets the IFirewallPolicyIdpsSignaturesFilterValuesOperations. + /// Gets the IFirewallPolicyIdpsSignaturesFilterValuesOperations /// IFirewallPolicyIdpsSignaturesFilterValuesOperations FirewallPolicyIdpsSignaturesFilterValues { get; } /// - /// Gets the IIpAllocationsOperations. + /// Gets the IIPAllocationsOperations /// - IIpAllocationsOperations IpAllocations { get; } + IIPAllocationsOperations IPAllocations { get; } /// - /// Gets the IIpGroupsOperations. + /// Gets the IIPGroupsOperations /// - IIpGroupsOperations IpGroups { get; } + IIPGroupsOperations IPGroups { get; } /// - /// Gets the ILoadBalancersOperations. + /// Gets the ILoadBalancersOperations /// ILoadBalancersOperations LoadBalancers { get; } /// - /// Gets the ILoadBalancerBackendAddressPoolsOperations. + /// Gets the ILoadBalancerBackendAddressPoolsOperations /// ILoadBalancerBackendAddressPoolsOperations LoadBalancerBackendAddressPools { get; } /// - /// Gets the ILoadBalancerFrontendIPConfigurationsOperations. + /// Gets the ILoadBalancerFrontendIPConfigurationsOperations /// ILoadBalancerFrontendIPConfigurationsOperations LoadBalancerFrontendIPConfigurations { get; } /// - /// Gets the IInboundNatRulesOperations. + /// Gets the IInboundNatRulesOperations /// IInboundNatRulesOperations InboundNatRules { get; } /// - /// Gets the ILoadBalancerLoadBalancingRulesOperations. + /// Gets the ILoadBalancerLoadBalancingRulesOperations /// ILoadBalancerLoadBalancingRulesOperations LoadBalancerLoadBalancingRules { get; } /// - /// Gets the ILoadBalancerOutboundRulesOperations. + /// Gets the ILoadBalancerOutboundRulesOperations /// ILoadBalancerOutboundRulesOperations LoadBalancerOutboundRules { get; } /// - /// Gets the ILoadBalancerNetworkInterfacesOperations. + /// Gets the ILoadBalancerNetworkInterfacesOperations /// ILoadBalancerNetworkInterfacesOperations LoadBalancerNetworkInterfaces { get; } /// - /// Gets the ILoadBalancerProbesOperations. + /// Gets the ILoadBalancerProbesOperations /// ILoadBalancerProbesOperations LoadBalancerProbes { get; } /// - /// Gets the INatGatewaysOperations. + /// Gets the INatGatewaysOperations /// INatGatewaysOperations NatGateways { get; } /// - /// Gets the INetworkInterfaceIPConfigurationsOperations. + /// Gets the INetworkInterfaceIPConfigurationsOperations /// INetworkInterfaceIPConfigurationsOperations NetworkInterfaceIPConfigurations { get; } /// - /// Gets the INetworkInterfaceLoadBalancersOperations. + /// Gets the INetworkInterfaceLoadBalancersOperations /// INetworkInterfaceLoadBalancersOperations NetworkInterfaceLoadBalancers { get; } /// - /// Gets the INetworkInterfaceTapConfigurationsOperations. + /// Gets the INetworkInterfaceTapConfigurationsOperations /// INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; } /// - /// Gets the INetworkManagersOperations. + /// Gets the INetworkManagersOperations /// INetworkManagersOperations NetworkManagers { get; } /// - /// Gets the INetworkManagerCommitsOperations. + /// Gets the INetworkManagerCommitsOperations /// INetworkManagerCommitsOperations NetworkManagerCommits { get; } /// - /// Gets the INetworkManagerDeploymentStatusOperations. + /// Gets the INetworkManagerDeploymentStatusOperations /// INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; } /// - /// Gets the ISubscriptionNetworkManagerConnectionsOperations. + /// Gets the ISubscriptionNetworkManagerConnectionsOperations /// ISubscriptionNetworkManagerConnectionsOperations SubscriptionNetworkManagerConnections { get; } /// - /// Gets the IManagementGroupNetworkManagerConnectionsOperations. + /// Gets the IManagementGroupNetworkManagerConnectionsOperations /// IManagementGroupNetworkManagerConnectionsOperations ManagementGroupNetworkManagerConnections { get; } /// - /// Gets the IConnectivityConfigurationsOperations. + /// Gets the IConnectivityConfigurationsOperations /// IConnectivityConfigurationsOperations ConnectivityConfigurations { get; } /// - /// Gets the INetworkGroupsOperations. + /// Gets the INetworkGroupsOperations /// INetworkGroupsOperations NetworkGroups { get; } /// - /// Gets the IStaticMembersOperations. + /// Gets the IStaticMembersOperations /// IStaticMembersOperations StaticMembers { get; } /// - /// Gets the IScopeConnectionsOperations. + /// Gets the IScopeConnectionsOperations /// IScopeConnectionsOperations ScopeConnections { get; } /// - /// Gets the ISecurityAdminConfigurationsOperations. + /// Gets the ISecurityAdminConfigurationsOperations /// ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; } /// - /// Gets the IAdminRuleCollectionsOperations. + /// Gets the IAdminRuleCollectionsOperations /// IAdminRuleCollectionsOperations AdminRuleCollections { get; } /// - /// Gets the IAdminRulesOperations. + /// Gets the IAdminRulesOperations /// IAdminRulesOperations AdminRules { get; } /// - /// Gets the INetworkProfilesOperations. + /// Gets the INetworkProfilesOperations /// INetworkProfilesOperations NetworkProfiles { get; } /// - /// Gets the INetworkSecurityGroupsOperations. + /// Gets the INetworkSecurityGroupsOperations /// INetworkSecurityGroupsOperations NetworkSecurityGroups { get; } /// - /// Gets the ISecurityRulesOperations. + /// Gets the ISecurityRulesOperations /// ISecurityRulesOperations SecurityRules { get; } /// - /// Gets the IDefaultSecurityRulesOperations. + /// Gets the IDefaultSecurityRulesOperations /// IDefaultSecurityRulesOperations DefaultSecurityRules { get; } /// - /// Gets the INetworkVirtualAppliancesOperations. + /// Gets the INetworkVirtualAppliancesOperations /// INetworkVirtualAppliancesOperations NetworkVirtualAppliances { get; } /// - /// Gets the IVirtualApplianceSitesOperations. + /// Gets the IVirtualApplianceSitesOperations /// IVirtualApplianceSitesOperations VirtualApplianceSites { get; } /// - /// Gets the IVirtualApplianceSkusOperations. + /// Gets the IVirtualApplianceSkusOperations /// IVirtualApplianceSkusOperations VirtualApplianceSkus { get; } /// - /// Gets the IInboundSecurityRuleOperations. + /// Gets the IInboundSecurityRuleOperations /// IInboundSecurityRuleOperations InboundSecurityRule { get; } /// - /// Gets the INetworkWatchersOperations. + /// Gets the INetworkWatchersOperations /// INetworkWatchersOperations NetworkWatchers { get; } /// - /// Gets the IPacketCapturesOperations. + /// Gets the IPacketCapturesOperations /// IPacketCapturesOperations PacketCaptures { get; } /// - /// Gets the IConnectionMonitorsOperations. + /// Gets the IConnectionMonitorsOperations /// IConnectionMonitorsOperations ConnectionMonitors { get; } /// - /// Gets the IFlowLogsOperations. + /// Gets the IFlowLogsOperations /// IFlowLogsOperations FlowLogs { get; } /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the IPrivateEndpointsOperations. + /// Gets the IPrivateEndpointsOperations /// IPrivateEndpointsOperations PrivateEndpoints { get; } /// - /// Gets the IAvailablePrivateEndpointTypesOperations. + /// Gets the IAvailablePrivateEndpointTypesOperations /// IAvailablePrivateEndpointTypesOperations AvailablePrivateEndpointTypes { get; } /// - /// Gets the IPrivateDnsZoneGroupsOperations. + /// Gets the IPrivateDnsZoneGroupsOperations /// IPrivateDnsZoneGroupsOperations PrivateDnsZoneGroups { get; } /// - /// Gets the IPrivateLinkServicesOperations. + /// Gets the IPrivateLinkServicesOperations /// IPrivateLinkServicesOperations PrivateLinkServices { get; } /// - /// Gets the IPublicIPPrefixesOperations. + /// Gets the IPublicIPPrefixesOperations /// IPublicIPPrefixesOperations PublicIPPrefixes { get; } /// - /// Gets the IRouteFiltersOperations. + /// Gets the IRouteFiltersOperations /// IRouteFiltersOperations RouteFilters { get; } /// - /// Gets the IRouteFilterRulesOperations. + /// Gets the IRouteFilterRulesOperations /// IRouteFilterRulesOperations RouteFilterRules { get; } /// - /// Gets the IRouteTablesOperations. + /// Gets the IRouteTablesOperations /// IRouteTablesOperations RouteTables { get; } /// - /// Gets the IRoutesOperations. + /// Gets the IRoutesOperations /// IRoutesOperations Routes { get; } /// - /// Gets the ISecurityPartnerProvidersOperations. + /// Gets the ISecurityPartnerProvidersOperations /// ISecurityPartnerProvidersOperations SecurityPartnerProviders { get; } /// - /// Gets the IBgpServiceCommunitiesOperations. + /// Gets the IBgpServiceCommunitiesOperations /// IBgpServiceCommunitiesOperations BgpServiceCommunities { get; } /// - /// Gets the IServiceEndpointPoliciesOperations. + /// Gets the IServiceEndpointPoliciesOperations /// IServiceEndpointPoliciesOperations ServiceEndpointPolicies { get; } /// - /// Gets the IServiceEndpointPolicyDefinitionsOperations. + /// Gets the IServiceEndpointPolicyDefinitionsOperations /// IServiceEndpointPolicyDefinitionsOperations ServiceEndpointPolicyDefinitions { get; } /// - /// Gets the IServiceTagsOperations. + /// Gets the IServiceTagsOperations /// IServiceTagsOperations ServiceTags { get; } /// - /// Gets the IServiceTagInformationOperations. + /// Gets the IServiceTagInformationOperations /// IServiceTagInformationOperations ServiceTagInformation { get; } /// - /// Gets the IUsagesOperations. + /// Gets the IUsagesOperations /// IUsagesOperations Usages { get; } /// - /// Gets the IVirtualNetworksOperations. + /// Gets the IVirtualNetworksOperations /// IVirtualNetworksOperations VirtualNetworks { get; } /// - /// Gets the ISubnetsOperations. + /// Gets the ISubnetsOperations /// ISubnetsOperations Subnets { get; } /// - /// Gets the IResourceNavigationLinksOperations. + /// Gets the IResourceNavigationLinksOperations /// IResourceNavigationLinksOperations ResourceNavigationLinks { get; } /// - /// Gets the IServiceAssociationLinksOperations. + /// Gets the IServiceAssociationLinksOperations /// IServiceAssociationLinksOperations ServiceAssociationLinks { get; } /// - /// Gets the IVirtualNetworkPeeringsOperations. + /// Gets the IVirtualNetworkPeeringsOperations /// IVirtualNetworkPeeringsOperations VirtualNetworkPeerings { get; } /// - /// Gets the IVirtualNetworkGatewaysOperations. + /// Gets the IVirtualNetworkGatewaysOperations /// IVirtualNetworkGatewaysOperations VirtualNetworkGateways { get; } /// - /// Gets the IVirtualNetworkGatewayConnectionsOperations. + /// Gets the IVirtualNetworkGatewayConnectionsOperations /// IVirtualNetworkGatewayConnectionsOperations VirtualNetworkGatewayConnections { get; } /// - /// Gets the ILocalNetworkGatewaysOperations. + /// Gets the ILocalNetworkGatewaysOperations /// ILocalNetworkGatewaysOperations LocalNetworkGateways { get; } /// - /// Gets the IVirtualNetworkGatewayNatRulesOperations. + /// Gets the IVirtualNetworkGatewayNatRulesOperations /// IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; } /// - /// Gets the IVirtualNetworkTapsOperations. + /// Gets the IVirtualNetworkTapsOperations /// IVirtualNetworkTapsOperations VirtualNetworkTaps { get; } /// - /// Gets the IVirtualRoutersOperations. + /// Gets the IVirtualRoutersOperations /// IVirtualRoutersOperations VirtualRouters { get; } /// - /// Gets the IVirtualRouterPeeringsOperations. + /// Gets the IVirtualRouterPeeringsOperations /// IVirtualRouterPeeringsOperations VirtualRouterPeerings { get; } /// - /// Gets the IVirtualWansOperations. + /// Gets the IVirtualWansOperations /// IVirtualWansOperations VirtualWans { get; } /// - /// Gets the IVpnSitesOperations. + /// Gets the IVpnSitesOperations /// IVpnSitesOperations VpnSites { get; } /// - /// Gets the IVpnSiteLinksOperations. + /// Gets the IVpnSiteLinksOperations /// IVpnSiteLinksOperations VpnSiteLinks { get; } /// - /// Gets the IVpnSitesConfigurationOperations. + /// Gets the IVpnSitesConfigurationOperations /// IVpnSitesConfigurationOperations VpnSitesConfiguration { get; } /// - /// Gets the IVpnServerConfigurationsOperations. + /// Gets the IVpnServerConfigurationsOperations /// IVpnServerConfigurationsOperations VpnServerConfigurations { get; } /// - /// Gets the IConfigurationPolicyGroupsOperations. + /// Gets the IConfigurationPolicyGroupsOperations /// IConfigurationPolicyGroupsOperations ConfigurationPolicyGroups { get; } /// - /// Gets the IVirtualHubsOperations. + /// Gets the IVirtualHubsOperations /// IVirtualHubsOperations VirtualHubs { get; } /// - /// Gets the IRouteMapsOperations. + /// Gets the IRouteMapsOperations /// IRouteMapsOperations RouteMaps { get; } /// - /// Gets the IHubVirtualNetworkConnectionsOperations. + /// Gets the IHubVirtualNetworkConnectionsOperations /// IHubVirtualNetworkConnectionsOperations HubVirtualNetworkConnections { get; } /// - /// Gets the IVpnGatewaysOperations. + /// Gets the IVpnGatewaysOperations /// IVpnGatewaysOperations VpnGateways { get; } /// - /// Gets the IVpnLinkConnectionsOperations. + /// Gets the IVpnLinkConnectionsOperations /// IVpnLinkConnectionsOperations VpnLinkConnections { get; } /// - /// Gets the IVpnConnectionsOperations. + /// Gets the IVpnConnectionsOperations /// IVpnConnectionsOperations VpnConnections { get; } /// - /// Gets the IVpnSiteLinkConnectionsOperations. + /// Gets the IVpnSiteLinkConnectionsOperations /// IVpnSiteLinkConnectionsOperations VpnSiteLinkConnections { get; } /// - /// Gets the INatRulesOperations. + /// Gets the INatRulesOperations /// INatRulesOperations NatRules { get; } /// - /// Gets the IP2sVpnGatewaysOperations. + /// Gets the IP2SVpnGatewaysOperations /// - IP2sVpnGatewaysOperations P2sVpnGateways { get; } + IP2SVpnGatewaysOperations P2SVpnGateways { get; } /// - /// Gets the IVpnServerConfigurationsAssociatedWithVirtualWanOperations. + /// Gets the IVpnServerConfigurationsAssociatedWithVirtualWanOperations /// IVpnServerConfigurationsAssociatedWithVirtualWanOperations VpnServerConfigurationsAssociatedWithVirtualWan { get; } /// - /// Gets the IVirtualHubRouteTableV2sOperations. + /// Gets the IVirtualHubRouteTableV2SOperations /// - IVirtualHubRouteTableV2sOperations VirtualHubRouteTableV2s { get; } + IVirtualHubRouteTableV2SOperations VirtualHubRouteTableV2S { get; } /// - /// Gets the IExpressRouteGatewaysOperations. + /// Gets the IExpressRouteGatewaysOperations /// IExpressRouteGatewaysOperations ExpressRouteGateways { get; } /// - /// Gets the IExpressRouteConnectionsOperations. + /// Gets the IExpressRouteConnectionsOperations /// IExpressRouteConnectionsOperations ExpressRouteConnections { get; } /// - /// Gets the INetworkVirtualApplianceConnectionsOperations. + /// Gets the INetworkVirtualApplianceConnectionsOperations /// INetworkVirtualApplianceConnectionsOperations NetworkVirtualApplianceConnections { get; } /// - /// Gets the IVirtualHubBgpConnectionOperations. + /// Gets the IVirtualHubBgpConnectionOperations /// IVirtualHubBgpConnectionOperations VirtualHubBgpConnection { get; } /// - /// Gets the IVirtualHubBgpConnectionsOperations. + /// Gets the IVirtualHubBgpConnectionsOperations /// IVirtualHubBgpConnectionsOperations VirtualHubBgpConnections { get; } /// - /// Gets the IVirtualHubIpConfigurationOperations. + /// Gets the IVirtualHubIPConfigurationOperations /// - IVirtualHubIpConfigurationOperations VirtualHubIpConfiguration { get; } + IVirtualHubIPConfigurationOperations VirtualHubIPConfiguration { get; } /// - /// Gets the IHubRouteTablesOperations. + /// Gets the IHubRouteTablesOperations /// IHubRouteTablesOperations HubRouteTables { get; } /// - /// Gets the IRoutingIntentOperations. + /// Gets the IRoutingIntentOperations /// IRoutingIntentOperations RoutingIntent { get; } /// - /// Gets the IWebApplicationFirewallPoliciesOperations. + /// Gets the IWebApplicationFirewallPoliciesOperations /// IWebApplicationFirewallPoliciesOperations WebApplicationFirewallPolicies { get; } /// - /// Creates a Bastion Shareable Links for all the VMs specified in the - /// request. + /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// /// /// The name of the resource group. /// @@ -745,8 +740,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the Bastion Host. /// /// - /// Post request for Create/Delete/Get Bastion Shareable Link - /// endpoints. + /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// /// The headers that will be added to request. @@ -754,12 +748,22 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> PutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> PutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes the Bastion Shareable Links for all the VMs specified in - /// the request. + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. /// + /// + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. + /// /// /// The name of the resource group. /// @@ -767,8 +771,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the Bastion Host. /// /// - /// Post request for Create/Delete/Get Bastion Shareable Link - /// endpoints. + /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// /// The headers that will be added to request. @@ -776,12 +779,19 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task DeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes the Bastion Shareable Links for all the tokens specified in - /// the request. + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. /// + /// + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. + /// /// /// The name of the resource group. /// @@ -797,12 +807,19 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> DeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> DeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Return the Bastion Shareable Links for all the VMs specified in the /// request. /// + /// + /// Return the Bastion Shareable Links for all the VMs specified in the + /// request. + /// /// /// The name of the resource group. /// @@ -810,8 +827,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the Bastion Host. /// /// - /// Post request for Create/Delete/Get Bastion Shareable Link - /// endpoints. + /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// /// The headers that will be added to request. @@ -819,11 +835,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> GetBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> GetBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns the list of currently active sessions on the Bastion. /// + /// + /// Returns the list of currently active sessions on the Bastion. + /// /// /// The name of the resource group. /// @@ -836,11 +861,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> GetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> GetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns the list of currently active sessions on the Bastion. /// + /// + /// Returns the list of currently active sessions on the Bastion. + /// /// /// The name of the resource group. /// @@ -856,18 +890,28 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> DisconnectActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, SessionIds sessionIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> DisconnectActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, SessionIds sessionIds, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Checks whether a domain name in the cloudapp.azure.com zone is - /// available for use. + /// Checks whether a domain name in the cloudapp.azure.com zone is available + /// for use. /// + /// + /// Checks whether a domain name in the cloudapp.azure.com zone is available + /// for use. + /// /// /// The location of the domain name. /// /// - /// The domain name to be verified. It must conform to the following - /// regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + /// The domain name to be verified. It must conform to the following regular + /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. /// /// /// The headers that will be added to request. @@ -875,11 +919,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves detail of a provider port. /// + /// + /// Retrieves detail of a provider port. + /// /// /// The name of the provider port. /// @@ -889,14 +942,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> ExpressRouteProviderPortMethodWithHttpMessagesAsync(string providerport, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> ExpressRouteProviderPortWithHttpMessagesAsync(string providerport, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists active connectivity configurations in a network manager. /// - /// - /// Active Configuration Parameter. - /// + /// + /// Lists active connectivity configurations in a network manager. + /// /// /// The name of the resource group. /// @@ -904,8 +963,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// Active Configuration Parameter. /// /// /// The headers that will be added to request. @@ -913,14 +975,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> ListActiveConnectivityConfigurationsWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> ListActiveConnectivityConfigurationsWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists active security admin rules in a network manager. /// - /// - /// Active Configuration Parameter. - /// + /// + /// Lists active security admin rules in a network manager. + /// /// /// The name of the resource group. /// @@ -928,8 +996,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// Active Configuration Parameter. /// /// /// The headers that will be added to request. @@ -937,15 +1008,22 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> ListActiveSecurityAdminRulesWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> ListActiveSecurityAdminRulesWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// List all effective connectivity configurations applied on a virtual /// network. /// - /// - /// Parameters supplied to list correct page. - /// + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// /// /// The name of the resource group. /// @@ -953,8 +1031,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the virtual network. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// Parameters supplied to list correct page. /// /// /// The headers that will be added to request. @@ -962,15 +1043,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// List all effective security admin rules applied on a virtual - /// network. + /// List all effective security admin rules applied on a virtual network. /// - /// - /// Parameters supplied to list correct page. - /// + /// + /// List all effective security admin rules applied on a virtual network. + /// /// /// The name of the resource group. /// @@ -978,8 +1064,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the virtual network. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// Parameters supplied to list correct page. /// /// /// The headers that will be added to request. @@ -987,17 +1076,26 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gives the supported security providers for the virtual wan. /// + /// + /// Gives the supported security providers for the virtual wan. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN for which supported security providers - /// are needed. + /// The name of the VirtualWAN for which supported security providers are + /// needed. /// /// /// The headers that will be added to request. @@ -1005,23 +1103,34 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> SupportedSecurityProvidersWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> SupportedSecurityProvidersWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified - /// resource group. + /// associated VpnServerConfiguration combination in the specified resource + /// group. /// + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations - /// is needed. + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. /// /// - /// Parameters supplied to the generate VirtualWan VPN profile - /// generation operation. + /// Parameters supplied to the generate VirtualWan VPN profile generation + /// operation. /// /// /// The headers that will be added to request. @@ -1029,12 +1138,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates a Bastion Shareable Links for all the VMs specified in the - /// request. + /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// /// /// The name of the resource group. /// @@ -1042,8 +1159,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the Bastion Host. /// /// - /// Post request for Create/Delete/Get Bastion Shareable Link - /// endpoints. + /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// /// The headers that will be added to request. @@ -1051,12 +1167,22 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> BeginPutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> BeginPutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes the Bastion Shareable Links for all the VMs specified in - /// the request. + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. /// + /// + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. + /// /// /// The name of the resource group. /// @@ -1064,8 +1190,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// The name of the Bastion Host. /// /// - /// Post request for Create/Delete/Get Bastion Shareable Link - /// endpoints. + /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// /// The headers that will be added to request. @@ -1073,12 +1198,19 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task BeginDeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task BeginDeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes the Bastion Shareable Links for all the tokens specified in - /// the request. + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. /// + /// + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. + /// /// /// The name of the resource group. /// @@ -1094,11 +1226,17 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns the list of currently active sessions on the Bastion. /// + /// + /// Returns the list of currently active sessions on the Bastion. + /// /// /// The name of the resource group. /// @@ -1111,23 +1249,34 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> BeginGetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> BeginGetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified - /// resource group. + /// associated VpnServerConfiguration combination in the specified resource + /// group. /// + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations - /// is needed. + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. /// /// - /// Parameters supplied to the generate VirtualWan VPN profile - /// generation operation. + /// Parameters supplied to the generate VirtualWan VPN profile generation + /// operation. /// /// /// The headers that will be added to request. @@ -1135,12 +1284,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates a Bastion Shareable Links for all the VMs specified in the - /// request. + /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1150,12 +1307,22 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> PutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> PutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Return the Bastion Shareable Links for all the VMs specified in the /// request. /// + /// + /// Return the Bastion Shareable Links for all the VMs specified in the + /// request. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1165,11 +1332,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> GetBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> GetBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns the list of currently active sessions on the Bastion. /// + /// + /// Returns the list of currently active sessions on the Bastion. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1179,11 +1355,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> GetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> GetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns the list of currently active sessions on the Bastion. /// + /// + /// Returns the list of currently active sessions on the Bastion. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1193,12 +1378,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> DisconnectActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> DisconnectActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates a Bastion Shareable Links for all the VMs specified in the - /// request. + /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1208,11 +1401,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> BeginPutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> BeginPutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns the list of currently active sessions on the Bastion. /// + /// + /// Returns the list of currently active sessions on the Bastion. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1222,7 +1424,13 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - Task>> BeginGetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> BeginGetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkManagerCommitsOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkManagerCommitsOperations.cs index 5832d09a5694..c4f1ff33e5c6 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkManagerCommitsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkManagerCommitsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkManagerCommitsOperations operations. @@ -26,15 +16,18 @@ public partial interface INetworkManagerCommitsOperations /// /// Post a Network Manager Commit. /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// + /// + /// Post a Network Manager Commit. + /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// /// /// The headers that will be added to request. /// @@ -47,22 +40,23 @@ public partial interface INetworkManagerCommitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PostWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Post a Network Manager Commit. /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// + /// + /// Post a Network Manager Commit. + /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// /// /// The headers that will be added to request. /// @@ -75,9 +69,7 @@ public partial interface INetworkManagerCommitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginPostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginPostWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkManagerDeploymentStatusOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkManagerDeploymentStatusOperations.cs index 8175fa748682..d3af91aafdfd 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkManagerDeploymentStatusOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkManagerDeploymentStatusOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkManagerDeploymentStatusOperations operations. @@ -26,10 +16,9 @@ public partial interface INetworkManagerDeploymentStatusOperations /// /// Post to List of Network Manager Deployment Status. /// - /// - /// Parameters supplied to specify which Managed Network deployment - /// status is. - /// + /// + /// Post to List of Network Manager Deployment Status. + /// /// /// The name of the resource group. /// @@ -37,8 +26,11 @@ public partial interface INetworkManagerDeploymentStatusOperations /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// Parameters supplied to specify which Managed Network deployment status is. /// /// /// The headers that will be added to request. @@ -52,9 +44,7 @@ public partial interface INetworkManagerDeploymentStatusOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManagerDeploymentStatusParameter parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkManagersOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkManagersOperations.cs index 06a30dd82ec3..978276c4c337 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkManagersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkManagersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkManagersOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkManagersOperations /// /// Gets the specified Network Manager. /// + /// + /// Gets the specified Network Manager. + /// /// /// The name of the resource group. /// @@ -44,22 +37,23 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Network Manager. /// - /// - /// Parameters supplied to specify which network manager is. - /// + /// + /// Creates or updates a Network Manager. + /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which network manager is. + /// /// /// The headers that will be added to request. /// @@ -72,13 +66,14 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManager parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManager parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a network manager. /// + /// + /// Deletes a network manager. + /// /// /// The name of the resource group. /// @@ -86,10 +81,9 @@ public partial interface INetworkManagersOperations /// The name of the network manager. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -100,22 +94,23 @@ public partial interface INetworkManagersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Patch NetworkManager. /// - /// - /// Parameters supplied to specify which network manager is. - /// + /// + /// Patch NetworkManager. + /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which network manager is. + /// /// /// The headers that will be added to request. /// @@ -128,22 +123,23 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PatchWithHttpMessagesAsync(PatchObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, PatchObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all network managers in a subscription. /// + /// + /// List all network managers in a subscription. + /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -157,25 +153,26 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List network managers in a resource group. /// + /// + /// List network managers in a resource group. + /// /// /// The name of the resource group. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -189,13 +186,14 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a network manager. /// + /// + /// Deletes a network manager. + /// /// /// The name of the resource group. /// @@ -203,10 +201,9 @@ public partial interface INetworkManagersOperations /// The name of the network manager. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -217,13 +214,14 @@ public partial interface INetworkManagersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all network managers in a subscription. /// + /// + /// List all network managers in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -239,13 +237,14 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List network managers in a resource group. /// + /// + /// List network managers in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -261,9 +260,7 @@ public partial interface INetworkManagersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkProfilesOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkProfilesOperations.cs index 70a0deb996f5..17bb3f395f28 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkProfilesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkProfilesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkProfilesOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkProfilesOperations /// /// Deletes the specified network profile. /// + /// + /// Deletes the specified network profile. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified network profile in a specified resource group. /// + /// + /// Gets the specified network profile in a specified resource group. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a network profile. /// + /// + /// Creates or updates a network profile. + /// /// /// The name of the resource group. /// @@ -83,8 +78,7 @@ public partial interface INetworkProfilesOperations /// The name of the network profile. /// /// - /// Parameters supplied to the create or update network profile - /// operation. + /// Parameters supplied to the create or update network profile operation. /// /// /// The headers that will be added to request. @@ -98,13 +92,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, NetworkProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, NetworkProfile parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates network profile tags. /// + /// + /// Updates network profile tags. + /// /// /// The name of the resource group. /// @@ -126,13 +121,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the network profiles in a subscription. /// + /// + /// Gets all the network profiles in a subscription. + /// /// /// The headers that will be added to request. /// @@ -145,13 +141,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network profiles in a resource group. /// + /// + /// Gets all network profiles in a resource group. + /// /// /// The name of the resource group. /// @@ -167,13 +164,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network profile. /// + /// + /// Deletes the specified network profile. + /// /// /// The name of the resource group. /// @@ -189,13 +187,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the network profiles in a subscription. /// + /// + /// Gets all the network profiles in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -211,13 +210,14 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network profiles in a resource group. /// + /// + /// Gets all network profiles in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -233,9 +233,7 @@ public partial interface INetworkProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkSecurityGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkSecurityGroupsOperations.cs index 17de1ed9c5ba..dd8f595f484c 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkSecurityGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkSecurityGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkSecurityGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkSecurityGroupsOperations /// /// Deletes the specified network security group. /// + /// + /// Deletes the specified network security group. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified network security group. /// + /// + /// Gets the specified network security group. + /// /// /// The name of the resource group. /// @@ -69,14 +63,16 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a network security group in the specified - /// resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// + /// + /// Creates or updates a network security group in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -99,13 +95,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a network security group tags. /// + /// + /// Updates a network security group tags. + /// /// /// The name of the resource group. /// @@ -127,13 +124,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network security groups in a subscription. /// + /// + /// Gets all network security groups in a subscription. + /// /// /// The headers that will be added to request. /// @@ -146,13 +144,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network security groups in a resource group. /// + /// + /// Gets all network security groups in a resource group. + /// /// /// The name of the resource group. /// @@ -168,13 +167,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network security group. /// + /// + /// Deletes the specified network security group. + /// /// /// The name of the resource group. /// @@ -190,14 +190,16 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a network security group in the specified - /// resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// + /// + /// Creates or updates a network security group in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -220,13 +222,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network security groups in a subscription. /// + /// + /// Gets all network security groups in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -242,13 +245,14 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network security groups in a resource group. /// + /// + /// Gets all network security groups in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -264,9 +268,7 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkVirtualApplianceConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkVirtualApplianceConnectionsOperations.cs index 718718b65724..eb911a6aabdc 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkVirtualApplianceConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkVirtualApplianceConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkVirtualApplianceConnectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkVirtualApplianceConnectionsOperations { /// - /// Creates a connection to Network Virtual Appliance, if it doesn't - /// exist else updates the existing NVA connection' + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' /// + /// + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' + /// /// /// The name of the resource group. /// @@ -37,8 +31,7 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// The name of the NVA connection. /// /// - /// Parameters supplied in an NetworkVirtualApplianceConnection PUT - /// operation. + /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. /// /// /// The headers that will be added to request. @@ -52,13 +45,14 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of specified NVA connection. /// + /// + /// Retrieves the details of specified NVA connection. + /// /// /// The name of the resource group. /// @@ -80,13 +74,14 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a NVA connection. /// + /// + /// Deletes a NVA connection. + /// /// /// The name of the resource group. /// @@ -105,13 +100,14 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists NetworkVirtualApplianceConnections under the NVA. /// + /// + /// Lists NetworkVirtualApplianceConnections under the NVA. + /// /// /// The name of the resource group. /// @@ -130,14 +126,16 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a connection to Network Virtual Appliance, if it doesn't - /// exist else updates the existing NVA connection' + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' /// + /// + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' + /// /// /// The name of the resource group. /// @@ -148,8 +146,7 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// The name of the NVA connection. /// /// - /// Parameters supplied in an NetworkVirtualApplianceConnection PUT - /// operation. + /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. /// /// /// The headers that will be added to request. @@ -163,13 +160,14 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a NVA connection. /// + /// + /// Deletes a NVA connection. + /// /// /// The name of the resource group. /// @@ -188,13 +186,14 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists NetworkVirtualApplianceConnections under the NVA. /// + /// + /// Lists NetworkVirtualApplianceConnections under the NVA. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +209,7 @@ public partial interface INetworkVirtualApplianceConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkVirtualAppliancesOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkVirtualAppliancesOperations.cs index 6c3ece91b619..ac862f43a569 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkVirtualAppliancesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkVirtualAppliancesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkVirtualAppliancesOperations operations. @@ -26,6 +16,9 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Deletes the specified Network Virtual Appliance. /// + /// + /// Deletes the specified Network Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Network Virtual Appliance. /// + /// + /// Gets the specified Network Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a Network Virtual Appliance. /// + /// + /// Updates a Network Virtual Appliance. + /// /// /// The resource group name of Network Virtual Appliance. /// @@ -97,13 +92,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Network Virtual Appliance. /// + /// + /// Creates or updates the specified Network Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -111,8 +107,7 @@ public partial interface INetworkVirtualAppliancesOperations /// The name of Network Virtual Appliance. /// /// - /// Parameters supplied to the create or update Network Virtual - /// Appliance. + /// Parameters supplied to the create or update Network Virtual Appliance. /// /// /// The headers that will be added to request. @@ -126,13 +121,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Network Virtual Appliances in a resource group. /// + /// + /// Lists all Network Virtual Appliances in a resource group. + /// /// /// The name of the resource group. /// @@ -148,13 +144,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all Network Virtual Appliances in a subscription. /// + /// + /// Gets all Network Virtual Appliances in a subscription. + /// /// /// The headers that will be added to request. /// @@ -167,13 +164,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Network Virtual Appliance. /// + /// + /// Deletes the specified Network Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -189,13 +187,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Network Virtual Appliance. /// + /// + /// Creates or updates the specified Network Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -203,8 +202,7 @@ public partial interface INetworkVirtualAppliancesOperations /// The name of Network Virtual Appliance. /// /// - /// Parameters supplied to the create or update Network Virtual - /// Appliance. + /// Parameters supplied to the create or update Network Virtual Appliance. /// /// /// The headers that will be added to request. @@ -218,13 +216,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Network Virtual Appliances in a resource group. /// + /// + /// Lists all Network Virtual Appliances in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -240,13 +239,14 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all Network Virtual Appliances in a subscription. /// + /// + /// Gets all Network Virtual Appliances in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -262,9 +262,7 @@ public partial interface INetworkVirtualAppliancesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/INetworkWatchersOperations.cs b/src/Network/Network.Management.Sdk/Generated/INetworkWatchersOperations.cs index ed2bbb3ac83f..5e38b6cbd462 100644 --- a/src/Network/Network.Management.Sdk/Generated/INetworkWatchersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/INetworkWatchersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkWatchersOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkWatchersOperations { /// - /// Creates or updates a network watcher in the specified resource - /// group. + /// Creates or updates a network watcher in the specified resource group. /// + /// + /// Creates or updates a network watcher in the specified resource group. + /// /// /// The name of the resource group. /// @@ -42,19 +34,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkWatcher parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkWatcher parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified network watcher by resource group. /// + /// + /// Gets the specified network watcher by resource group. + /// /// /// The name of the resource group. /// @@ -67,19 +60,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network watcher resource. /// + /// + /// Deletes the specified network watcher resource. + /// /// /// The name of the resource group. /// @@ -92,16 +86,17 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a network watcher tags. /// + /// + /// Updates a network watcher tags. + /// /// /// The name of the resource group. /// @@ -117,19 +112,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network watchers by resource group. /// + /// + /// Gets all network watchers by resource group. + /// /// /// The name of the resource group. /// @@ -139,38 +135,40 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all network watchers by subscription. /// + /// + /// Gets all network watchers by subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the current network topology by resource group. /// + /// + /// Gets the current network topology by resource group. + /// /// /// The name of the resource group. /// @@ -186,20 +184,22 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetTopologyWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TopologyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetTopologyWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TopologyParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Verify IP flow from the specified VM to a location given the - /// currently configured NSG rules. + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. /// + /// + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. + /// /// /// The name of the resource group. /// @@ -215,19 +215,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> VerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> VerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the next hop from the specified VM. /// + /// + /// Gets the next hop from the specified VM. + /// /// /// The name of the resource group. /// @@ -243,20 +244,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the configured and effective security group rules on the - /// specified VM. + /// Gets the configured and effective security group rules on the specified VM. /// + /// + /// Gets the configured and effective security group rules on the specified VM. + /// /// /// The name of the resource group. /// @@ -272,19 +273,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Initiate troubleshooting on a specified resource. /// + /// + /// Initiate troubleshooting on a specified resource. + /// /// /// The name of the resource group. /// @@ -300,20 +302,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the last completed troubleshooting result on a specified - /// resource. + /// Get the last completed troubleshooting result on a specified resource. /// + /// + /// Get the last completed troubleshooting result on a specified resource. + /// /// /// The name of the resource group. /// @@ -321,8 +323,7 @@ public partial interface INetworkWatchersOperations /// The name of the network watcher resource. /// /// - /// Parameters that define the resource to query the troubleshooting - /// result. + /// Parameters that define the resource to query the troubleshooting result. /// /// /// The headers that will be added to request. @@ -330,20 +331,22 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Configures flow log and traffic analytics (optional) on a specified /// resource. /// + /// + /// Configures flow log and traffic analytics (optional) on a specified + /// resource. + /// /// /// The name of the network watcher resource group. /// @@ -359,20 +362,22 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> SetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> SetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Queries status of flow log and traffic analytics (optional) on a - /// specified resource. + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. /// + /// + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. + /// /// /// The name of the network watcher resource group. /// @@ -380,8 +385,8 @@ public partial interface INetworkWatchersOperations /// The name of the network watcher resource. /// /// - /// Parameters that define a resource to query flow log and traffic - /// analytics (optional) status. + /// Parameters that define a resource to query flow log and traffic analytics + /// (optional) status. /// /// /// The headers that will be added to request. @@ -389,21 +394,24 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the network watcher resource group. /// @@ -411,8 +419,7 @@ public partial interface INetworkWatchersOperations /// The name of the network watcher resource. /// /// - /// Parameters that determine how the connectivity check will be - /// performed. + /// Parameters that determine how the connectivity check will be performed. /// /// /// The headers that will be added to request. @@ -420,21 +427,24 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// NOTE: This feature is currently in preview and still being tested - /// for stability. Gets the relative latency score for internet service - /// providers from a specified location to Azure regions. + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. /// + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. + /// /// /// The name of the network watcher resource group. /// @@ -450,21 +460,24 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// NOTE: This feature is currently in preview and still being tested - /// for stability. Lists all available internet service providers for a - /// specified Azure region. + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. /// + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. + /// /// /// The name of the network watcher resource group. /// @@ -480,25 +493,32 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets Network Configuration Diagnostic data to help customers - /// understand and debug network behavior. It provides detailed - /// information on what security rules were applied to a specified - /// traffic flow and the result of evaluating these rules. Customers - /// must provide details of a flow like source, destination, protocol, - /// etc. The API returns whether traffic was allowed or denied, the - /// rules evaluated for the specified flow and the evaluation results. + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. /// + /// + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. + /// /// /// The name of the resource group. /// @@ -514,19 +534,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network watcher resource. /// + /// + /// Deletes the specified network watcher resource. + /// /// /// The name of the resource group. /// @@ -539,17 +560,19 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Verify IP flow from the specified VM to a location given the - /// currently configured NSG rules. + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. /// + /// + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. + /// /// /// The name of the resource group. /// @@ -565,19 +588,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginVerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginVerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the next hop from the specified VM. /// + /// + /// Gets the next hop from the specified VM. + /// /// /// The name of the resource group. /// @@ -593,20 +617,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the configured and effective security group rules on the - /// specified VM. + /// Gets the configured and effective security group rules on the specified VM. /// + /// + /// Gets the configured and effective security group rules on the specified VM. + /// /// /// The name of the resource group. /// @@ -622,19 +646,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Initiate troubleshooting on a specified resource. /// + /// + /// Initiate troubleshooting on a specified resource. + /// /// /// The name of the resource group. /// @@ -650,20 +675,20 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the last completed troubleshooting result on a specified - /// resource. + /// Get the last completed troubleshooting result on a specified resource. /// + /// + /// Get the last completed troubleshooting result on a specified resource. + /// /// /// The name of the resource group. /// @@ -671,8 +696,7 @@ public partial interface INetworkWatchersOperations /// The name of the network watcher resource. /// /// - /// Parameters that define the resource to query the troubleshooting - /// result. + /// Parameters that define the resource to query the troubleshooting result. /// /// /// The headers that will be added to request. @@ -680,20 +704,22 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Configures flow log and traffic analytics (optional) on a specified /// resource. /// + /// + /// Configures flow log and traffic analytics (optional) on a specified + /// resource. + /// /// /// The name of the network watcher resource group. /// @@ -709,20 +735,22 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginSetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginSetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Queries status of flow log and traffic analytics (optional) on a - /// specified resource. + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. /// + /// + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. + /// /// /// The name of the network watcher resource group. /// @@ -730,8 +758,8 @@ public partial interface INetworkWatchersOperations /// The name of the network watcher resource. /// /// - /// Parameters that define a resource to query flow log and traffic - /// analytics (optional) status. + /// Parameters that define a resource to query flow log and traffic analytics + /// (optional) status. /// /// /// The headers that will be added to request. @@ -739,21 +767,24 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the network watcher resource group. /// @@ -761,8 +792,7 @@ public partial interface INetworkWatchersOperations /// The name of the network watcher resource. /// /// - /// Parameters that determine how the connectivity check will be - /// performed. + /// Parameters that determine how the connectivity check will be performed. /// /// /// The headers that will be added to request. @@ -770,21 +800,24 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// NOTE: This feature is currently in preview and still being tested - /// for stability. Gets the relative latency score for internet service - /// providers from a specified location to Azure regions. + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. /// + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. + /// /// /// The name of the network watcher resource group. /// @@ -800,21 +833,24 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// NOTE: This feature is currently in preview and still being tested - /// for stability. Lists all available internet service providers for a - /// specified Azure region. + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. /// + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. + /// /// /// The name of the network watcher resource group. /// @@ -830,25 +866,32 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets Network Configuration Diagnostic data to help customers - /// understand and debug network behavior. It provides detailed - /// information on what security rules were applied to a specified - /// traffic flow and the result of evaluating these rules. Customers - /// must provide details of a flow like source, destination, protocol, - /// etc. The API returns whether traffic was allowed or denied, the - /// rules evaluated for the specified flow and the evaluation results. + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. /// + /// + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. + /// /// /// The name of the resource group. /// @@ -864,15 +907,13 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IOperations.cs b/src/Network/Network.Management.Sdk/Generated/IOperations.cs index 942a2e40461e..d8ff5f11125e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -26,6 +16,9 @@ public partial interface IOperations /// /// Lists all of the available Network Rest API operations. /// + /// + /// Lists all of the available Network Rest API operations. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the available Network Rest API operations. /// + /// + /// Lists all of the available Network Rest API operations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IP2sVpnGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/IP2sVpnGatewaysOperations.cs index 936fbd8b47c2..49db43061a04 100644 --- a/src/Network/Network.Management.Sdk/Generated/IP2sVpnGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IP2sVpnGatewaysOperations.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// P2sVpnGatewaysOperations operations. + /// P2SVpnGatewaysOperations operations. /// - public partial interface IP2sVpnGatewaysOperations + public partial interface IP2SVpnGatewaysOperations { /// /// Retrieves the details of a virtual wan p2s vpn gateway. /// + /// + /// Retrieves the details of a virtual wan p2s vpn gateway. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -44,14 +37,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else - /// updates the existing gateway. + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. /// + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -59,8 +54,7 @@ public partial interface IP2sVpnGatewaysOperations /// The name of the gateway. /// /// - /// Parameters supplied to create or Update a virtual wan p2s vpn - /// gateway. + /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. /// /// /// The headers that will be added to request. @@ -74,13 +68,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates virtual wan p2s vpn gateway tags. /// + /// + /// Updates virtual wan p2s vpn gateway tags. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -102,13 +97,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a virtual wan p2s vpn gateway. /// + /// + /// Deletes a virtual wan p2s vpn gateway. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -124,13 +120,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the P2SVpnGateways in a resource group. /// + /// + /// Lists all the P2SVpnGateways in a resource group. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -146,13 +143,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the P2SVpnGateways in a subscription. /// + /// + /// Lists all the P2SVpnGateways in a subscription. + /// /// /// The headers that will be added to request. /// @@ -165,14 +163,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the primary of the p2s vpn gateway in the specified resource - /// group. + /// Resets the primary of the p2s vpn gateway in the specified resource group. /// + /// + /// Resets the primary of the p2s vpn gateway in the specified resource group. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -191,14 +189,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the - /// specified resource group. + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. /// + /// + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -206,8 +206,8 @@ public partial interface IP2sVpnGatewaysOperations /// The name of the P2SVpnGateway. /// /// - /// Parameters supplied to the generate P2SVpnGateway VPN client - /// package operation. + /// Parameters supplied to the generate P2SVpnGateway VPN client package + /// operation. /// /// /// The headers that will be added to request. @@ -221,14 +221,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the connection health of P2S clients of the virtual wan - /// P2SVpnGateway in the specified resource group. + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. /// + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// /// /// The name of the resource group. /// @@ -247,14 +249,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetP2sVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetP2SVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the sas url to get the connection health detail of P2S clients - /// of the virtual wan P2SVpnGateway in the specified resource group. + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. /// + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// /// /// The name of the resource group. /// @@ -262,8 +266,7 @@ public partial interface IP2sVpnGatewaysOperations /// The name of the P2SVpnGateway. /// /// - /// Request parameters supplied to get p2s vpn connections detailed - /// health. + /// Request parameters supplied to get p2s vpn connections detailed health. /// /// /// The headers that will be added to request. @@ -277,18 +280,20 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in - /// the specified resource group. + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. /// + /// + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. + /// /// /// The name of the resource group. /// - /// + /// /// The name of the P2S Vpn Gateway. /// /// @@ -303,14 +308,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DisconnectP2sVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DisconnectP2SVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else - /// updates the existing gateway. + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. /// + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -318,8 +325,7 @@ public partial interface IP2sVpnGatewaysOperations /// The name of the gateway. /// /// - /// Parameters supplied to create or Update a virtual wan p2s vpn - /// gateway. + /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. /// /// /// The headers that will be added to request. @@ -333,13 +339,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates virtual wan p2s vpn gateway tags. /// + /// + /// Updates virtual wan p2s vpn gateway tags. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -361,13 +368,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a virtual wan p2s vpn gateway. /// + /// + /// Deletes a virtual wan p2s vpn gateway. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -383,14 +391,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the primary of the p2s vpn gateway in the specified resource - /// group. + /// Resets the primary of the p2s vpn gateway in the specified resource group. /// + /// + /// Resets the primary of the p2s vpn gateway in the specified resource group. + /// /// /// The resource group name of the P2SVpnGateway. /// @@ -409,14 +417,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the - /// specified resource group. + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. /// + /// + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -424,8 +434,8 @@ public partial interface IP2sVpnGatewaysOperations /// The name of the P2SVpnGateway. /// /// - /// Parameters supplied to the generate P2SVpnGateway VPN client - /// package operation. + /// Parameters supplied to the generate P2SVpnGateway VPN client package + /// operation. /// /// /// The headers that will be added to request. @@ -439,14 +449,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the connection health of P2S clients of the virtual wan - /// P2SVpnGateway in the specified resource group. + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. /// + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// /// /// The name of the resource group. /// @@ -465,14 +477,16 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetP2sVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetP2SVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the sas url to get the connection health detail of P2S clients - /// of the virtual wan P2SVpnGateway in the specified resource group. + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. /// + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// /// /// The name of the resource group. /// @@ -480,8 +494,7 @@ public partial interface IP2sVpnGatewaysOperations /// The name of the P2SVpnGateway. /// /// - /// Request parameters supplied to get p2s vpn connections detailed - /// health. + /// Request parameters supplied to get p2s vpn connections detailed health. /// /// /// The headers that will be added to request. @@ -495,18 +508,20 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in - /// the specified resource group. + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. /// + /// + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. + /// /// /// The name of the resource group. /// - /// + /// /// The name of the P2S Vpn Gateway. /// /// @@ -521,13 +536,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDisconnectP2sVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDisconnectP2SVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the P2SVpnGateways in a resource group. /// + /// + /// Lists all the P2SVpnGateways in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -543,13 +559,14 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the P2SVpnGateways in a subscription. /// + /// + /// Lists all the P2SVpnGateways in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -565,9 +582,7 @@ public partial interface IP2sVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPacketCapturesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPacketCapturesOperations.cs index dcdf47833d61..a404aa73aeb0 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPacketCapturesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPacketCapturesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PacketCapturesOperations operations. @@ -26,6 +16,9 @@ public partial interface IPacketCapturesOperations /// /// Create and start a packet capture on the specified VM. /// + /// + /// Create and start a packet capture on the specified VM. + /// /// /// The name of the resource group. /// @@ -44,19 +37,20 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a packet capture session by name. /// + /// + /// Gets a packet capture session by name. + /// /// /// The name of the resource group. /// @@ -72,19 +66,20 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified packet capture session. /// + /// + /// Deletes the specified packet capture session. + /// /// /// The name of the resource group. /// @@ -100,16 +95,17 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stops a specified packet capture session. /// + /// + /// Stops a specified packet capture session. + /// /// /// The name of the resource group. /// @@ -125,16 +121,17 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Query the status of a running packet capture session. /// + /// + /// Query the status of a running packet capture session. + /// /// /// The name of the resource group. /// @@ -150,20 +147,20 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all packet capture sessions within the specified resource - /// group. + /// Lists all packet capture sessions within the specified resource group. /// + /// + /// Lists all packet capture sessions within the specified resource group. + /// /// /// The name of the resource group. /// @@ -176,19 +173,20 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create and start a packet capture on the specified VM. /// + /// + /// Create and start a packet capture on the specified VM. + /// /// /// The name of the resource group. /// @@ -207,19 +205,20 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified packet capture session. /// + /// + /// Deletes the specified packet capture session. + /// /// /// The name of the resource group. /// @@ -235,16 +234,17 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stops a specified packet capture session. /// + /// + /// Stops a specified packet capture session. + /// /// /// The name of the resource group. /// @@ -260,16 +260,17 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Query the status of a running packet capture session. /// + /// + /// Query the status of a running packet capture session. + /// /// /// The name of the resource group. /// @@ -285,15 +286,13 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPeerExpressRouteCircuitConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPeerExpressRouteCircuitConnectionsOperations.cs index 5c983d3bf2fa..9097b39615d8 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPeerExpressRouteCircuitConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPeerExpressRouteCircuitConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PeerExpressRouteCircuitConnectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IPeerExpressRouteCircuitConnectionsOperations { /// - /// Gets the specified Peer Express Route Circuit Connection from the - /// specified express route circuit. + /// Gets the specified Peer Express Route Circuit Connection from the specified + /// express route circuit. /// + /// + /// Gets the specified Peer Express Route Circuit Connection from the specified + /// express route circuit. + /// /// /// The name of the resource group. /// @@ -51,14 +45,16 @@ public partial interface IPeerExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all global reach peer connections associated with a private - /// peering in an express route circuit. + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. /// + /// + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. + /// /// /// The name of the resource group. /// @@ -80,14 +76,16 @@ public partial interface IPeerExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all global reach peer connections associated with a private - /// peering in an express route circuit. + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. /// + /// + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -103,9 +101,7 @@ public partial interface IPeerExpressRouteCircuitConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPrivateDnsZoneGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPrivateDnsZoneGroupsOperations.cs index df868db301d7..180d1243d84e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPrivateDnsZoneGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPrivateDnsZoneGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateDnsZoneGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// Deletes the specified private dns zone group. /// + /// + /// Deletes the specified private dns zone group. + /// /// /// The name of the resource group. /// @@ -44,14 +37,16 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the private dns zone group resource by specified private dns - /// zone group name. + /// Gets the private dns zone group resource by specified private dns zone + /// group name. /// + /// + /// Gets the private dns zone group resource by specified private dns zone + /// group name. + /// /// /// The name of the resource group. /// @@ -73,14 +68,16 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a private dns zone group in the specified - /// private endpoint. + /// Creates or updates a private dns zone group in the specified private + /// endpoint. /// + /// + /// Creates or updates a private dns zone group in the specified private + /// endpoint. + /// /// /// The name of the resource group. /// @@ -106,13 +103,14 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private dns zone groups in a private endpoint. /// + /// + /// Gets all private dns zone groups in a private endpoint. + /// /// /// The name of the private endpoint. /// @@ -125,19 +123,20 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string privateEndpointName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string privateEndpointName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified private dns zone group. /// + /// + /// Deletes the specified private dns zone group. + /// /// /// The name of the resource group. /// @@ -156,14 +155,16 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a private dns zone group in the specified - /// private endpoint. + /// Creates or updates a private dns zone group in the specified private + /// endpoint. /// + /// + /// Creates or updates a private dns zone group in the specified private + /// endpoint. + /// /// /// The name of the resource group. /// @@ -189,13 +190,14 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private dns zone groups in a private endpoint. /// + /// + /// Gets all private dns zone groups in a private endpoint. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -205,15 +207,13 @@ public partial interface IPrivateDnsZoneGroupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPrivateEndpointsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPrivateEndpointsOperations.cs index 6701ab96f7f2..2b04d2c8ded5 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPrivateEndpointsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPrivateEndpointsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateEndpointsOperations operations. @@ -26,6 +16,9 @@ public partial interface IPrivateEndpointsOperations /// /// Deletes the specified private endpoint. /// + /// + /// Deletes the specified private endpoint. + /// /// /// The name of the resource group. /// @@ -38,16 +31,17 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified private endpoint by resource group. /// + /// + /// Gets the specified private endpoint by resource group. + /// /// /// The name of the resource group. /// @@ -63,20 +57,20 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an private endpoint in the specified resource - /// group. + /// Creates or updates an private endpoint in the specified resource group. /// + /// + /// Creates or updates an private endpoint in the specified resource group. + /// /// /// The name of the resource group. /// @@ -84,8 +78,7 @@ public partial interface IPrivateEndpointsOperations /// The name of the private endpoint. /// /// - /// Parameters supplied to the create or update private endpoint - /// operation. + /// Parameters supplied to the create or update private endpoint operation. /// /// /// The headers that will be added to request. @@ -93,19 +86,20 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private endpoints in a resource group. /// + /// + /// Gets all private endpoints in a resource group. + /// /// /// The name of the resource group. /// @@ -115,38 +109,40 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private endpoints in a subscription. /// + /// + /// Gets all private endpoints in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified private endpoint. /// + /// + /// Deletes the specified private endpoint. + /// /// /// The name of the resource group. /// @@ -159,17 +155,17 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an private endpoint in the specified resource - /// group. + /// Creates or updates an private endpoint in the specified resource group. /// + /// + /// Creates or updates an private endpoint in the specified resource group. + /// /// /// The name of the resource group. /// @@ -177,8 +173,7 @@ public partial interface IPrivateEndpointsOperations /// The name of the private endpoint. /// /// - /// Parameters supplied to the create or update private endpoint - /// operation. + /// Parameters supplied to the create or update private endpoint operation. /// /// /// The headers that will be added to request. @@ -186,19 +181,20 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private endpoints in a resource group. /// + /// + /// Gets all private endpoints in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,19 +204,20 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private endpoints in a subscription. /// + /// + /// Gets all private endpoints in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -230,15 +227,13 @@ public partial interface IPrivateEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPrivateLinkServicesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPrivateLinkServicesOperations.cs index 2ba2f466d411..94191bb3bd72 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPrivateLinkServicesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPrivateLinkServicesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateLinkServicesOperations operations. @@ -26,6 +16,9 @@ public partial interface IPrivateLinkServicesOperations /// /// Deletes the specified private link service. /// + /// + /// Deletes the specified private link service. + /// /// /// The name of the resource group. /// @@ -38,16 +31,17 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified private link service by resource group. /// + /// + /// Gets the specified private link service by resource group. + /// /// /// The name of the resource group. /// @@ -63,20 +57,20 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an private link service in the specified - /// resource group. + /// Creates or updates an private link service in the specified resource group. /// + /// + /// Creates or updates an private link service in the specified resource group. + /// /// /// The name of the resource group. /// @@ -84,8 +78,7 @@ public partial interface IPrivateLinkServicesOperations /// The name of the private link service. /// /// - /// Parameters supplied to the create or update private link service - /// operation. + /// Parameters supplied to the create or update private link service operation. /// /// /// The headers that will be added to request. @@ -93,19 +86,20 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private link services in a resource group. /// + /// + /// Gets all private link services in a resource group. + /// /// /// The name of the resource group. /// @@ -115,39 +109,42 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private link service in a subscription. /// + /// + /// Gets all private link service in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the specific private end point connection by specific private - /// link service in the resource group. + /// Get the specific private end point connection by specific private link + /// service in the resource group. /// + /// + /// Get the specific private end point connection by specific private link + /// service in the resource group. + /// /// /// The name of the resource group. /// @@ -166,20 +163,22 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve or reject private end point connection for a private link - /// service in a subscription. + /// Approve or reject private end point connection for a private link service + /// in a subscription. /// + /// + /// Approve or reject private end point connection for a private link service + /// in a subscription. + /// /// /// The name of the resource group. /// @@ -190,8 +189,7 @@ public partial interface IPrivateLinkServicesOperations /// The name of the private end point connection. /// /// - /// Parameters supplied to approve or reject the private end point - /// connection. + /// Parameters supplied to approve or reject the private end point connection. /// /// /// The headers that will be added to request. @@ -199,20 +197,22 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete private end point connection for a private link service in a /// subscription. /// + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// /// /// The name of the resource group. /// @@ -228,17 +228,17 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all private end point connections for a specific private link - /// service. + /// Gets all private end point connections for a specific private link service. /// + /// + /// Gets all private end point connections for a specific private link service. + /// /// /// The name of the resource group. /// @@ -251,19 +251,20 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the subscription is visible to private link service. /// + /// + /// Checks whether the subscription is visible to private link service. + /// /// /// The location of the domain name. /// @@ -282,14 +283,16 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Checks whether the subscription is visible to private link service - /// in the specified resource group. + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. /// + /// + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. + /// /// /// The location of the domain name. /// @@ -311,15 +314,16 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the private link service ids that can be linked to a - /// Private Endpoint with auto approved in this subscription in this - /// region. + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. /// + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// /// /// The location of the domain name. /// @@ -335,15 +339,16 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAutoApprovedPrivateLinkServicesWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the private link service ids that can be linked to a - /// Private Endpoint with auto approved in this subscription in this - /// region. + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. /// + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// /// /// The location of the domain name. /// @@ -362,13 +367,14 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified private link service. /// + /// + /// Deletes the specified private link service. + /// /// /// The name of the resource group. /// @@ -381,17 +387,17 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates an private link service in the specified - /// resource group. + /// Creates or updates an private link service in the specified resource group. /// + /// + /// Creates or updates an private link service in the specified resource group. + /// /// /// The name of the resource group. /// @@ -399,8 +405,7 @@ public partial interface IPrivateLinkServicesOperations /// The name of the private link service. /// /// - /// Parameters supplied to the create or update private link service - /// operation. + /// Parameters supplied to the create or update private link service operation. /// /// /// The headers that will be added to request. @@ -408,20 +413,22 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete private end point connection for a private link service in a /// subscription. /// + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// /// /// The name of the resource group. /// @@ -437,16 +444,17 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether the subscription is visible to private link service. /// + /// + /// Checks whether the subscription is visible to private link service. + /// /// /// The location of the domain name. /// @@ -465,14 +473,16 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Checks whether the subscription is visible to private link service - /// in the specified resource group. + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. /// + /// + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. + /// /// /// The location of the domain name. /// @@ -494,13 +504,14 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private link services in a resource group. /// + /// + /// Gets all private link services in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -510,19 +521,20 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all private link service in a subscription. /// + /// + /// Gets all private link service in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -532,20 +544,20 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all private end point connections for a specific private link - /// service. + /// Gets all private end point connections for a specific private link service. /// + /// + /// Gets all private end point connections for a specific private link service. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -555,21 +567,22 @@ public partial interface IPrivateLinkServicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the private link service ids that can be linked to a - /// Private Endpoint with auto approved in this subscription in this - /// region. + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. /// + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -585,15 +598,16 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAutoApprovedPrivateLinkServicesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Returns all of the private link service ids that can be linked to a - /// Private Endpoint with auto approved in this subscription in this - /// region. + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. /// + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -609,9 +623,7 @@ public partial interface IPrivateLinkServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPublicIPAddressesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPublicIPAddressesOperations.cs index 4ad78cad806c..65c6d6a7d5aa 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPublicIPAddressesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPublicIPAddressesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PublicIPAddressesOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Network public partial interface IPublicIPAddressesOperations { /// - /// Gets information about all public IP addresses on a cloud service - /// level. + /// Gets information about all public IP addresses on a cloud service level. /// + /// + /// Gets information about all public IP addresses on a cloud service level. + /// /// /// The name of the resource group. /// @@ -45,14 +37,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServicePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServicePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses in a role instance - /// IP configuration in a cloud service. + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. /// + /// + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. + /// /// /// The name of the resource group. /// @@ -80,13 +74,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServiceRoleInstancePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServiceRoleInstancePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified public IP address in a cloud service. /// + /// + /// Get the specified public IP address in a cloud service. + /// /// /// The name of the resource group. /// @@ -120,13 +115,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetCloudServicePublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetCloudServicePublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified public IP address. /// + /// + /// Deletes the specified public IP address. + /// /// /// The name of the resource group. /// @@ -142,13 +138,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified public IP address in a specified resource group. /// + /// + /// Gets the specified public IP address in a specified resource group. + /// /// /// The name of the resource group. /// @@ -170,13 +167,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a static or dynamic public IP address. /// + /// + /// Creates or updates a static or dynamic public IP address. + /// /// /// The name of the resource group. /// @@ -184,8 +182,7 @@ public partial interface IPublicIPAddressesOperations /// The name of the public IP address. /// /// - /// Parameters supplied to the create or update public IP address - /// operation. + /// Parameters supplied to the create or update public IP address operation. /// /// /// The headers that will be added to request. @@ -199,13 +196,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates public IP address tags. /// + /// + /// Updates public IP address tags. + /// /// /// The name of the resource group. /// @@ -227,13 +225,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the public IP addresses in a subscription. /// + /// + /// Gets all the public IP addresses in a subscription. + /// /// /// The headers that will be added to request. /// @@ -246,13 +245,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all public IP addresses in a resource group. /// + /// + /// Gets all public IP addresses in a resource group. + /// /// /// The name of the resource group. /// @@ -268,13 +268,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the Ddos Protection Status of a Public IP Address /// + /// + /// Gets the Ddos Protection Status of a Public IP Address + /// /// /// The name of the resource group. /// @@ -293,14 +294,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> DdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses on a virtual machine - /// scale set level. + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. /// + /// + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. + /// /// /// The name of the resource group. /// @@ -319,14 +322,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses in a virtual machine - /// IP configuration in a virtual machine scale set. + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. /// + /// + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. + /// /// /// The name of the resource group. /// @@ -354,13 +359,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified public IP address in a virtual machine scale set. /// + /// + /// Get the specified public IP address in a virtual machine scale set. + /// /// /// The name of the resource group. /// @@ -394,13 +400,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified public IP address. /// + /// + /// Deletes the specified public IP address. + /// /// /// The name of the resource group. /// @@ -416,13 +423,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a static or dynamic public IP address. /// + /// + /// Creates or updates a static or dynamic public IP address. + /// /// /// The name of the resource group. /// @@ -430,8 +438,7 @@ public partial interface IPublicIPAddressesOperations /// The name of the public IP address. /// /// - /// Parameters supplied to the create or update public IP address - /// operation. + /// Parameters supplied to the create or update public IP address operation. /// /// /// The headers that will be added to request. @@ -445,13 +452,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the Ddos Protection Status of a Public IP Address /// + /// + /// Gets the Ddos Protection Status of a Public IP Address + /// /// /// The name of the resource group. /// @@ -470,14 +478,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses on a cloud service - /// level. + /// Gets information about all public IP addresses on a cloud service level. /// + /// + /// Gets information about all public IP addresses on a cloud service level. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -493,14 +501,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServicePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServicePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses in a role instance - /// IP configuration in a cloud service. + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. /// + /// + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -516,13 +526,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListCloudServiceRoleInstancePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListCloudServiceRoleInstancePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the public IP addresses in a subscription. /// + /// + /// Gets all the public IP addresses in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -538,13 +549,14 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all public IP addresses in a resource group. /// + /// + /// Gets all public IP addresses in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -560,14 +572,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses on a virtual machine - /// scale set level. + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. /// + /// + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -583,14 +597,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about all public IP addresses in a virtual machine - /// IP configuration in a virtual machine scale set. + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. /// + /// + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -606,9 +622,7 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IPublicIPPrefixesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IPublicIPPrefixesOperations.cs index 8cfa8c33e3fd..25951da35111 100644 --- a/src/Network/Network.Management.Sdk/Generated/IPublicIPPrefixesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IPublicIPPrefixesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PublicIPPrefixesOperations operations. @@ -26,6 +16,9 @@ public partial interface IPublicIPPrefixesOperations /// /// Deletes the specified public IP prefix. /// + /// + /// Deletes the specified public IP prefix. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified public IP prefix in a specified resource group. /// + /// + /// Gets the specified public IP prefix in a specified resource group. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a static or dynamic public IP prefix. /// + /// + /// Creates or updates a static or dynamic public IP prefix. + /// /// /// The name of the resource group. /// @@ -83,8 +78,7 @@ public partial interface IPublicIPPrefixesOperations /// The name of the public IP prefix. /// /// - /// Parameters supplied to the create or update public IP prefix - /// operation. + /// Parameters supplied to the create or update public IP prefix operation. /// /// /// The headers that will be added to request. @@ -98,13 +92,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates public IP prefix tags. /// + /// + /// Updates public IP prefix tags. + /// /// /// The name of the resource group. /// @@ -126,13 +121,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the public IP prefixes in a subscription. /// + /// + /// Gets all the public IP prefixes in a subscription. + /// /// /// The headers that will be added to request. /// @@ -145,13 +141,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all public IP prefixes in a resource group. /// + /// + /// Gets all public IP prefixes in a resource group. + /// /// /// The name of the resource group. /// @@ -167,13 +164,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified public IP prefix. /// + /// + /// Deletes the specified public IP prefix. + /// /// /// The name of the resource group. /// @@ -189,13 +187,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a static or dynamic public IP prefix. /// + /// + /// Creates or updates a static or dynamic public IP prefix. + /// /// /// The name of the resource group. /// @@ -203,8 +202,7 @@ public partial interface IPublicIPPrefixesOperations /// The name of the public IP prefix. /// /// - /// Parameters supplied to the create or update public IP prefix - /// operation. + /// Parameters supplied to the create or update public IP prefix operation. /// /// /// The headers that will be added to request. @@ -218,13 +216,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the public IP prefixes in a subscription. /// + /// + /// Gets all the public IP prefixes in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -240,13 +239,14 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all public IP prefixes in a resource group. /// + /// + /// Gets all public IP prefixes in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -262,9 +262,7 @@ public partial interface IPublicIPPrefixesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IResourceNavigationLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/IResourceNavigationLinksOperations.cs index dc577a730056..322e4b1e499f 100644 --- a/src/Network/Network.Management.Sdk/Generated/IResourceNavigationLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IResourceNavigationLinksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ResourceNavigationLinksOperations operations. @@ -26,6 +16,9 @@ public partial interface IResourceNavigationLinksOperations /// /// Gets a list of resource navigation links for a subnet. /// + /// + /// Gets a list of resource navigation links for a subnet. + /// /// /// The name of the resource group. /// @@ -47,9 +40,7 @@ public partial interface IResourceNavigationLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IRouteFilterRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IRouteFilterRulesOperations.cs index f79aac857d6b..fa4a3a30388e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IRouteFilterRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IRouteFilterRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RouteFilterRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface IRouteFilterRulesOperations /// /// Deletes the specified rule from a route filter. /// + /// + /// Deletes the specified rule from a route filter. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified rule from a route filter. /// + /// + /// Gets the specified rule from a route filter. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a route in the specified route filter. /// + /// + /// Creates or updates a route in the specified route filter. + /// /// /// The name of the resource group. /// @@ -89,8 +84,7 @@ public partial interface IRouteFilterRulesOperations /// The name of the route filter rule. /// /// - /// Parameters supplied to the create or update route filter rule - /// operation. + /// Parameters supplied to the create or update route filter rule operation. /// /// /// The headers that will be added to request. @@ -104,13 +98,14 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all RouteFilterRules in a route filter. /// + /// + /// Gets all RouteFilterRules in a route filter. + /// /// /// The name of the resource group. /// @@ -129,13 +124,14 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByRouteFilterWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByRouteFilterWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified rule from a route filter. /// + /// + /// Deletes the specified rule from a route filter. + /// /// /// The name of the resource group. /// @@ -154,13 +150,14 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a route in the specified route filter. /// + /// + /// Creates or updates a route in the specified route filter. + /// /// /// The name of the resource group. /// @@ -171,8 +168,7 @@ public partial interface IRouteFilterRulesOperations /// The name of the route filter rule. /// /// - /// Parameters supplied to the create or update route filter rule - /// operation. + /// Parameters supplied to the create or update route filter rule operation. /// /// /// The headers that will be added to request. @@ -186,13 +182,14 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all RouteFilterRules in a route filter. /// + /// + /// Gets all RouteFilterRules in a route filter. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +205,7 @@ public partial interface IRouteFilterRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByRouteFilterNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByRouteFilterNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IRouteFiltersOperations.cs b/src/Network/Network.Management.Sdk/Generated/IRouteFiltersOperations.cs index 62059ce0cce4..b3ce9c867092 100644 --- a/src/Network/Network.Management.Sdk/Generated/IRouteFiltersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IRouteFiltersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RouteFiltersOperations operations. @@ -26,6 +16,9 @@ public partial interface IRouteFiltersOperations /// /// Deletes the specified route filter. /// + /// + /// Deletes the specified route filter. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified route filter. /// + /// + /// Gets the specified route filter. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a route filter in a specified resource group. /// + /// + /// Creates or updates a route filter in a specified resource group. + /// /// /// The name of the resource group. /// @@ -97,13 +92,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of a route filter. /// + /// + /// Updates tags of a route filter. + /// /// /// The name of the resource group. /// @@ -125,13 +121,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route filters in a resource group. /// + /// + /// Gets all route filters in a resource group. + /// /// /// The name of the resource group. /// @@ -147,13 +144,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route filters in a subscription. /// + /// + /// Gets all route filters in a subscription. + /// /// /// The headers that will be added to request. /// @@ -166,13 +164,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified route filter. /// + /// + /// Deletes the specified route filter. + /// /// /// The name of the resource group. /// @@ -188,13 +187,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a route filter in a specified resource group. /// + /// + /// Creates or updates a route filter in a specified resource group. + /// /// /// The name of the resource group. /// @@ -216,13 +216,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route filters in a resource group. /// + /// + /// Gets all route filters in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -238,13 +239,14 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route filters in a subscription. /// + /// + /// Gets all route filters in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -260,9 +262,7 @@ public partial interface IRouteFiltersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IRouteMapsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IRouteMapsOperations.cs index 5df9fd1409a3..802a7ca5fe30 100644 --- a/src/Network/Network.Management.Sdk/Generated/IRouteMapsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IRouteMapsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RouteMapsOperations operations. @@ -26,8 +16,11 @@ public partial interface IRouteMapsOperations /// /// Retrieves the details of a RouteMap. /// + /// + /// Retrieves the details of a RouteMap. + /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -47,16 +40,16 @@ public partial interface IRouteMapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a RouteMap if it doesn't exist else updates the existing - /// one. + /// Creates a RouteMap if it doesn't exist else updates the existing one. /// + /// + /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -79,15 +72,16 @@ public partial interface IRouteMapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a RouteMap. /// + /// + /// Deletes a RouteMap. + /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -104,15 +98,16 @@ public partial interface IRouteMapsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all RouteMaps. /// + /// + /// Retrieves the details of all RouteMaps. + /// /// - /// The resource group name of the RouteMap's resource group'. + /// The resource group name of the RouteMap's resource group'. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -129,16 +124,16 @@ public partial interface IRouteMapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a RouteMap if it doesn't exist else updates the existing - /// one. + /// Creates a RouteMap if it doesn't exist else updates the existing one. /// + /// + /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -161,15 +156,16 @@ public partial interface IRouteMapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a RouteMap. /// + /// + /// Deletes a RouteMap. + /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -186,13 +182,14 @@ public partial interface IRouteMapsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all RouteMaps. /// + /// + /// Retrieves the details of all RouteMaps. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +205,7 @@ public partial interface IRouteMapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IRouteTablesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IRouteTablesOperations.cs index 6b890b22d3c5..06dd555297d6 100644 --- a/src/Network/Network.Management.Sdk/Generated/IRouteTablesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IRouteTablesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RouteTablesOperations operations. @@ -26,6 +16,9 @@ public partial interface IRouteTablesOperations /// /// Deletes the specified route table. /// + /// + /// Deletes the specified route table. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified route table. /// + /// + /// Gets the specified route table. + /// /// /// The name of the resource group. /// @@ -69,13 +63,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or updates a route table in a specified resource group. /// + /// + /// Create or updates a route table in a specified resource group. + /// /// /// The name of the resource group. /// @@ -97,13 +92,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a route table tags. /// + /// + /// Updates a route table tags. + /// /// /// The name of the resource group. /// @@ -125,13 +121,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route tables in a resource group. /// + /// + /// Gets all route tables in a resource group. + /// /// /// The name of the resource group. /// @@ -147,13 +144,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route tables in a subscription. /// + /// + /// Gets all route tables in a subscription. + /// /// /// The headers that will be added to request. /// @@ -166,13 +164,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified route table. /// + /// + /// Deletes the specified route table. + /// /// /// The name of the resource group. /// @@ -188,13 +187,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or updates a route table in a specified resource group. /// + /// + /// Create or updates a route table in a specified resource group. + /// /// /// The name of the resource group. /// @@ -216,13 +216,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route tables in a resource group. /// + /// + /// Gets all route tables in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -238,13 +239,14 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all route tables in a subscription. /// + /// + /// Gets all route tables in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -260,9 +262,7 @@ public partial interface IRouteTablesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IRoutesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IRoutesOperations.cs index dde9aad6f394..960773d0c144 100644 --- a/src/Network/Network.Management.Sdk/Generated/IRoutesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IRoutesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RoutesOperations operations. @@ -26,6 +16,9 @@ public partial interface IRoutesOperations /// /// Deletes the specified route from a route table. /// + /// + /// Deletes the specified route from a route table. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IRoutesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified route from a route table. /// + /// + /// Gets the specified route from a route table. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface IRoutesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a route in the specified route table. /// + /// + /// Creates or updates a route in the specified route table. + /// /// /// The name of the resource group. /// @@ -103,13 +98,14 @@ public partial interface IRoutesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all routes in a route table. /// + /// + /// Gets all routes in a route table. + /// /// /// The name of the resource group. /// @@ -128,13 +124,14 @@ public partial interface IRoutesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified route from a route table. /// + /// + /// Deletes the specified route from a route table. + /// /// /// The name of the resource group. /// @@ -153,13 +150,14 @@ public partial interface IRoutesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a route in the specified route table. /// + /// + /// Creates or updates a route in the specified route table. + /// /// /// The name of the resource group. /// @@ -184,13 +182,14 @@ public partial interface IRoutesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all routes in a route table. /// + /// + /// Gets all routes in a route table. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -206,9 +205,7 @@ public partial interface IRoutesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IRoutingIntentOperations.cs b/src/Network/Network.Management.Sdk/Generated/IRoutingIntentOperations.cs index 4ccdd2039bfa..42ab2df3d42c 100644 --- a/src/Network/Network.Management.Sdk/Generated/IRoutingIntentOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IRoutingIntentOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RoutingIntentOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IRoutingIntentOperations { /// - /// Creates a RoutingIntent resource if it doesn't exist else updates - /// the existing RoutingIntent. + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. /// + /// + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. + /// /// /// The resource group name of the RoutingIntent. /// @@ -51,13 +45,14 @@ public partial interface IRoutingIntentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of a RoutingIntent. /// + /// + /// Retrieves the details of a RoutingIntent. + /// /// /// The resource group name of the RoutingIntent. /// @@ -79,13 +74,14 @@ public partial interface IRoutingIntentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a RoutingIntent. /// + /// + /// Deletes a RoutingIntent. + /// /// /// The resource group name of the RoutingIntent. /// @@ -104,14 +100,16 @@ public partial interface IRoutingIntentOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all RoutingIntent child resources of the /// VirtualHub. /// + /// + /// Retrieves the details of all RoutingIntent child resources of the + /// VirtualHub. + /// /// /// The resource group name of the VirtualHub. /// @@ -130,14 +128,16 @@ public partial interface IRoutingIntentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a RoutingIntent resource if it doesn't exist else updates - /// the existing RoutingIntent. + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. /// + /// + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. + /// /// /// The resource group name of the RoutingIntent. /// @@ -162,13 +162,14 @@ public partial interface IRoutingIntentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a RoutingIntent. /// + /// + /// Deletes a RoutingIntent. + /// /// /// The resource group name of the RoutingIntent. /// @@ -187,14 +188,16 @@ public partial interface IRoutingIntentOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all RoutingIntent child resources of the /// VirtualHub. /// + /// + /// Retrieves the details of all RoutingIntent child resources of the + /// VirtualHub. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +213,7 @@ public partial interface IRoutingIntentOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IScopeConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IScopeConnectionsOperations.cs index 5d47ba005e8c..9e6b4c6a3c9f 100644 --- a/src/Network/Network.Management.Sdk/Generated/IScopeConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IScopeConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ScopeConnectionsOperations operations. @@ -26,9 +16,9 @@ public partial interface IScopeConnectionsOperations /// /// Creates or updates scope connection from Network Manager /// - /// - /// Scope connection to be created/updated. - /// + /// + /// Creates or updates scope connection from Network Manager + /// /// /// The name of the resource group. /// @@ -38,6 +28,9 @@ public partial interface IScopeConnectionsOperations /// /// Name for the cross-tenant connection. /// + /// + /// Scope connection to be created/updated. + /// /// /// The headers that will be added to request. /// @@ -50,13 +43,14 @@ public partial interface IScopeConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, ScopeConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get specified scope connection created by this Network Manager. /// + /// + /// Get specified scope connection created by this Network Manager. + /// /// /// The name of the resource group. /// @@ -78,14 +72,14 @@ public partial interface IScopeConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete the pending scope connection created by this network - /// manager. + /// Delete the pending scope connection created by this network manager. /// + /// + /// Delete the pending scope connection created by this network manager. + /// /// /// The name of the resource group. /// @@ -104,13 +98,14 @@ public partial interface IScopeConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all scope connections created by this network manager. /// + /// + /// List all scope connections created by this network manager. + /// /// /// The name of the resource group. /// @@ -118,14 +113,14 @@ public partial interface IScopeConnectionsOperations /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -139,13 +134,14 @@ public partial interface IScopeConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all scope connections created by this network manager. /// + /// + /// List all scope connections created by this network manager. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -161,9 +157,7 @@ public partial interface IScopeConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ISecurityAdminConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ISecurityAdminConfigurationsOperations.cs index 8f7e2a084558..3c74bb10c453 100644 --- a/src/Network/Network.Management.Sdk/Generated/ISecurityAdminConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ISecurityAdminConfigurationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SecurityAdminConfigurationsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface ISecurityAdminConfigurationsOperations { /// - /// Lists all the network manager security admin configurations in a - /// network manager, in a paginated format. + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. /// + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// /// /// The name of the resource group. /// @@ -34,14 +28,14 @@ public partial interface ISecurityAdminConfigurationsOperations /// The name of the network manager. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -55,13 +49,14 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves a network manager security admin configuration. /// + /// + /// Retrieves a network manager security admin configuration. + /// /// /// The name of the resource group. /// @@ -83,16 +78,14 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a network manager security admin configuration. /// - /// - /// The security admin configuration to create or update - /// + /// + /// Creates or updates a network manager security admin configuration. + /// /// /// The name of the resource group. /// @@ -102,6 +95,9 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// The name of the network manager Security Configuration. /// + /// + /// The security admin configuration to create or update + /// /// /// The headers that will be added to request. /// @@ -114,13 +110,14 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(SecurityAdminConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, SecurityAdminConfiguration securityAdminConfiguration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a network manager security admin configuration. /// + /// + /// Deletes a network manager security admin configuration. + /// /// /// The name of the resource group. /// @@ -131,10 +128,9 @@ public partial interface ISecurityAdminConfigurationsOperations /// The name of the network manager Security Configuration. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -145,13 +141,14 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a network manager security admin configuration. /// + /// + /// Deletes a network manager security admin configuration. + /// /// /// The name of the resource group. /// @@ -162,10 +159,9 @@ public partial interface ISecurityAdminConfigurationsOperations /// The name of the network manager Security Configuration. /// /// - /// Deletes the resource even if it is part of a deployed - /// configuration. If the configuration has been deployed, the service - /// will do a cleanup deployment in the background, prior to the - /// delete. + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. /// /// /// The headers that will be added to request. @@ -176,14 +172,16 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the network manager security admin configurations in a - /// network manager, in a paginated format. + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. /// + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -199,9 +197,7 @@ public partial interface ISecurityAdminConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ISecurityPartnerProvidersOperations.cs b/src/Network/Network.Management.Sdk/Generated/ISecurityPartnerProvidersOperations.cs index 64ef73b27bfd..700d338b40e0 100644 --- a/src/Network/Network.Management.Sdk/Generated/ISecurityPartnerProvidersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ISecurityPartnerProvidersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SecurityPartnerProvidersOperations operations. @@ -26,6 +16,9 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Deletes the specified Security Partner Provider. /// + /// + /// Deletes the specified Security Partner Provider. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Security Partner Provider. /// + /// + /// Gets the specified Security Partner Provider. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Security Partner Provider. /// + /// + /// Creates or updates the specified Security Partner Provider. + /// /// /// The name of the resource group. /// @@ -80,8 +75,8 @@ public partial interface ISecurityPartnerProvidersOperations /// The name of the Security Partner Provider. /// /// - /// Parameters supplied to the create or update Security Partner - /// Provider operation. + /// Parameters supplied to the create or update Security Partner Provider + /// operation. /// /// /// The headers that will be added to request. @@ -95,13 +90,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of a Security Partner Provider resource. /// + /// + /// Updates tags of a Security Partner Provider resource. + /// /// /// The name of the resource group. /// @@ -123,13 +119,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Security Partner Providers in a resource group. /// + /// + /// Lists all Security Partner Providers in a resource group. + /// /// /// The name of the resource group. /// @@ -145,13 +142,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Security Partner Providers in a subscription. /// + /// + /// Gets all the Security Partner Providers in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,13 +162,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Security Partner Provider. /// + /// + /// Deletes the specified Security Partner Provider. + /// /// /// The name of the resource group. /// @@ -186,13 +185,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Security Partner Provider. /// + /// + /// Creates or updates the specified Security Partner Provider. + /// /// /// The name of the resource group. /// @@ -200,8 +200,8 @@ public partial interface ISecurityPartnerProvidersOperations /// The name of the Security Partner Provider. /// /// - /// Parameters supplied to the create or update Security Partner - /// Provider operation. + /// Parameters supplied to the create or update Security Partner Provider + /// operation. /// /// /// The headers that will be added to request. @@ -215,13 +215,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Security Partner Providers in a resource group. /// + /// + /// Lists all Security Partner Providers in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -237,13 +238,14 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Security Partner Providers in a subscription. /// + /// + /// Gets all the Security Partner Providers in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,9 +261,7 @@ public partial interface ISecurityPartnerProvidersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ISecurityRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ISecurityRulesOperations.cs index 77a642b61cde..2ad388ac9a81 100644 --- a/src/Network/Network.Management.Sdk/Generated/ISecurityRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ISecurityRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SecurityRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface ISecurityRulesOperations /// /// Deletes the specified network security rule. /// + /// + /// Deletes the specified network security rule. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ISecurityRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get the specified network security rule. /// + /// + /// Get the specified network security rule. + /// /// /// The name of the resource group. /// @@ -72,14 +66,14 @@ public partial interface ISecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a security rule in the specified network - /// security group. + /// Creates or updates a security rule in the specified network security group. /// + /// + /// Creates or updates a security rule in the specified network security group. + /// /// /// The name of the resource group. /// @@ -105,13 +99,14 @@ public partial interface ISecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all security rules in a network security group. /// + /// + /// Gets all security rules in a network security group. + /// /// /// The name of the resource group. /// @@ -130,13 +125,14 @@ public partial interface ISecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified network security rule. /// + /// + /// Deletes the specified network security rule. + /// /// /// The name of the resource group. /// @@ -155,14 +151,14 @@ public partial interface ISecurityRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a security rule in the specified network - /// security group. + /// Creates or updates a security rule in the specified network security group. /// + /// + /// Creates or updates a security rule in the specified network security group. + /// /// /// The name of the resource group. /// @@ -188,13 +184,14 @@ public partial interface ISecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all security rules in a network security group. /// + /// + /// Gets all security rules in a network security group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +207,7 @@ public partial interface ISecurityRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IServiceAssociationLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/IServiceAssociationLinksOperations.cs index b5bc689f7d97..7004eff2818e 100644 --- a/src/Network/Network.Management.Sdk/Generated/IServiceAssociationLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IServiceAssociationLinksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceAssociationLinksOperations operations. @@ -26,6 +16,9 @@ public partial interface IServiceAssociationLinksOperations /// /// Gets a list of service association links for a subnet. /// + /// + /// Gets a list of service association links for a subnet. + /// /// /// The name of the resource group. /// @@ -47,9 +40,7 @@ public partial interface IServiceAssociationLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPoliciesOperations.cs index b7bae7a6c5fa..7c5095ab0bde 100644 --- a/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPoliciesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceEndpointPoliciesOperations operations. @@ -26,6 +16,9 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Deletes the specified service endpoint policy. /// + /// + /// Deletes the specified service endpoint policy. + /// /// /// The name of the resource group. /// @@ -41,14 +34,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the specified service Endpoint Policies in a specified - /// resource group. + /// Gets the specified service Endpoint Policies in a specified resource group. /// + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// /// /// The name of the resource group. /// @@ -70,13 +63,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a service Endpoint Policies. /// + /// + /// Creates or updates a service Endpoint Policies. + /// /// /// The name of the resource group. /// @@ -99,13 +93,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates tags of a service endpoint policy. /// + /// + /// Updates tags of a service endpoint policy. + /// /// /// The name of the resource group. /// @@ -127,13 +122,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the service endpoint policies in a subscription. /// + /// + /// Gets all the service endpoint policies in a subscription. + /// /// /// The headers that will be added to request. /// @@ -146,13 +142,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all service endpoint Policies in a resource group. /// + /// + /// Gets all service endpoint Policies in a resource group. + /// /// /// The name of the resource group. /// @@ -168,13 +165,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified service endpoint policy. /// + /// + /// Deletes the specified service endpoint policy. + /// /// /// The name of the resource group. /// @@ -190,13 +188,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a service Endpoint Policies. /// + /// + /// Creates or updates a service Endpoint Policies. + /// /// /// The name of the resource group. /// @@ -219,13 +218,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the service endpoint policies in a subscription. /// + /// + /// Gets all the service endpoint policies in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -241,13 +241,14 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all service endpoint Policies in a resource group. /// + /// + /// Gets all service endpoint Policies in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -263,9 +264,7 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPolicyDefinitionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPolicyDefinitionsOperations.cs index dade1976c7f0..72eececda6ce 100644 --- a/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPolicyDefinitionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IServiceEndpointPolicyDefinitionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceEndpointPolicyDefinitionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Deletes the specified ServiceEndpoint policy definitions. /// + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// /// /// The name of the resource group. /// @@ -44,14 +37,16 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the specified service endpoint policy definitions from service - /// endpoint policy. + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. /// + /// + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. + /// /// /// The name of the resource group. /// @@ -73,14 +68,16 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a service endpoint policy definition in the - /// specified service endpoint policy. + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. /// + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// /// /// The name of the resource group. /// @@ -106,14 +103,14 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all service endpoint policy definitions in a service end point - /// policy. + /// Gets all service endpoint policy definitions in a service end point policy. /// + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// /// /// The name of the resource group. /// @@ -132,13 +129,14 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified ServiceEndpoint policy definitions. /// + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// /// /// The name of the resource group. /// @@ -157,14 +155,16 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a service endpoint policy definition in the - /// specified service endpoint policy. + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. /// + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// /// /// The name of the resource group. /// @@ -190,14 +190,14 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all service endpoint policy definitions in a service end point - /// policy. + /// Gets all service endpoint policy definitions in a service end point policy. /// + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -213,9 +213,7 @@ public partial interface IServiceEndpointPolicyDefinitionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IServiceTagInformationOperations.cs b/src/Network/Network.Management.Sdk/Generated/IServiceTagInformationOperations.cs index cea1b58a941d..de3f07d78e16 100644 --- a/src/Network/Network.Management.Sdk/Generated/IServiceTagInformationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IServiceTagInformationOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceTagInformationOperations operations. @@ -26,11 +16,14 @@ public partial interface IServiceTagInformationOperations /// /// Gets a list of service tag information resources with pagination. /// + /// + /// Gets a list of service tag information resources with pagination. + /// /// - /// The location that will be used as a reference for cloud (not as a - /// filter based on location, you will get the list of service tags - /// with prefix details across all regions but limited to the cloud - /// that your subscription belongs to). + /// The location that will be used as a reference for cloud (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). /// /// /// Do not return address prefixes for the tag(s). @@ -50,13 +43,14 @@ public partial interface IServiceTagInformationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of service tag information resources with pagination. /// + /// + /// Gets a list of service tag information resources with pagination. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -72,9 +66,7 @@ public partial interface IServiceTagInformationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IServiceTagsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IServiceTagsOperations.cs index d6e0a0b50a27..59e39ccb660d 100644 --- a/src/Network/Network.Management.Sdk/Generated/IServiceTagsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IServiceTagsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceTagsOperations operations. @@ -26,11 +16,14 @@ public partial interface IServiceTagsOperations /// /// Gets a list of service tag information resources. /// + /// + /// Gets a list of service tag information resources. + /// /// - /// The location that will be used as a reference for version (not as a - /// filter based on location, you will get the list of service tags - /// with prefix details across all regions but limited to the cloud - /// that your subscription belongs to). + /// The location that will be used as a reference for version (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). /// /// /// The headers that will be added to request. @@ -44,9 +37,7 @@ public partial interface IServiceTagsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IStaticMembersOperations.cs b/src/Network/Network.Management.Sdk/Generated/IStaticMembersOperations.cs index 97b088aab4a5..8ff799fbbd4d 100644 --- a/src/Network/Network.Management.Sdk/Generated/IStaticMembersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IStaticMembersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// StaticMembersOperations operations. @@ -26,6 +16,9 @@ public partial interface IStaticMembersOperations /// /// Gets the specified static member. /// + /// + /// Gets the specified static member. + /// /// /// The name of the resource group. /// @@ -50,16 +43,14 @@ public partial interface IStaticMembersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a static member. /// - /// - /// Parameters supplied to the specify the static member to create - /// + /// + /// Creates or updates a static member. + /// /// /// The name of the resource group. /// @@ -72,6 +63,9 @@ public partial interface IStaticMembersOperations /// /// The name of the static member. /// + /// + /// Parameters supplied to the specify the static member to create + /// /// /// The headers that will be added to request. /// @@ -84,13 +78,14 @@ public partial interface IStaticMembersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, StaticMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a static member. /// + /// + /// Deletes a static member. + /// /// /// The name of the resource group. /// @@ -112,13 +107,14 @@ public partial interface IStaticMembersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists the specified static member. /// + /// + /// Lists the specified static member. + /// /// /// The name of the resource group. /// @@ -129,14 +125,14 @@ public partial interface IStaticMembersOperations /// The name of the network group. /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -150,13 +146,14 @@ public partial interface IStaticMembersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists the specified static member. /// + /// + /// Lists the specified static member. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -172,9 +169,7 @@ public partial interface IStaticMembersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ISubnetsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ISubnetsOperations.cs index b4d48b1613ff..40af62663cf1 100644 --- a/src/Network/Network.Management.Sdk/Generated/ISubnetsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ISubnetsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SubnetsOperations operations. @@ -26,6 +16,9 @@ public partial interface ISubnetsOperations /// /// Deletes the specified subnet. /// + /// + /// Deletes the specified subnet. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified subnet by virtual network and resource group. /// + /// + /// Gets the specified subnet by virtual network and resource group. + /// /// /// The name of the resource group. /// @@ -75,13 +69,14 @@ public partial interface ISubnetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a subnet in the specified virtual network. /// + /// + /// Creates or updates a subnet in the specified virtual network. + /// /// /// The name of the resource group. /// @@ -106,13 +101,14 @@ public partial interface ISubnetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Prepares a subnet by applying network intent policies. /// + /// + /// Prepares a subnet by applying network intent policies. + /// /// /// The name of the resource group. /// @@ -123,8 +119,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// Parameters supplied to prepare subnet by applying network intent - /// policies. + /// Parameters supplied to prepare subnet by applying network intent policies. /// /// /// The headers that will be added to request. @@ -135,13 +130,14 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Unprepares a subnet by removing network intent policies. /// + /// + /// Unprepares a subnet by removing network intent policies. + /// /// /// The name of the resource group. /// @@ -152,8 +148,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// Parameters supplied to unprepare subnet to remove network intent - /// policies. + /// Parameters supplied to unprepare subnet to remove network intent policies. /// /// /// The headers that will be added to request. @@ -164,13 +159,14 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task UnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task UnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all subnets in a virtual network. /// + /// + /// Gets all subnets in a virtual network. + /// /// /// The name of the resource group. /// @@ -189,13 +185,14 @@ public partial interface ISubnetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified subnet. /// + /// + /// Deletes the specified subnet. + /// /// /// The name of the resource group. /// @@ -214,13 +211,14 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a subnet in the specified virtual network. /// + /// + /// Creates or updates a subnet in the specified virtual network. + /// /// /// The name of the resource group. /// @@ -245,13 +243,14 @@ public partial interface ISubnetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Prepares a subnet by applying network intent policies. /// + /// + /// Prepares a subnet by applying network intent policies. + /// /// /// The name of the resource group. /// @@ -262,8 +261,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// Parameters supplied to prepare subnet by applying network intent - /// policies. + /// Parameters supplied to prepare subnet by applying network intent policies. /// /// /// The headers that will be added to request. @@ -274,13 +272,14 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Unprepares a subnet by removing network intent policies. /// + /// + /// Unprepares a subnet by removing network intent policies. + /// /// /// The name of the resource group. /// @@ -291,8 +290,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// Parameters supplied to unprepare subnet to remove network intent - /// policies. + /// Parameters supplied to unprepare subnet to remove network intent policies. /// /// /// The headers that will be added to request. @@ -303,13 +301,14 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all subnets in a virtual network. /// + /// + /// Gets all subnets in a virtual network. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -325,9 +324,7 @@ public partial interface ISubnetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ISubscriptionNetworkManagerConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ISubscriptionNetworkManagerConnectionsOperations.cs index 54120aa5e9e1..3fc3e44afde9 100644 --- a/src/Network/Network.Management.Sdk/Generated/ISubscriptionNetworkManagerConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ISubscriptionNetworkManagerConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SubscriptionNetworkManagerConnectionsOperations operations. @@ -26,12 +16,15 @@ public partial interface ISubscriptionNetworkManagerConnectionsOperations /// /// Create a network manager connection on this subscription. /// - /// - /// Network manager connection to be created/updated. - /// + /// + /// Create a network manager connection on this subscription. + /// /// /// Name for the network manager connection. /// + /// + /// Network manager connection to be created/updated. + /// /// /// The headers that will be added to request. /// @@ -44,13 +37,14 @@ public partial interface ISubscriptionNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string networkManagerConnectionName, NetworkManagerConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a specified connection created by this subscription. /// + /// + /// Get a specified connection created by this subscription. + /// /// /// Name for the network manager connection. /// @@ -66,13 +60,14 @@ public partial interface ISubscriptionNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete specified connection created by this subscription. /// + /// + /// Delete specified connection created by this subscription. + /// /// /// Name for the network manager connection. /// @@ -85,22 +80,23 @@ public partial interface ISubscriptionNetworkManagerConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all network manager connections created by this subscription. /// + /// + /// List all network manager connections created by this subscription. + /// /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. /// /// - /// SkipToken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skipToken parameter - /// that specifies a starting point to use for subsequent calls. + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -114,13 +110,14 @@ public partial interface ISubscriptionNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all network manager connections created by this subscription. /// + /// + /// List all network manager connections created by this subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -136,9 +133,7 @@ public partial interface ISubscriptionNetworkManagerConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IUsagesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IUsagesOperations.cs index 27d5b4aa524d..88a6963da3a6 100644 --- a/src/Network/Network.Management.Sdk/Generated/IUsagesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IUsagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// UsagesOperations operations. @@ -26,6 +16,9 @@ public partial interface IUsagesOperations /// /// List network usages for a subscription. /// + /// + /// List network usages for a subscription. + /// /// /// The location where resource usage is queried. /// @@ -41,13 +34,14 @@ public partial interface IUsagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List network usages for a subscription. /// + /// + /// List network usages for a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -63,9 +57,7 @@ public partial interface IUsagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVipSwapOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVipSwapOperations.cs index 7b203d23cfaf..de22fc60c943 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVipSwapOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVipSwapOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VipSwapOperations operations. @@ -24,10 +14,15 @@ namespace Microsoft.Azure.Management.Network public partial interface IVipSwapOperations { /// - /// Gets the SwapResource which identifies the slot type for the - /// specified cloud service. The slot type on a cloud service can - /// either be Staging or Production + /// Gets the SwapResource which identifies the slot type for the specified + /// cloud service. The slot type on a cloud service can either be Staging or + /// Production /// + /// + /// Gets the SwapResource which identifies the slot type for the specified + /// cloud service. The slot type on a cloud service can either be Staging or + /// Production + /// /// /// The name of the resource group. /// @@ -46,13 +41,14 @@ public partial interface IVipSwapOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string groupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string groupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Performs vip swap operation on swappable cloud services. /// + /// + /// Performs vip swap operation on swappable cloud services. + /// /// /// The name of the resource group. /// @@ -60,8 +56,8 @@ public partial interface IVipSwapOperations /// The name of the cloud service. /// /// - /// SwapResource object where slot type should be the target slot after - /// vip swap for the specified cloud service. + /// SwapResource object where slot type should be the target slot after vip + /// swap for the specified cloud service. /// /// /// The headers that will be added to request. @@ -72,15 +68,18 @@ public partial interface IVipSwapOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the list of SwapResource which identifies the slot type for - /// the specified cloud service. The slot type on a cloud service can - /// either be Staging or Production + /// Gets the list of SwapResource which identifies the slot type for the + /// specified cloud service. The slot type on a cloud service can either be + /// Staging or Production /// + /// + /// Gets the list of SwapResource which identifies the slot type for the + /// specified cloud service. The slot type on a cloud service can either be + /// Staging or Production + /// /// /// The name of the resource group. /// @@ -99,13 +98,14 @@ public partial interface IVipSwapOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string groupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string groupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Performs vip swap operation on swappable cloud services. /// + /// + /// Performs vip swap operation on swappable cloud services. + /// /// /// The name of the resource group. /// @@ -113,8 +113,8 @@ public partial interface IVipSwapOperations /// The name of the cloud service. /// /// - /// SwapResource object where slot type should be the target slot after - /// vip swap for the specified cloud service. + /// SwapResource object where slot type should be the target slot after vip + /// swap for the specified cloud service. /// /// /// The headers that will be added to request. @@ -125,9 +125,7 @@ public partial interface IVipSwapOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginCreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSitesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSitesOperations.cs index a3053a6d7220..06890d5fd7ca 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSitesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSitesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualApplianceSitesOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualApplianceSitesOperations /// /// Deletes the specified site from a Virtual Appliance. /// + /// + /// Deletes the specified site from a Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Virtual Appliance Site. /// + /// + /// Gets the specified Virtual Appliance Site. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Network Virtual Appliance Site. /// + /// + /// Creates or updates the specified Network Virtual Appliance Site. + /// /// /// The name of the resource group. /// @@ -89,8 +84,8 @@ public partial interface IVirtualApplianceSitesOperations /// The name of the site. /// /// - /// Parameters supplied to the create or update Network Virtual - /// Appliance Site operation. + /// Parameters supplied to the create or update Network Virtual Appliance Site + /// operation. /// /// /// The headers that will be added to request. @@ -104,14 +99,16 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all Network Virtual Appliance Sites in a Network Virtual - /// Appliance resource. + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. /// + /// + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. + /// /// /// The name of the resource group. /// @@ -130,13 +127,14 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified site from a Virtual Appliance. /// + /// + /// Deletes the specified site from a Virtual Appliance. + /// /// /// The name of the resource group. /// @@ -155,13 +153,14 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Network Virtual Appliance Site. /// + /// + /// Creates or updates the specified Network Virtual Appliance Site. + /// /// /// The name of the resource group. /// @@ -172,8 +171,8 @@ public partial interface IVirtualApplianceSitesOperations /// The name of the site. /// /// - /// Parameters supplied to the create or update Network Virtual - /// Appliance Site operation. + /// Parameters supplied to the create or update Network Virtual Appliance Site + /// operation. /// /// /// The headers that will be added to request. @@ -187,14 +186,16 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all Network Virtual Appliance Sites in a Network Virtual - /// Appliance resource. + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. /// + /// + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -210,9 +211,7 @@ public partial interface IVirtualApplianceSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSkusOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSkusOperations.cs index 3767b43744e8..9e965fcc2a04 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSkusOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualApplianceSkusOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualApplianceSkusOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualApplianceSkusOperations /// /// List all SKUs available for a virtual appliance. /// + /// + /// List all SKUs available for a virtual appliance. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IVirtualApplianceSkusOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves a single available sku for network virtual appliance. /// + /// + /// Retrieves a single available sku for network virtual appliance. + /// /// /// Name of the Sku. /// @@ -60,13 +54,14 @@ public partial interface IVirtualApplianceSkusOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string skuName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string skuName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all SKUs available for a virtual appliance. /// + /// + /// List all SKUs available for a virtual appliance. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -82,9 +77,7 @@ public partial interface IVirtualApplianceSkusOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionOperations.cs index 830f2a94593b..56967e5570cb 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualHubBgpConnectionOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualHubBgpConnectionOperations /// /// Retrieves the details of a Virtual Hub Bgp Connection. /// + /// + /// Retrieves the details of a Virtual Hub Bgp Connection. + /// /// /// The resource group name of the VirtualHub. /// @@ -47,14 +40,16 @@ public partial interface IVirtualHubBgpConnectionOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else - /// updates the existing VirtualHubBgpConnection. + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. /// + /// + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. + /// /// /// The resource group name of the VirtualHub. /// @@ -79,13 +74,14 @@ public partial interface IVirtualHubBgpConnectionOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHubBgpConnection. /// + /// + /// Deletes a VirtualHubBgpConnection. + /// /// /// The resource group name of the VirtualHubBgpConnection. /// @@ -104,14 +100,16 @@ public partial interface IVirtualHubBgpConnectionOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else - /// updates the existing VirtualHubBgpConnection. + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. /// + /// + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. + /// /// /// The resource group name of the VirtualHub. /// @@ -136,13 +134,14 @@ public partial interface IVirtualHubBgpConnectionOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHubBgpConnection. /// + /// + /// Deletes a VirtualHubBgpConnection. + /// /// /// The resource group name of the VirtualHubBgpConnection. /// @@ -161,9 +160,7 @@ public partial interface IVirtualHubBgpConnectionOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionsOperations.cs index 4b5160eb6103..f48197a108b8 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualHubBgpConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualHubBgpConnectionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Retrieves the details of all VirtualHubBgpConnections. /// + /// + /// Retrieves the details of all VirtualHubBgpConnections. + /// /// /// The resource group name of the VirtualHub. /// @@ -44,14 +37,14 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a list of routes the virtual hub bgp connection has - /// learned. + /// Retrieves a list of routes the virtual hub bgp connection has learned. /// + /// + /// Retrieves a list of routes the virtual hub bgp connection has learned. + /// /// /// The name of the resource group. /// @@ -73,14 +66,16 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>>> ListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>>> ListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a list of routes the virtual hub bgp connection is - /// advertising to the specified peer. + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. /// + /// + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. + /// /// /// The name of the resource group. /// @@ -102,14 +97,14 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>>> ListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>>> ListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a list of routes the virtual hub bgp connection has - /// learned. + /// Retrieves a list of routes the virtual hub bgp connection has learned. /// + /// + /// Retrieves a list of routes the virtual hub bgp connection has learned. + /// /// /// The name of the resource group. /// @@ -131,14 +126,16 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>>> BeginListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>>> BeginListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves a list of routes the virtual hub bgp connection is - /// advertising to the specified peer. + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. /// + /// + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. + /// /// /// The name of the resource group. /// @@ -160,13 +157,14 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>>> BeginListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>>> BeginListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all VirtualHubBgpConnections. /// + /// + /// Retrieves the details of all VirtualHubBgpConnections. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -182,9 +180,7 @@ public partial interface IVirtualHubBgpConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualHubIpConfigurationOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualHubIpConfigurationOperations.cs index f8d888aad11b..28a93db5f760 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualHubIpConfigurationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualHubIpConfigurationOperations.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// VirtualHubIpConfigurationOperations operations. + /// VirtualHubIPConfigurationOperations operations. /// - public partial interface IVirtualHubIpConfigurationOperations + public partial interface IVirtualHubIPConfigurationOperations { /// /// Retrieves the details of a Virtual Hub Ip configuration. /// + /// + /// Retrieves the details of a Virtual Hub Ip configuration. + /// /// /// The resource group name of the VirtualHub. /// @@ -47,14 +40,16 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist - /// else updates the existing VirtualHubIpConfiguration. + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. /// + /// + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. + /// /// /// The resource group name of the VirtualHub. /// @@ -79,13 +74,14 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHubIpConfiguration. /// + /// + /// Deletes a VirtualHubIpConfiguration. + /// /// /// The resource group name of the VirtualHubBgpConnection. /// @@ -104,13 +100,14 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all VirtualHubIpConfigurations. /// + /// + /// Retrieves the details of all VirtualHubIpConfigurations. + /// /// /// The resource group name of the VirtualHub. /// @@ -129,14 +126,16 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist - /// else updates the existing VirtualHubIpConfiguration. + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. /// + /// + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. + /// /// /// The resource group name of the VirtualHub. /// @@ -161,13 +160,14 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHubIpConfiguration. /// + /// + /// Deletes a VirtualHubIpConfiguration. + /// /// /// The resource group name of the VirtualHubBgpConnection. /// @@ -186,13 +186,14 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all VirtualHubIpConfigurations. /// + /// + /// Retrieves the details of all VirtualHubIpConfigurations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +209,7 @@ public partial interface IVirtualHubIpConfigurationOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualHubRouteTableV2sOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualHubRouteTableV2sOperations.cs index e966557bcd3b..ecdc0036b851 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualHubRouteTableV2sOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualHubRouteTableV2sOperations.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// VirtualHubRouteTableV2sOperations operations. + /// VirtualHubRouteTableV2SOperations operations. /// - public partial interface IVirtualHubRouteTableV2sOperations + public partial interface IVirtualHubRouteTableV2SOperations { /// /// Retrieves the details of a VirtualHubRouteTableV2. /// + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// /// /// The resource group name of the VirtualHubRouteTableV2. /// @@ -41,20 +34,22 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else - /// updates the existing VirtualHubRouteTableV2. + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. /// + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// /// /// The resource group name of the VirtualHub. /// @@ -73,19 +68,20 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHubRouteTableV2. /// + /// + /// Deletes a VirtualHubRouteTableV2. + /// /// /// The resource group name of the VirtualHubRouteTableV2. /// @@ -101,16 +97,17 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all VirtualHubRouteTableV2s. /// + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// /// /// The resource group name of the VirtualHub. /// @@ -129,14 +126,16 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else - /// updates the existing VirtualHubRouteTableV2. + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. /// + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// /// /// The resource group name of the VirtualHub. /// @@ -155,19 +154,20 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHubRouteTableV2. /// + /// + /// Deletes a VirtualHubRouteTableV2. + /// /// /// The resource group name of the VirtualHubRouteTableV2. /// @@ -183,16 +183,17 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the details of all VirtualHubRouteTableV2s. /// + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +209,7 @@ public partial interface IVirtualHubRouteTableV2sOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualHubsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualHubsOperations.cs index 6c7c00f3e4d9..7d59204de584 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualHubsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualHubsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualHubsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualHubsOperations /// /// Retrieves the details of a VirtualHub. /// + /// + /// Retrieves the details of a VirtualHub. + /// /// /// The resource group name of the VirtualHub. /// @@ -44,14 +37,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHub resource if it doesn't exist else updates the - /// existing VirtualHub. + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. /// + /// + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. + /// /// /// The resource group name of the VirtualHub. /// @@ -73,13 +68,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates VirtualHub tags. /// + /// + /// Updates VirtualHub tags. + /// /// /// The resource group name of the VirtualHub. /// @@ -101,13 +97,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHub. /// + /// + /// Deletes a VirtualHub. + /// /// /// The resource group name of the VirtualHub. /// @@ -123,13 +120,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualHubs in a resource group. /// + /// + /// Lists all the VirtualHubs in a resource group. + /// /// /// The resource group name of the VirtualHub. /// @@ -145,13 +143,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualHubs in a subscription. /// + /// + /// Lists all the VirtualHubs in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,14 +163,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the effective routes configured for the Virtual Hub resource - /// or the specified resource . + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . /// + /// + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . + /// /// /// The resource group name of the VirtualHub. /// @@ -179,8 +180,7 @@ public partial interface IVirtualHubsOperations /// The name of the VirtualHub. /// /// - /// Parameters supplied to get the effective routes for a specific - /// resource. + /// Parameters supplied to get the effective routes for a specific resource. /// /// /// The headers that will be added to request. @@ -194,14 +194,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the inbound routes configured for the Virtual Hub on a - /// particular connection. + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. /// + /// + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. + /// /// /// The resource group name of the VirtualHub. /// @@ -209,8 +211,7 @@ public partial interface IVirtualHubsOperations /// The name of the VirtualHub. /// /// - /// Parameters supplied to get the inbound routes for a connection - /// resource. + /// Parameters supplied to get the inbound routes for a connection resource. /// /// /// The headers that will be added to request. @@ -224,14 +225,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the outbound routes configured for the Virtual Hub on a - /// particular connection. + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. /// + /// + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. + /// /// /// The resource group name of the VirtualHub. /// @@ -239,8 +242,7 @@ public partial interface IVirtualHubsOperations /// The name of the VirtualHub. /// /// - /// Parameters supplied to get the outbound routes for a connection - /// resource. + /// Parameters supplied to get the outbound routes for a connection resource. /// /// /// The headers that will be added to request. @@ -254,14 +256,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualHub resource if it doesn't exist else updates the - /// existing VirtualHub. + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. /// + /// + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. + /// /// /// The resource group name of the VirtualHub. /// @@ -283,13 +287,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualHub. /// + /// + /// Deletes a VirtualHub. + /// /// /// The resource group name of the VirtualHub. /// @@ -305,14 +310,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the effective routes configured for the Virtual Hub resource - /// or the specified resource . + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . /// + /// + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . + /// /// /// The resource group name of the VirtualHub. /// @@ -320,8 +327,7 @@ public partial interface IVirtualHubsOperations /// The name of the VirtualHub. /// /// - /// Parameters supplied to get the effective routes for a specific - /// resource. + /// Parameters supplied to get the effective routes for a specific resource. /// /// /// The headers that will be added to request. @@ -335,14 +341,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the inbound routes configured for the Virtual Hub on a - /// particular connection. + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. /// + /// + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. + /// /// /// The resource group name of the VirtualHub. /// @@ -350,8 +358,7 @@ public partial interface IVirtualHubsOperations /// The name of the VirtualHub. /// /// - /// Parameters supplied to get the inbound routes for a connection - /// resource. + /// Parameters supplied to get the inbound routes for a connection resource. /// /// /// The headers that will be added to request. @@ -365,14 +372,16 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the outbound routes configured for the Virtual Hub on a - /// particular connection. + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. /// + /// + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. + /// /// /// The resource group name of the VirtualHub. /// @@ -380,8 +389,7 @@ public partial interface IVirtualHubsOperations /// The name of the VirtualHub. /// /// - /// Parameters supplied to get the outbound routes for a connection - /// resource. + /// Parameters supplied to get the outbound routes for a connection resource. /// /// /// The headers that will be added to request. @@ -395,13 +403,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualHubs in a resource group. /// + /// + /// Lists all the VirtualHubs in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -417,13 +426,14 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualHubs in a subscription. /// + /// + /// Lists all the VirtualHubs in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -439,9 +449,7 @@ public partial interface IVirtualHubsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayConnectionsOperations.cs index 131d60f952dd..ce8c7d855bd0 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkGatewayConnectionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkGatewayConnectionsOperations { /// - /// Creates or updates a virtual network gateway connection in the - /// specified resource group. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// + /// + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -49,14 +43,14 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the specified virtual network gateway connection by resource - /// group. + /// Gets the specified virtual network gateway connection by resource group. /// + /// + /// Gets the specified virtual network gateway connection by resource group. + /// /// /// The name of the resource group. /// @@ -75,13 +69,14 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network Gateway connection. /// + /// + /// Deletes the specified virtual network Gateway connection. + /// /// /// The name of the resource group. /// @@ -97,13 +92,14 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual network gateway connection tags. /// + /// + /// Updates a virtual network gateway connection tags. + /// /// /// The name of the resource group. /// @@ -111,8 +107,7 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to update virtual network gateway connection - /// tags. + /// Parameters supplied to update virtual network gateway connection tags. /// /// /// The headers that will be added to request. @@ -126,16 +121,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -143,8 +142,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway - /// connection Shared key operation throughNetwork resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// /// /// The headers that will be added to request. @@ -158,15 +157,18 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation - /// retrieves information about the specified virtual network gateway - /// connection shared key through Network resource provider. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. /// + /// + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. + /// /// /// The name of the resource group. /// @@ -185,14 +187,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The List VirtualNetworkGatewayConnections operation retrieves all - /// the virtual network gateways connections created. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// + /// + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. + /// /// /// The name of the resource group. /// @@ -208,16 +212,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -225,8 +233,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the begin reset virtual network gateway - /// connection shared key operation through network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -240,14 +248,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts packet capture on virtual network gateway connection in the /// specified resource group. /// + /// + /// Starts packet capture on virtual network gateway connection in the + /// specified resource group. + /// /// /// The name of the resource group. /// @@ -255,8 +265,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Virtual network gateway packet capture parameters supplied to start - /// packet capture on gateway connection. + /// Virtual network gateway packet capture parameters supplied to start packet + /// capture on gateway connection. /// /// /// The headers that will be added to request. @@ -264,20 +274,22 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on virtual network gateway connection in the - /// specified resource group. + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. /// + /// + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -285,8 +297,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway Connection. /// /// - /// Virtual network gateway packet capture parameters supplied to stop - /// packet capture on gateway connection. + /// Virtual network gateway packet capture parameters supplied to stop packet + /// capture on gateway connection. /// /// /// The headers that will be added to request. @@ -294,20 +306,22 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists IKE Security Associations for the virtual network gateway - /// connection in the specified resource group. + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. /// + /// + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. + /// /// /// The name of the resource group. /// @@ -320,19 +334,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Resets the virtual network gateway connection specified. /// + /// + /// Resets the virtual network gateway connection specified. + /// /// /// The name of the resource group. /// @@ -345,17 +360,19 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a virtual network gateway connection in the - /// specified resource group. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// + /// + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -378,13 +395,14 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network Gateway connection. /// + /// + /// Deletes the specified virtual network Gateway connection. + /// /// /// The name of the resource group. /// @@ -400,13 +418,14 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual network gateway connection tags. /// + /// + /// Updates a virtual network gateway connection tags. + /// /// /// The name of the resource group. /// @@ -414,8 +433,7 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to update virtual network gateway connection - /// tags. + /// Parameters supplied to update virtual network gateway connection tags. /// /// /// The headers that will be added to request. @@ -429,16 +447,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -446,8 +468,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway - /// connection Shared key operation throughNetwork resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// /// /// The headers that will be added to request. @@ -461,16 +483,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -478,8 +504,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the begin reset virtual network gateway - /// connection shared key operation through network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -493,14 +519,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts packet capture on virtual network gateway connection in the /// specified resource group. /// + /// + /// Starts packet capture on virtual network gateway connection in the + /// specified resource group. + /// /// /// The name of the resource group. /// @@ -508,8 +536,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Virtual network gateway packet capture parameters supplied to start - /// packet capture on gateway connection. + /// Virtual network gateway packet capture parameters supplied to start packet + /// capture on gateway connection. /// /// /// The headers that will be added to request. @@ -517,20 +545,22 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on virtual network gateway connection in the - /// specified resource group. + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. /// + /// + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -538,8 +568,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway Connection. /// /// - /// Virtual network gateway packet capture parameters supplied to stop - /// packet capture on gateway connection. + /// Virtual network gateway packet capture parameters supplied to stop packet + /// capture on gateway connection. /// /// /// The headers that will be added to request. @@ -547,20 +577,22 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists IKE Security Associations for the virtual network gateway - /// connection in the specified resource group. + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. /// + /// + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. + /// /// /// The name of the resource group. /// @@ -573,19 +605,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Resets the virtual network gateway connection specified. /// + /// + /// Resets the virtual network gateway connection specified. + /// /// /// The name of the resource group. /// @@ -598,17 +631,19 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The List VirtualNetworkGatewayConnections operation retrieves all - /// the virtual network gateways connections created. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// + /// + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -624,9 +659,7 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayNatRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayNatRulesOperations.cs index cfe04ed49e72..3a0c726bc5fd 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayNatRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewayNatRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkGatewayNatRulesOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Retrieves the details of a nat rule. /// + /// + /// Retrieves the details of a nat rule. + /// /// /// The resource group name of the Virtual Network Gateway. /// @@ -47,14 +40,16 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a nat rule to a scalable virtual network gateway if it - /// doesn't exist else updates the existing nat rules. + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. /// + /// + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. + /// /// /// The resource group name of the Virtual Network Gateway. /// @@ -79,13 +74,14 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a nat rule. /// + /// + /// Deletes a nat rule. + /// /// /// The resource group name of the Virtual Network Gateway. /// @@ -104,13 +100,14 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all nat rules for a particular virtual network gateway. /// + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// /// /// The resource group name of the virtual network gateway. /// @@ -129,14 +126,16 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a nat rule to a scalable virtual network gateway if it - /// doesn't exist else updates the existing nat rules. + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. /// + /// + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. + /// /// /// The resource group name of the Virtual Network Gateway. /// @@ -161,13 +160,14 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a nat rule. /// + /// + /// Deletes a nat rule. + /// /// /// The resource group name of the Virtual Network Gateway. /// @@ -186,13 +186,14 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves all nat rules for a particular virtual network gateway. /// + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -208,9 +209,7 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewaysOperations.cs index 8e743c5024e2..96748ae67d0c 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkGatewaysOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkGatewaysOperations { /// - /// Creates or updates a virtual network gateway in the specified - /// resource group. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// + /// + /// Creates or updates a virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -34,8 +28,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to create or update virtual network gateway - /// operation. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The headers that will be added to request. @@ -49,13 +42,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified virtual network gateway by resource group. /// + /// + /// Gets the specified virtual network gateway by resource group. + /// /// /// The name of the resource group. /// @@ -74,13 +68,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network gateway. /// + /// + /// Deletes the specified virtual network gateway. + /// /// /// The name of the resource group. /// @@ -96,13 +91,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual network gateway tags. /// + /// + /// Updates a virtual network gateway tags. + /// /// /// The name of the resource group. /// @@ -124,13 +120,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual network gateways by resource group. /// + /// + /// Gets all virtual network gateways by resource group. + /// /// /// The name of the resource group. /// @@ -146,13 +143,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the connections in a virtual network gateway. /// + /// + /// Gets all the connections in a virtual network gateway. + /// /// /// The name of the resource group. /// @@ -171,14 +169,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// + /// + /// Resets the primary of the virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -186,8 +186,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the begin reset of - /// the active-active feature enabled gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -201,14 +201,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the VPN client shared key of the virtual network gateway in - /// the specified resource group. + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. /// + /// + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. + /// /// /// The name of the resource group. /// @@ -224,14 +226,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates VPN client package for P2S client of the virtual network - /// gateway in the specified resource group. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// + /// + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. + /// /// /// The name of the resource group. /// @@ -239,8 +243,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the generate virtual network gateway VPN - /// client package operation. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// /// /// The headers that will be added to request. @@ -254,15 +258,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates VPN profile for P2S client of the virtual network gateway - /// in the specified resource group. Used for IKEV2 and radius based - /// authentication. + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. /// + /// + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. + /// /// /// The name of the resource group. /// @@ -270,8 +275,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the generate virtual network gateway VPN - /// client package operation. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// /// /// The headers that will be added to request. @@ -285,15 +290,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -312,14 +320,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The GetBgpPeerStatus operation retrieves the status of all BGP - /// peers. + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. /// + /// + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. + /// /// /// The name of the resource group. /// @@ -341,13 +349,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a xml format representation for supported vpn devices. /// + /// + /// Gets a xml format representation for supported vpn devices. + /// /// /// The name of the resource group. /// @@ -366,14 +375,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> SupportedVpnDevicesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> SupportedVpnDevicesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// This operation retrieves a list of routes the virtual network - /// gateway has learned, including routes learned from BGP peers. + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. /// + /// + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. + /// /// /// The name of the resource group. /// @@ -392,14 +403,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// This operation retrieves a list of routes the virtual network - /// gateway is advertising to the specified peer. + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. /// + /// + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. + /// /// /// The name of the resource group. /// @@ -421,15 +434,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -437,9 +453,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Set vpnclient ipsec parameters of - /// Virtual Network Gateway P2S client operation through Network - /// resource provider. + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. /// /// /// The headers that will be added to request. @@ -453,16 +468,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -481,14 +498,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a xml format representation for vpn device configuration - /// script. + /// Gets a xml format representation for vpn device configuration script. /// + /// + /// Gets a xml format representation for vpn device configuration script. + /// /// /// The name of the resource group. /// @@ -511,14 +528,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> VpnDeviceConfigurationScriptWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> VpnDeviceConfigurationScriptWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts packet capture on virtual network gateway in the specified - /// resource group. + /// Starts packet capture on virtual network gateway in the specified resource + /// group. /// + /// + /// Starts packet capture on virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -526,8 +545,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway packet capture parameters supplied to start - /// packet capture on gateway. + /// Virtual network gateway packet capture parameters supplied to start packet + /// capture on gateway. /// /// /// The headers that will be added to request. @@ -535,20 +554,22 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on virtual network gateway in the specified - /// resource group. + /// Stops packet capture on virtual network gateway in the specified resource + /// group. /// + /// + /// Stops packet capture on virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -556,8 +577,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway packet capture parameters supplied to stop - /// packet capture on gateway. + /// Virtual network gateway packet capture parameters supplied to stop packet + /// capture on gateway. /// /// /// The headers that will be added to request. @@ -565,20 +586,22 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get VPN client connection health detail per P2S client connection - /// of the virtual network gateway in the specified resource group. + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. /// + /// + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. + /// /// /// The name of the resource group. /// @@ -597,14 +620,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Disconnect vpn connections of virtual network gateway in the - /// specified resource group. + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. /// + /// + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -623,14 +648,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a virtual network gateway in the specified - /// resource group. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// + /// + /// Creates or updates a virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -638,8 +665,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to create or update virtual network gateway - /// operation. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The headers that will be added to request. @@ -653,13 +679,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network gateway. /// + /// + /// Deletes the specified virtual network gateway. + /// /// /// The name of the resource group. /// @@ -675,13 +702,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual network gateway tags. /// + /// + /// Updates a virtual network gateway tags. + /// /// /// The name of the resource group. /// @@ -703,14 +731,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// + /// + /// Resets the primary of the virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -718,8 +748,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the begin reset of - /// the active-active feature enabled gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -733,14 +763,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the VPN client shared key of the virtual network gateway in - /// the specified resource group. + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. /// + /// + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. + /// /// /// The name of the resource group. /// @@ -756,14 +788,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates VPN client package for P2S client of the virtual network - /// gateway in the specified resource group. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// + /// + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. + /// /// /// The name of the resource group. /// @@ -771,8 +805,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the generate virtual network gateway VPN - /// client package operation. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// /// /// The headers that will be added to request. @@ -786,15 +820,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates VPN profile for P2S client of the virtual network gateway - /// in the specified resource group. Used for IKEV2 and radius based - /// authentication. + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. /// + /// + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. + /// /// /// The name of the resource group. /// @@ -802,8 +837,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the generate virtual network gateway VPN - /// client package operation. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// /// /// The headers that will be added to request. @@ -817,15 +852,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -844,14 +882,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The GetBgpPeerStatus operation retrieves the status of all BGP - /// peers. + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. /// + /// + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. + /// /// /// The name of the resource group. /// @@ -873,14 +911,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// This operation retrieves a list of routes the virtual network - /// gateway has learned, including routes learned from BGP peers. + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. /// + /// + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. + /// /// /// The name of the resource group. /// @@ -899,14 +939,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// This operation retrieves a list of routes the virtual network - /// gateway is advertising to the specified peer. + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. /// + /// + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. + /// /// /// The name of the resource group. /// @@ -928,15 +970,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -944,9 +989,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Set vpnclient ipsec parameters of - /// Virtual Network Gateway P2S client operation through Network - /// resource provider. + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. /// /// /// The headers that will be added to request. @@ -960,16 +1004,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// 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. + /// 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. /// + /// + /// 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. + /// /// /// The name of the resource group. /// @@ -988,14 +1034,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts packet capture on virtual network gateway in the specified - /// resource group. + /// Starts packet capture on virtual network gateway in the specified resource + /// group. /// + /// + /// Starts packet capture on virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -1003,8 +1051,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway packet capture parameters supplied to start - /// packet capture on gateway. + /// Virtual network gateway packet capture parameters supplied to start packet + /// capture on gateway. /// /// /// The headers that will be added to request. @@ -1012,20 +1060,22 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on virtual network gateway in the specified - /// resource group. + /// Stops packet capture on virtual network gateway in the specified resource + /// group. /// + /// + /// Stops packet capture on virtual network gateway in the specified resource + /// group. + /// /// /// The name of the resource group. /// @@ -1033,8 +1083,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway packet capture parameters supplied to stop - /// packet capture on gateway. + /// Virtual network gateway packet capture parameters supplied to stop packet + /// capture on gateway. /// /// /// The headers that will be added to request. @@ -1042,20 +1092,22 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get VPN client connection health detail per P2S client connection - /// of the virtual network gateway in the specified resource group. + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. /// + /// + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. + /// /// /// The name of the resource group. /// @@ -1074,14 +1126,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Disconnect vpn connections of virtual network gateway in the - /// specified resource group. + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. /// + /// + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. + /// /// /// The name of the resource group. /// @@ -1100,13 +1154,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual network gateways by resource group. /// + /// + /// Gets all virtual network gateways by resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1122,13 +1177,14 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the connections in a virtual network gateway. /// + /// + /// Gets all the connections in a virtual network gateway. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1144,9 +1200,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListConnectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkPeeringsOperations.cs index 7d4f2c17d1c0..3044d8fc3d59 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkPeeringsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkPeeringsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Deletes the specified virtual network peering. /// + /// + /// Deletes the specified virtual network peering. + /// /// /// The name of the resource group. /// @@ -44,13 +37,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified virtual network peering. /// + /// + /// Gets the specified virtual network peering. + /// /// /// The name of the resource group. /// @@ -72,13 +66,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a peering in the specified virtual network. /// + /// + /// Creates or updates a peering in the specified virtual network. + /// /// /// The name of the resource group. /// @@ -88,15 +83,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The name of the peering. /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// /// /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the - /// current address space on the remote vNet after it's updated. - /// Possible values include: 'true' - /// /// /// The headers that will be added to request. /// @@ -109,13 +103,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual network peerings in a virtual network. /// + /// + /// Gets all virtual network peerings in a virtual network. + /// /// /// The name of the resource group. /// @@ -134,13 +129,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network peering. /// + /// + /// Deletes the specified virtual network peering. + /// /// /// The name of the resource group. /// @@ -159,13 +155,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a peering in the specified virtual network. /// + /// + /// Creates or updates a peering in the specified virtual network. + /// /// /// The name of the resource group. /// @@ -175,15 +172,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The name of the peering. /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// /// /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the - /// current address space on the remote vNet after it's updated. - /// Possible values include: 'true' - /// /// /// The headers that will be added to request. /// @@ -196,13 +192,14 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual network peerings in a virtual network. /// + /// + /// Gets all virtual network peerings in a virtual network. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -218,9 +215,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkTapsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkTapsOperations.cs index 648825f9a606..dfa4b626b72b 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkTapsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworkTapsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkTapsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualNetworkTapsOperations /// /// Deletes the specified virtual network tap. /// + /// + /// Deletes the specified virtual network tap. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about the specified virtual network tap. /// + /// + /// Gets information about the specified virtual network tap. + /// /// /// The name of the resource group. /// @@ -66,13 +60,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string tapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Virtual Network Tap. /// + /// + /// Creates or updates a Virtual Network Tap. + /// /// /// The name of the resource group. /// @@ -80,8 +75,7 @@ public partial interface IVirtualNetworkTapsOperations /// The name of the virtual network tap. /// /// - /// Parameters supplied to the create or update virtual network tap - /// operation. + /// Parameters supplied to the create or update virtual network tap operation. /// /// /// The headers that will be added to request. @@ -95,13 +89,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates an VirtualNetworkTap tags. /// + /// + /// Updates an VirtualNetworkTap tags. + /// /// /// The name of the resource group. /// @@ -123,13 +118,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the VirtualNetworkTaps in a subscription. /// + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// /// /// The headers that will be added to request. /// @@ -142,13 +138,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the VirtualNetworkTaps in a subscription. /// + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// /// /// The name of the resource group. /// @@ -164,13 +161,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network tap. /// + /// + /// Deletes the specified virtual network tap. + /// /// /// The name of the resource group. /// @@ -186,13 +184,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a Virtual Network Tap. /// + /// + /// Creates or updates a Virtual Network Tap. + /// /// /// The name of the resource group. /// @@ -200,8 +199,7 @@ public partial interface IVirtualNetworkTapsOperations /// The name of the virtual network tap. /// /// - /// Parameters supplied to the create or update virtual network tap - /// operation. + /// Parameters supplied to the create or update virtual network tap operation. /// /// /// The headers that will be added to request. @@ -215,13 +213,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the VirtualNetworkTaps in a subscription. /// + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -237,13 +236,14 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the VirtualNetworkTaps in a subscription. /// + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,9 +259,7 @@ public partial interface IVirtualNetworkTapsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworksOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworksOperations.cs index 787619f25fe4..9bb8309b999c 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualNetworksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualNetworksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworksOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualNetworksOperations /// /// Deletes the specified virtual network. /// + /// + /// Deletes the specified virtual network. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified virtual network by resource group. /// + /// + /// Gets the specified virtual network by resource group. + /// /// /// The name of the resource group. /// @@ -69,14 +63,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a virtual network in the specified resource - /// group. + /// Creates or updates a virtual network in the specified resource group. /// + /// + /// Creates or updates a virtual network in the specified resource group. + /// /// /// The name of the resource group. /// @@ -84,8 +78,7 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// Parameters supplied to the create or update virtual network - /// operation. + /// Parameters supplied to the create or update virtual network operation. /// /// /// The headers that will be added to request. @@ -99,13 +92,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual network tags. /// + /// + /// Updates a virtual network tags. + /// /// /// The name of the resource group. /// @@ -127,13 +121,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual networks in a subscription. /// + /// + /// Gets all virtual networks in a subscription. + /// /// /// The headers that will be added to request. /// @@ -146,13 +141,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual networks in a resource group. /// + /// + /// Gets all virtual networks in a resource group. + /// /// /// The name of the resource group. /// @@ -168,13 +164,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Checks whether a private IP address is available for use. /// + /// + /// Checks whether a private IP address is available for use. + /// /// /// The name of the resource group. /// @@ -196,13 +193,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists usage stats. /// + /// + /// Lists usage stats. + /// /// /// The name of the resource group. /// @@ -221,14 +219,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListUsageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListUsageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the Ddos Protection Status of all IP Addresses under the - /// Virtual Network + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network /// + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// /// /// The name of the resource group. /// @@ -253,13 +253,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified virtual network. /// + /// + /// Deletes the specified virtual network. + /// /// /// The name of the resource group. /// @@ -275,14 +276,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or updates a virtual network in the specified resource - /// group. + /// Creates or updates a virtual network in the specified resource group. /// + /// + /// Creates or updates a virtual network in the specified resource group. + /// /// /// The name of the resource group. /// @@ -290,8 +291,7 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// Parameters supplied to the create or update virtual network - /// operation. + /// Parameters supplied to the create or update virtual network operation. /// /// /// The headers that will be added to request. @@ -305,14 +305,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the Ddos Protection Status of all IP Addresses under the - /// Virtual Network + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network /// + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// /// /// The name of the resource group. /// @@ -337,13 +339,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> BeginListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> BeginListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual networks in a subscription. /// + /// + /// Gets all virtual networks in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -359,13 +362,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all virtual networks in a resource group. /// + /// + /// Gets all virtual networks in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -381,13 +385,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists usage stats. /// + /// + /// Lists usage stats. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -403,14 +408,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListUsageNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListUsageNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the Ddos Protection Status of all IP Addresses under the - /// Virtual Network + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network /// + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -426,14 +433,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the Ddos Protection Status of all IP Addresses under the - /// Virtual Network + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network /// + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -449,9 +458,7 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> BeginListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> BeginListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualRouterPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualRouterPeeringsOperations.cs index 6439d6f4597e..fe79ed3d7bcb 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualRouterPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualRouterPeeringsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualRouterPeeringsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualRouterPeeringsOperations /// /// Deletes the specified peering from a Virtual Router. /// + /// + /// Deletes the specified peering from a Virtual Router. + /// /// /// The name of the resource group. /// @@ -41,16 +34,17 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Virtual Router Peering. /// + /// + /// Gets the specified Virtual Router Peering. + /// /// /// The name of the resource group. /// @@ -66,19 +60,20 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Virtual Router Peering. /// + /// + /// Creates or updates the specified Virtual Router Peering. + /// /// /// The name of the resource group. /// @@ -98,19 +93,20 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Virtual Router Peerings in a Virtual Router resource. /// + /// + /// Lists all Virtual Router Peerings in a Virtual Router resource. + /// /// /// The name of the resource group. /// @@ -123,19 +119,20 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified peering from a Virtual Router. /// + /// + /// Deletes the specified peering from a Virtual Router. + /// /// /// The name of the resource group. /// @@ -151,16 +148,17 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Virtual Router Peering. /// + /// + /// Creates or updates the specified Virtual Router Peering. + /// /// /// The name of the resource group. /// @@ -180,19 +178,20 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Virtual Router Peerings in a Virtual Router resource. /// + /// + /// Lists all Virtual Router Peerings in a Virtual Router resource. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -202,15 +201,13 @@ public partial interface IVirtualRouterPeeringsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualRoutersOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualRoutersOperations.cs index 347a95eb8a86..ee9e140f9ea6 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualRoutersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualRoutersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualRoutersOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualRoutersOperations /// /// Deletes the specified Virtual Router. /// + /// + /// Deletes the specified Virtual Router. + /// /// /// The name of the resource group. /// @@ -38,16 +31,17 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified Virtual Router. /// + /// + /// Gets the specified Virtual Router. + /// /// /// The name of the resource group. /// @@ -63,19 +57,20 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Virtual Router. /// + /// + /// Creates or updates the specified Virtual Router. + /// /// /// The name of the resource group. /// @@ -91,19 +86,20 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Virtual Routers in a resource group. /// + /// + /// Lists all Virtual Routers in a resource group. + /// /// /// The name of the resource group. /// @@ -113,38 +109,40 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Virtual Routers in a subscription. /// + /// + /// Gets all the Virtual Routers in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Virtual Router. /// + /// + /// Deletes the specified Virtual Router. + /// /// /// The name of the resource group. /// @@ -157,16 +155,17 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates the specified Virtual Router. /// + /// + /// Creates or updates the specified Virtual Router. + /// /// /// The name of the resource group. /// @@ -182,19 +181,20 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all Virtual Routers in a resource group. /// + /// + /// Lists all Virtual Routers in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -204,19 +204,20 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Virtual Routers in a subscription. /// + /// + /// Gets all the Virtual Routers in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -226,15 +227,13 @@ public partial interface IVirtualRoutersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVirtualWansOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVirtualWansOperations.cs index dfd795aabafe..11c2aa2e8849 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVirtualWansOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVirtualWansOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualWansOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualWansOperations /// /// Retrieves the details of a VirtualWAN. /// + /// + /// Retrieves the details of a VirtualWAN. + /// /// /// The resource group name of the VirtualWan. /// @@ -44,21 +37,23 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the - /// existing VirtualWAN. + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. /// + /// + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. + /// /// /// The resource group name of the VirtualWan. /// /// /// The name of the VirtualWAN being created or updated. /// - /// + /// /// Parameters supplied to create or update VirtualWAN. /// /// @@ -73,20 +68,21 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN WANParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a VirtualWAN tags. /// + /// + /// Updates a VirtualWAN tags. + /// /// /// The resource group name of the VirtualWan. /// /// /// The name of the VirtualWAN being updated. /// - /// + /// /// Parameters supplied to Update VirtualWAN tags. /// /// @@ -101,13 +97,14 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject WANParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualWAN. /// + /// + /// Deletes a VirtualWAN. + /// /// /// The resource group name of the VirtualWan. /// @@ -123,13 +120,14 @@ public partial interface IVirtualWansOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualWANs in a resource group. /// + /// + /// Lists all the VirtualWANs in a resource group. + /// /// /// The resource group name of the VirtualWan. /// @@ -145,13 +143,14 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualWANs in a subscription. /// + /// + /// Lists all the VirtualWANs in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,21 +163,23 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the - /// existing VirtualWAN. + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. /// + /// + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. + /// /// /// The resource group name of the VirtualWan. /// /// /// The name of the VirtualWAN being created or updated. /// - /// + /// /// Parameters supplied to create or update VirtualWAN. /// /// @@ -193,13 +194,14 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN WANParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VirtualWAN. /// + /// + /// Deletes a VirtualWAN. + /// /// /// The resource group name of the VirtualWan. /// @@ -215,13 +217,14 @@ public partial interface IVirtualWansOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualWANs in a resource group. /// + /// + /// Lists all the VirtualWANs in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -237,13 +240,14 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VirtualWANs in a subscription. /// + /// + /// Lists all the VirtualWANs in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,9 +263,7 @@ public partial interface IVirtualWansOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnConnectionsOperations.cs index dc28c8693abe..e24fec24a6c6 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnConnectionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnConnectionsOperations /// /// Retrieves the details of a vpn connection. /// + /// + /// Retrieves the details of a vpn connection. + /// /// /// The resource group name of the VpnGateway. /// @@ -47,14 +40,16 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't - /// exist else updates the existing connection. + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. /// + /// + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. + /// /// /// The resource group name of the VpnGateway. /// @@ -79,13 +74,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a vpn connection. /// + /// + /// Deletes a vpn connection. + /// /// /// The resource group name of the VpnGateway. /// @@ -104,14 +100,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts packet capture on Vpn connection in the specified resource - /// group. + /// Starts packet capture on Vpn connection in the specified resource group. /// + /// + /// Starts packet capture on Vpn connection in the specified resource group. + /// /// /// The name of the resource group. /// @@ -122,8 +118,8 @@ public partial interface IVpnConnectionsOperations /// The name of the vpn connection. /// /// - /// Vpn Connection packet capture parameters supplied to start packet - /// capture on gateway connection. + /// Vpn Connection packet capture parameters supplied to start packet capture + /// on gateway connection. /// /// /// The headers that will be added to request. @@ -137,14 +133,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on Vpn connection in the specified resource - /// group. + /// Stops packet capture on Vpn connection in the specified resource group. /// + /// + /// Stops packet capture on Vpn connection in the specified resource group. + /// /// /// The name of the resource group. /// @@ -155,8 +151,8 @@ public partial interface IVpnConnectionsOperations /// The name of the vpn connection. /// /// - /// Vpn Connection packet capture parameters supplied to stop packet - /// capture on gateway connection. + /// Vpn Connection packet capture parameters supplied to stop packet capture on + /// gateway connection. /// /// /// The headers that will be added to request. @@ -170,14 +166,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all vpn connections for a particular virtual wan vpn - /// gateway. + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. /// + /// + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -196,14 +192,16 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't - /// exist else updates the existing connection. + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. /// + /// + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. + /// /// /// The resource group name of the VpnGateway. /// @@ -228,13 +226,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a vpn connection. /// + /// + /// Deletes a vpn connection. + /// /// /// The resource group name of the VpnGateway. /// @@ -253,14 +252,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts packet capture on Vpn connection in the specified resource - /// group. + /// Starts packet capture on Vpn connection in the specified resource group. /// + /// + /// Starts packet capture on Vpn connection in the specified resource group. + /// /// /// The name of the resource group. /// @@ -271,8 +270,8 @@ public partial interface IVpnConnectionsOperations /// The name of the vpn connection. /// /// - /// Vpn Connection packet capture parameters supplied to start packet - /// capture on gateway connection. + /// Vpn Connection packet capture parameters supplied to start packet capture + /// on gateway connection. /// /// /// The headers that will be added to request. @@ -286,14 +285,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on Vpn connection in the specified resource - /// group. + /// Stops packet capture on Vpn connection in the specified resource group. /// + /// + /// Stops packet capture on Vpn connection in the specified resource group. + /// /// /// The name of the resource group. /// @@ -304,8 +303,8 @@ public partial interface IVpnConnectionsOperations /// The name of the vpn connection. /// /// - /// Vpn Connection packet capture parameters supplied to stop packet - /// capture on gateway connection. + /// Vpn Connection packet capture parameters supplied to stop packet capture on + /// gateway connection. /// /// /// The headers that will be added to request. @@ -319,14 +318,14 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all vpn connections for a particular virtual wan vpn - /// gateway. + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. /// + /// + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -342,9 +341,7 @@ public partial interface IVpnConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnGatewaysOperations.cs index a8986d8ff5b0..725933eb99f0 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnGatewaysOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnGatewaysOperations /// /// Retrieves the details of a virtual wan vpn gateway. /// + /// + /// Retrieves the details of a virtual wan vpn gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -44,14 +37,16 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates - /// the existing gateway. + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. /// + /// + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -73,13 +68,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates virtual wan vpn gateway tags. /// + /// + /// Updates virtual wan vpn gateway tags. + /// /// /// The resource group name of the VpnGateway. /// @@ -101,13 +97,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a virtual wan vpn gateway. /// + /// + /// Deletes a virtual wan vpn gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -123,14 +120,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the primary of the vpn gateway in the specified resource - /// group. + /// Resets the primary of the vpn gateway in the specified resource group. /// + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -152,14 +149,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts packet capture on vpn gateway in the specified resource - /// group. + /// Starts packet capture on vpn gateway in the specified resource group. /// + /// + /// Starts packet capture on vpn gateway in the specified resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -167,8 +164,8 @@ public partial interface IVpnGatewaysOperations /// The name of the gateway. /// /// - /// Vpn gateway packet capture parameters supplied to start packet - /// capture on vpn gateway. + /// Vpn gateway packet capture parameters supplied to start packet capture on + /// vpn gateway. /// /// /// The headers that will be added to request. @@ -182,14 +179,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on vpn gateway in the specified resource - /// group. + /// Stops packet capture on vpn gateway in the specified resource group. /// + /// + /// Stops packet capture on vpn gateway in the specified resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -197,8 +194,8 @@ public partial interface IVpnGatewaysOperations /// The name of the gateway. /// /// - /// Vpn gateway packet capture parameters supplied to stop packet - /// capture on vpn gateway. + /// Vpn gateway packet capture parameters supplied to stop packet capture on + /// vpn gateway. /// /// /// The headers that will be added to request. @@ -212,13 +209,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnGateways in a resource group. /// + /// + /// Lists all the VpnGateways in a resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -234,13 +232,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnGateways in a subscription. /// + /// + /// Lists all the VpnGateways in a subscription. + /// /// /// The headers that will be added to request. /// @@ -253,14 +252,16 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates - /// the existing gateway. + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. /// + /// + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -282,13 +283,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates virtual wan vpn gateway tags. /// + /// + /// Updates virtual wan vpn gateway tags. + /// /// /// The resource group name of the VpnGateway. /// @@ -310,13 +312,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a virtual wan vpn gateway. /// + /// + /// Deletes a virtual wan vpn gateway. + /// /// /// The resource group name of the VpnGateway. /// @@ -332,14 +335,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resets the primary of the vpn gateway in the specified resource - /// group. + /// Resets the primary of the vpn gateway in the specified resource group. /// + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -361,14 +364,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts packet capture on vpn gateway in the specified resource - /// group. + /// Starts packet capture on vpn gateway in the specified resource group. /// + /// + /// Starts packet capture on vpn gateway in the specified resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -376,8 +379,8 @@ public partial interface IVpnGatewaysOperations /// The name of the gateway. /// /// - /// Vpn gateway packet capture parameters supplied to start packet - /// capture on vpn gateway. + /// Vpn gateway packet capture parameters supplied to start packet capture on + /// vpn gateway. /// /// /// The headers that will be added to request. @@ -391,14 +394,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Stops packet capture on vpn gateway in the specified resource - /// group. + /// Stops packet capture on vpn gateway in the specified resource group. /// + /// + /// Stops packet capture on vpn gateway in the specified resource group. + /// /// /// The resource group name of the VpnGateway. /// @@ -406,8 +409,8 @@ public partial interface IVpnGatewaysOperations /// The name of the gateway. /// /// - /// Vpn gateway packet capture parameters supplied to stop packet - /// capture on vpn gateway. + /// Vpn gateway packet capture parameters supplied to stop packet capture on + /// vpn gateway. /// /// /// The headers that will be added to request. @@ -421,13 +424,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnGateways in a resource group. /// + /// + /// Lists all the VpnGateways in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -443,13 +447,14 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnGateways in a subscription. /// + /// + /// Lists all the VpnGateways in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -465,9 +470,7 @@ public partial interface IVpnGatewaysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnLinkConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnLinkConnectionsOperations.cs index 6249b8aa333e..aa298f949495 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnLinkConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnLinkConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnLinkConnectionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnLinkConnectionsOperations /// /// Resets the VpnLink connection specified. /// + /// + /// Resets the VpnLink connection specified. + /// /// /// The name of the resource group. /// @@ -44,17 +37,19 @@ public partial interface IVpnLinkConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists IKE Security Associations for Vpn Site Link Connection in the /// specified resource group. /// + /// + /// Lists IKE Security Associations for Vpn Site Link Connection in the + /// specified resource group. + /// /// /// The name of the resource group. /// @@ -73,20 +68,22 @@ public partial interface IVpnLinkConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all vpn site link connections for a particular virtual - /// wan vpn gateway vpn connection. + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. /// + /// + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. + /// /// /// The resource group name of the vpn gateway. /// @@ -108,13 +105,14 @@ public partial interface IVpnLinkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Resets the VpnLink connection specified. /// + /// + /// Resets the VpnLink connection specified. + /// /// /// The name of the resource group. /// @@ -133,17 +131,19 @@ public partial interface IVpnLinkConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists IKE Security Associations for Vpn Site Link Connection in the /// specified resource group. /// + /// + /// Lists IKE Security Associations for Vpn Site Link Connection in the + /// specified resource group. + /// /// /// The name of the resource group. /// @@ -162,20 +162,22 @@ public partial interface IVpnLinkConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all vpn site link connections for a particular virtual - /// wan vpn gateway vpn connection. + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. /// + /// + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -191,9 +193,7 @@ public partial interface IVpnLinkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnConnectionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnConnectionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsAssociatedWithVirtualWanOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsAssociatedWithVirtualWanOperations.cs index 8d4a4a7a896d..d646a222df3b 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsAssociatedWithVirtualWanOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsAssociatedWithVirtualWanOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnServerConfigurationsAssociatedWithVirtualWanOperations operations. @@ -24,15 +14,19 @@ namespace Microsoft.Azure.Management.Network public partial interface IVpnServerConfigurationsAssociatedWithVirtualWanOperations { /// - /// Gives the list of VpnServerConfigurations associated with Virtual - /// Wan in a resource group. + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. /// + /// + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations - /// is needed. + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. /// /// /// The headers that will be added to request. @@ -46,20 +40,22 @@ public partial interface IVpnServerConfigurationsAssociatedWithVirtualWanOperati /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gives the list of VpnServerConfigurations associated with Virtual - /// Wan in a resource group. + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. /// + /// + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations - /// is needed. + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. /// /// /// The headers that will be added to request. @@ -73,9 +69,7 @@ public partial interface IVpnServerConfigurationsAssociatedWithVirtualWanOperati /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsOperations.cs index b3a2b40e8dc5..4e3ecb2e9a7f 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnServerConfigurationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnServerConfigurationsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnServerConfigurationsOperations /// /// Retrieves the details of a VpnServerConfiguration. /// + /// + /// Retrieves the details of a VpnServerConfiguration. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -44,14 +37,16 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else - /// updates the existing VpnServerConfiguration. + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. /// + /// + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -73,13 +68,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates VpnServerConfiguration tags. /// + /// + /// Updates VpnServerConfiguration tags. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -101,13 +97,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VpnServerConfiguration. /// + /// + /// Deletes a VpnServerConfiguration. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -123,13 +120,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the vpnServerConfigurations in a resource group. /// + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -145,13 +143,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnServerConfigurations in a subscription. /// + /// + /// Lists all the VpnServerConfigurations in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,14 +163,16 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else - /// updates the existing VpnServerConfiguration. + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. /// + /// + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -193,13 +194,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VpnServerConfiguration. /// + /// + /// Deletes a VpnServerConfiguration. + /// /// /// The resource group name of the VpnServerConfiguration. /// @@ -215,13 +217,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the vpnServerConfigurations in a resource group. /// + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -237,13 +240,14 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnServerConfigurations in a subscription. /// + /// + /// Lists all the VpnServerConfigurations in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,9 +263,7 @@ public partial interface IVpnServerConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinkConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinkConnectionsOperations.cs index 865b8f68cdbe..636fc7f1c4ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinkConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinkConnectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSiteLinkConnectionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnSiteLinkConnectionsOperations /// /// Retrieves the details of a vpn site link connection. /// + /// + /// Retrieves the details of a vpn site link connection. + /// /// /// The resource group name of the VpnGateway. /// @@ -50,9 +43,7 @@ public partial interface IVpnSiteLinkConnectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinksOperations.cs index cdee28a857cc..673d9da9d494 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnSiteLinksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSiteLinksOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnSiteLinksOperations /// /// Retrieves the details of a VPN site link. /// + /// + /// Retrieves the details of a VPN site link. + /// /// /// The resource group name of the VpnSite. /// @@ -47,13 +40,14 @@ public partial interface IVpnSiteLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, string vpnSiteLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, string vpnSiteLinkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the vpnSiteLinks in a resource group for a vpn site. /// + /// + /// Lists all the vpnSiteLinks in a resource group for a vpn site. + /// /// /// The resource group name of the VpnSite. /// @@ -72,13 +66,14 @@ public partial interface IVpnSiteLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnSiteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnSiteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the vpnSiteLinks in a resource group for a vpn site. /// + /// + /// Lists all the vpnSiteLinks in a resource group for a vpn site. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface IVpnSiteLinksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVpnSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVpnSiteNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnSitesConfigurationOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnSitesConfigurationOperations.cs index 16e76f40ef80..cd180b70e960 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnSitesConfigurationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnSitesConfigurationOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSitesConfigurationOperations operations. @@ -27,12 +17,16 @@ public partial interface IVpnSitesConfigurationOperations /// Gives the sas-url to download the configurations for vpn-sites in a /// resource group. /// + /// + /// Gives the sas-url to download the configurations for vpn-sites in a + /// resource group. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN for which configuration of all vpn-sites - /// is needed. + /// The name of the VirtualWAN for which configuration of all vpn-sites is + /// needed. /// /// /// Parameters supplied to download vpn-sites configuration. @@ -46,20 +40,22 @@ public partial interface IVpnSitesConfigurationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gives the sas-url to download the configurations for vpn-sites in a /// resource group. /// + /// + /// Gives the sas-url to download the configurations for vpn-sites in a + /// resource group. + /// /// /// The resource group name. /// /// - /// The name of the VirtualWAN for which configuration of all vpn-sites - /// is needed. + /// The name of the VirtualWAN for which configuration of all vpn-sites is + /// needed. /// /// /// Parameters supplied to download vpn-sites configuration. @@ -73,9 +69,7 @@ public partial interface IVpnSitesConfigurationOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IVpnSitesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IVpnSitesOperations.cs index f7a882e52b24..d3a7e50cd772 100644 --- a/src/Network/Network.Management.Sdk/Generated/IVpnSitesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IVpnSitesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSitesOperations operations. @@ -26,6 +16,9 @@ public partial interface IVpnSitesOperations /// /// Retrieves the details of a VPN site. /// + /// + /// Retrieves the details of a VPN site. + /// /// /// The resource group name of the VpnSite. /// @@ -44,14 +37,16 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VpnSite resource if it doesn't exist else updates the - /// existing VpnSite. + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. /// + /// + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. + /// /// /// The resource group name of the VpnSite. /// @@ -73,13 +68,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates VpnSite tags. /// + /// + /// Updates VpnSite tags. + /// /// /// The resource group name of the VpnSite. /// @@ -101,13 +97,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VpnSite. /// + /// + /// Deletes a VpnSite. + /// /// /// The resource group name of the VpnSite. /// @@ -123,13 +120,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the vpnSites in a resource group. /// + /// + /// Lists all the vpnSites in a resource group. + /// /// /// The resource group name of the VpnSite. /// @@ -145,13 +143,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnSites in a subscription. /// + /// + /// Lists all the VpnSites in a subscription. + /// /// /// The headers that will be added to request. /// @@ -164,14 +163,16 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a VpnSite resource if it doesn't exist else updates the - /// existing VpnSite. + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. /// + /// + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. + /// /// /// The resource group name of the VpnSite. /// @@ -193,13 +194,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VpnSite. /// + /// + /// Deletes a VpnSite. + /// /// /// The resource group name of the VpnSite. /// @@ -215,13 +217,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the vpnSites in a resource group. /// + /// + /// Lists all the vpnSites in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -237,13 +240,14 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the VpnSites in a subscription. /// + /// + /// Lists all the VpnSites in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,9 +263,7 @@ public partial interface IVpnSitesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IWebApplicationFirewallPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IWebApplicationFirewallPoliciesOperations.cs index beb301402d7a..de057b4af34b 100644 --- a/src/Network/Network.Management.Sdk/Generated/IWebApplicationFirewallPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IWebApplicationFirewallPoliciesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// WebApplicationFirewallPoliciesOperations operations. @@ -26,6 +16,9 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Lists all of the protection policies within a resource group. /// + /// + /// Lists all of the protection policies within a resource group. + /// /// /// The name of the resource group. /// @@ -41,13 +34,14 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the WAF policies in a subscription. /// + /// + /// Gets all the WAF policies in a subscription. + /// /// /// The headers that will be added to request. /// @@ -60,14 +54,14 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieve protection policy with specified name within a resource - /// group. + /// Retrieve protection policy with specified name within a resource group. /// + /// + /// Retrieve protection policy with specified name within a resource group. + /// /// /// The name of the resource group. /// @@ -86,14 +80,16 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates or update policy with specified rule set name within a - /// resource group. + /// Creates or update policy with specified rule set name within a resource + /// group. /// + /// + /// Creates or update policy with specified rule set name within a resource + /// group. + /// /// /// The name of the resource group. /// @@ -115,13 +111,14 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes Policy. /// + /// + /// Deletes Policy. + /// /// /// The name of the resource group. /// @@ -137,13 +134,14 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes Policy. /// + /// + /// Deletes Policy. + /// /// /// The name of the resource group. /// @@ -159,13 +157,14 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the protection policies within a resource group. /// + /// + /// Lists all of the protection policies within a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -181,13 +180,14 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the WAF policies in a subscription. /// + /// + /// Gets all the WAF policies in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -203,9 +203,7 @@ public partial interface IWebApplicationFirewallPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IWebCategoriesOperations.cs b/src/Network/Network.Management.Sdk/Generated/IWebCategoriesOperations.cs index cc37e92c8902..73843d707fff 100644 --- a/src/Network/Network.Management.Sdk/Generated/IWebCategoriesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IWebCategoriesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// WebCategoriesOperations operations. @@ -26,12 +16,14 @@ public partial interface IWebCategoriesOperations /// /// Gets the specified Azure Web Category. /// + /// + /// Gets the specified Azure Web Category. + /// /// /// The name of the azureWebCategory. /// /// - /// Expands resourceIds back referenced by the azureWebCategory - /// resource. + /// Expands resourceIds back referenced by the azureWebCategory resource. /// /// /// The headers that will be added to request. @@ -45,13 +37,14 @@ public partial interface IWebCategoriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Azure Web Categories in a subscription. /// + /// + /// Gets all the Azure Web Categories in a subscription. + /// /// /// The headers that will be added to request. /// @@ -64,13 +57,14 @@ public partial interface IWebCategoriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Azure Web Categories in a subscription. /// + /// + /// Gets all the Azure Web Categories in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -86,9 +80,7 @@ public partial interface IWebCategoriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperations.cs index e1eed83f2b7b..d7a3c8bb26a8 100644 --- a/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// InboundNatRulesOperations operations. /// - internal partial class InboundNatRulesOperations : IServiceOperations, IInboundNatRulesOperations + internal partial class InboundNatRulesOperations : Microsoft.Rest.IServiceOperations, IInboundNatRulesOperations { /// /// Initializes a new instance of the InboundNatRulesOperations class. @@ -36,13 +24,13 @@ internal partial class InboundNatRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal InboundNatRulesOperations(NetworkManagementClient client) + internal InboundNatRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal InboundNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified load balancer inbound NAT rule. /// @@ -257,16 +261,16 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// The name of the inbound NAT rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -290,13 +294,13 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -305,48 +309,61 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (inboundNatRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inboundNatRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("inboundNatRuleName", inboundNatRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{inboundNatRuleName}", System.Uri.EscapeDataString(inboundNatRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -360,25 +377,24 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -390,55 +406,56 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -448,9 +465,10 @@ internal InboundNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -461,25 +479,29 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a load balancer inbound NAT rule. /// @@ -496,16 +518,16 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update inbound NAT rule operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -526,10 +548,10 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,47 +560,59 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (inboundNatRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inboundNatRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("inboundNatRuleName", inboundNatRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{inboundNatRuleName}", System.Uri.EscapeDataString(inboundNatRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -588,25 +622,24 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -618,55 +651,56 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -676,20 +710,25 @@ internal InboundNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a load balancer inbound NAT rule. /// @@ -711,13 +750,13 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -726,52 +765,65 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (inboundNatRuleParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inboundNatRuleParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (inboundNatRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inboundNatRuleName"); } - if (inboundNatRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleParameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("inboundNatRuleName", inboundNatRuleName); - tracingParameters.Add("inboundNatRuleParameters", inboundNatRuleParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("inboundNatRuleParameters", inboundNatRuleParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{inboundNatRuleName}", System.Uri.EscapeDataString(inboundNatRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -781,25 +833,24 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -811,61 +862,62 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(inboundNatRuleParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(inboundNatRuleParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(inboundNatRuleParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -875,9 +927,10 @@ internal InboundNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -888,16 +941,16 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -906,25 +959,29 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the inbound NAT rules in a load balancer. /// @@ -937,13 +994,13 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -952,51 +1009,54 @@ internal InboundNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1008,55 +1068,56 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1066,9 +1127,10 @@ internal InboundNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1079,24 +1141,28 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperationsExtensions.cs index ce57987bf53c..02333f24c229 100644 --- a/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/InboundNatRulesOperationsExtensions.cs @@ -1,341 +1,313 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for InboundNatRulesOperations. + /// Extension methods for InboundNatRulesOperations /// public static partial class InboundNatRulesOperationsExtensions { - /// - /// Gets all the inbound NAT rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the inbound NAT rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - public static void Delete(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName) - { - operations.DeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// Expands referenced resources. - /// - public static InboundNatRule Get(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).GetAwaiter().GetResult(); - } + /// + /// Gets all the inbound NAT rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((IInboundNatRulesOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the inbound NAT rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + public static void Delete(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName) + { + ((IInboundNatRulesOperations)operations).DeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// Parameters supplied to the create or update inbound NAT rule operation. - /// - public static InboundNatRule CreateOrUpdate(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + /// + /// Expands referenced resources. + /// + public static InboundNatRule Get(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string)) + { + return ((IInboundNatRulesOperations)operations).GetAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// Parameters supplied to the create or update inbound NAT rule operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + public static InboundNatRule CreateOrUpdate(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters) + { + return ((IInboundNatRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - public static void BeginDelete(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName) + /// + /// Creates or updates a load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + public static void BeginDelete(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName) + { + ((IInboundNatRulesOperations)operations).BeginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + public static InboundNatRule BeginCreateOrUpdate(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters) + { + return ((IInboundNatRulesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// Parameters supplied to the create or update inbound NAT rule operation. - /// - public static InboundNatRule BeginCreateOrUpdate(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters) + /// + /// Creates or updates a load balancer inbound NAT rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the inbound NAT rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the inbound NAT rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IInboundNatRulesOperations operations, string nextPageLink) + { + return ((IInboundNatRulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer inbound NAT rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the inbound NAT rule. - /// - /// - /// Parameters supplied to the create or update inbound NAT rule operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IInboundNatRulesOperations operations, string resourceGroupName, string loadBalancerName, string inboundNatRuleName, InboundNatRule inboundNatRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the inbound NAT rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IInboundNatRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all the inbound NAT rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IInboundNatRulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the inbound NAT rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IInboundNatRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperations.cs b/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperations.cs index 95ca698a8fec..0e334184af16 100644 --- a/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// InboundSecurityRuleOperations operations. /// - internal partial class InboundSecurityRuleOperations : IServiceOperations, IInboundSecurityRuleOperations + internal partial class InboundSecurityRuleOperations : Microsoft.Rest.IServiceOperations, IInboundSecurityRuleOperations { /// /// Initializes a new instance of the InboundSecurityRuleOperations class. @@ -36,13 +24,13 @@ internal partial class InboundSecurityRuleOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal InboundSecurityRuleOperations(NetworkManagementClient client) + internal InboundSecurityRuleOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates or updates the specified Network Virtual Appliance Inbound Security - /// Rules. + /// Creates or updates the specified Network Virtual Appliance Inbound Security Rules. /// /// /// The name of the resource group. @@ -68,16 +55,16 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) /// Inbound Security Rules operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -103,13 +90,13 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -118,52 +105,65 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + if (ruleCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("ruleCollectionName", ruleCollectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -173,25 +173,24 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -203,61 +202,62 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -267,9 +267,10 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -280,16 +281,16 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -298,24 +299,28 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperationsExtensions.cs index 1cb335d0625b..e0e182793f5c 100644 --- a/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/InboundSecurityRuleOperationsExtensions.cs @@ -1,137 +1,110 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for InboundSecurityRuleOperations. + /// Extension methods for InboundSecurityRuleOperations /// public static partial class InboundSecurityRuleOperationsExtensions { - /// - /// Creates or updates the specified Network Virtual Appliance Inbound Security - /// Rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of security rule collection. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance - /// Inbound Security Rules operation. - /// - public static InboundSecurityRule CreateOrUpdate(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters).GetAwaiter().GetResult(); - } + /// + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of security rule collection. + /// + public static InboundSecurityRule CreateOrUpdate(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters) + { + return ((IInboundSecurityRuleOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance Inbound Security - /// Rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of security rule collection. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance - /// Inbound Security Rules operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of security rule collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of security rule collection. + /// + public static InboundSecurityRule BeginCreateOrUpdate(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters) + { + return ((IInboundSecurityRuleOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance Inbound Security - /// Rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of security rule collection. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance - /// Inbound Security Rules operation. - /// - public static InboundSecurityRule BeginCreateOrUpdate(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters) + /// + /// Creates or updates the specified Network Virtual Appliance Inbound Security + /// Rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of security rule collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates or updates the specified Network Virtual Appliance Inbound Security - /// Rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of security rule collection. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance - /// Inbound Security Rules operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IInboundSecurityRuleOperations operations, string resourceGroupName, string networkVirtualApplianceName, string ruleCollectionName, InboundSecurityRule parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperations.cs index 98cbf7a9bbf5..e456a8c8eda3 100644 --- a/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperations.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// IpAllocationsOperations operations. + /// IPAllocationsOperations operations. /// - internal partial class IpAllocationsOperations : IServiceOperations, IIpAllocationsOperations + internal partial class IPAllocationsOperations : Microsoft.Rest.IServiceOperations, IIPAllocationsOperations { /// - /// Initializes a new instance of the IpAllocationsOperations class. + /// Initializes a new instance of the IPAllocationsOperations class. /// /// /// Reference to the service client. @@ -36,13 +24,13 @@ internal partial class IpAllocationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IpAllocationsOperations(NetworkManagementClient client) + internal IPAllocationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// The name of the IpAllocation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipAllocationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipAllocationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ipAllocationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAllocationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipAllocationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipAllocationName", ipAllocationName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipAllocationName}", System.Uri.EscapeDataString(ipAllocationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal IpAllocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an IpAllocation in the specified resource group. /// @@ -287,16 +292,16 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update virtual network operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ipAllocationName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAllocationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ipAllocationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipAllocationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipAllocationName", ipAllocationName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipAllocationName}", System.Uri.EscapeDataString(ipAllocationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal IpAllocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpAllocations in a subscription. /// @@ -516,13 +537,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,29 +552,38 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +593,24 @@ internal IpAllocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +622,56 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +681,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +695,29 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpAllocations in a resource group. /// @@ -695,13 +730,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,35 +745,45 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal IpAllocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified IpAllocation. /// @@ -883,10 +933,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ipAllocationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAllocationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipAllocationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipAllocationName", ipAllocationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipAllocationName}", System.Uri.EscapeDataString(ipAllocationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal IpAllocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an IpAllocation in the specified resource group. /// @@ -1059,13 +1125,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,46 +1140,58 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipAllocationName, IpAllocation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ipAllocationName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAllocationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ipAllocationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipAllocationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipAllocationName", ipAllocationName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipAllocationName}", System.Uri.EscapeDataString(ipAllocationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1123,25 +1201,24 @@ internal IpAllocationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1153,61 +1230,62 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1217,9 +1295,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1230,16 +1309,16 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1248,25 +1327,29 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpAllocations in a subscription. /// @@ -1279,13 +1362,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1294,51 +1377,54 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1350,55 +1436,56 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1408,9 +1495,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1421,25 +1509,29 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpAllocations in a resource group. /// @@ -1452,13 +1544,13 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,51 +1559,54 @@ internal IpAllocationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1523,55 +1618,56 @@ internal IpAllocationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1677,10 @@ internal IpAllocationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1594,24 +1691,28 @@ internal IpAllocationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperationsExtensions.cs index 598f88a5f8b5..f7fc596c68f8 100644 --- a/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/IpAllocationsOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for IpAllocationsOperations. + /// Extension methods for IPAllocationsOperations /// - public static partial class IpAllocationsOperationsExtensions + public static partial class IPAllocationsOperationsExtensions { - /// - /// Deletes the specified IpAllocation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - public static void Delete(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName) - { - operations.DeleteAsync(resourceGroupName, ipAllocationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified IpAllocation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ipAllocationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified IpAllocation by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Expands referenced resources. - /// - public static IpAllocation Get(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, ipAllocationName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified IpAllocation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + public static void Delete(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName) + { + ((IIPAllocationsOperations)operations).DeleteAsync(resourceGroupName, ipAllocationName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified IpAllocation by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ipAllocationName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified IpAllocation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ipAllocationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified IpAllocation by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// Expands referenced resources. + /// + public static IpAllocation Get(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, string expand = default(string)) + { + return ((IIPAllocationsOperations)operations).GetAsync(resourceGroupName, ipAllocationName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an IpAllocation in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - public static IpAllocation CreateOrUpdate(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters) + /// + /// Gets the specified IpAllocation by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ipAllocationName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates an IpAllocation in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + public static IpAllocation CreateOrUpdate(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters) + { + return ((IIPAllocationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an IpAllocation in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an IpAllocation in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates a IpAllocation tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + public static IpAllocation UpdateTags(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, TagsObject parameters) + { + return ((IIPAllocationsOperations)operations).UpdateTagsAsync(resourceGroupName, ipAllocationName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a IpAllocation tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Parameters supplied to update IpAllocation tags. - /// - public static IpAllocation UpdateTags(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, TagsObject parameters) + /// + /// Updates a IpAllocation tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, ipAllocationName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all IpAllocations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IIPAllocationsOperations operations) + { + return ((IIPAllocationsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Updates a IpAllocation tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Parameters supplied to update IpAllocation tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all IpAllocations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IIPAllocationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all IpAllocations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IIPAllocationsOperations operations, string resourceGroupName) + { + return ((IIPAllocationsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all IpAllocations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IIpAllocationsOperations operations) + /// + /// Gets all IpAllocations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IIPAllocationsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified IpAllocation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + public static void BeginDelete(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName) + { + ((IIPAllocationsOperations)operations).BeginDeleteAsync(resourceGroupName, ipAllocationName).GetAwaiter().GetResult(); + } - /// - /// Gets all IpAllocations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IIpAllocationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified IpAllocation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipAllocationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an IpAllocation in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + public static IpAllocation BeginCreateOrUpdate(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters) + { + return ((IIPAllocationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all IpAllocations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IIpAllocationsOperations operations, string resourceGroupName) + /// + /// Creates or updates an IpAllocation in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the IpAllocation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IIPAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all IpAllocations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IIPAllocationsOperations operations, string nextPageLink) + { + return ((IIPAllocationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all IpAllocations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IIpAllocationsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all IpAllocations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IIPAllocationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all IpAllocations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IIPAllocationsOperations operations, string nextPageLink) + { + return ((IIPAllocationsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified IpAllocation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - public static void BeginDelete(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName) + /// + /// Gets all IpAllocations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IIPAllocationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, ipAllocationName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified IpAllocation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipAllocationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates an IpAllocation in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - public static IpAllocation BeginCreateOrUpdate(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an IpAllocation in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the IpAllocation. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IIpAllocationsOperations operations, string resourceGroupName, string ipAllocationName, IpAllocation parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipAllocationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all IpAllocations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IIpAllocationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all IpAllocations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IIpAllocationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all IpAllocations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IIpAllocationsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all IpAllocations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IIpAllocationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/IpGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/IpGroupsOperations.cs index 890794405c36..b2871c37a548 100644 --- a/src/Network/Network.Management.Sdk/Generated/IpGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/IpGroupsOperations.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// IpGroupsOperations operations. + /// IPGroupsOperations operations. /// - internal partial class IpGroupsOperations : IServiceOperations, IIpGroupsOperations + internal partial class IPGroupsOperations : Microsoft.Rest.IServiceOperations, IIPGroupsOperations { /// - /// Initializes a new instance of the IpGroupsOperations class. + /// Initializes a new instance of the IPGroupsOperations class. /// /// /// Reference to the service client. @@ -36,13 +24,13 @@ internal partial class IpGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IpGroupsOperations(NetworkManagementClient client) + internal IPGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -69,13 +57,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,42 +72,54 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ipGroupsName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipGroupsName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipGroupsName", ipGroupsName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal IpGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,50 +162,51 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -216,9 +216,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -229,25 +230,29 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an ipGroups in a specified resource group. /// @@ -261,16 +266,16 @@ internal IpGroupsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update IpGroups operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -291,13 +296,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -306,46 +311,57 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateGroupsWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateGroupsWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ipGroupsName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ipGroupsName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipGroupsName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipGroupsName", ipGroupsName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateGroups", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateGroups", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -355,25 +371,24 @@ internal IpGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -385,56 +400,57 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -444,9 +460,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -457,25 +474,29 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified ipGroups. /// @@ -486,16 +507,16 @@ internal IpGroupsOperations(NetworkManagementClient client) /// The name of the ipGroups. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -510,13 +531,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -525,35 +546,45 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +594,24 @@ internal IpGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,50 +623,51 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -646,9 +677,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -659,25 +691,29 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpGroups in a subscription. /// @@ -687,13 +723,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -702,29 +738,38 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -734,25 +779,24 @@ internal IpGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -764,50 +808,51 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -817,9 +862,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -830,25 +876,29 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an ipGroups in a specified resource group. /// @@ -867,13 +917,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -882,46 +932,58 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (ipGroupsName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (ipGroupsName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipGroupsName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipGroupsName", ipGroupsName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -931,25 +993,24 @@ internal IpGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -961,56 +1022,57 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1020,9 +1082,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1033,16 +1096,16 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1051,25 +1114,29 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified ipGroups. /// @@ -1085,10 +1152,10 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1097,41 +1164,52 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (ipGroupsName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipGroupsName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ipGroupsName", ipGroupsName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1141,25 +1219,24 @@ internal IpGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1171,50 +1248,51 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1224,20 +1302,25 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpGroups in a resource group. /// @@ -1250,13 +1333,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1265,51 +1348,54 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1321,50 +1407,51 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1374,9 +1461,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1387,25 +1475,29 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all IpGroups in a subscription. /// @@ -1418,13 +1510,13 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1433,51 +1525,54 @@ internal IpGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1489,50 +1584,51 @@ internal IpGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1542,9 +1638,10 @@ internal IpGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1555,24 +1652,28 @@ internal IpGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/IpGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/IpGroupsOperationsExtensions.cs index 183df83b900e..5b39f9f0e8fc 100644 --- a/src/Network/Network.Management.Sdk/Generated/IpGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/IpGroupsOperationsExtensions.cs @@ -1,415 +1,378 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for IpGroupsOperations. + /// Extension methods for IPGroupsOperations /// - public static partial class IpGroupsOperationsExtensions + public static partial class IPGroupsOperationsExtensions { - /// - /// Gets the specified ipGroups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back - /// referenced by the IpGroups resource. - /// - public static IpGroup Get(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, ipGroupsName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified ipGroups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back - /// referenced by the IpGroups resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ipGroupsName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an ipGroups in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Parameters supplied to the create or update IpGroups operation. - /// - public static IpGroup CreateOrUpdate(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); - } + /// + /// Gets the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back + /// referenced by the IpGroups resource. + /// + public static IpGroup Get(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, string expand = default(string)) + { + return ((IIPGroupsOperations)operations).GetAsync(resourceGroupName, ipGroupsName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an ipGroups in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Parameters supplied to the create or update IpGroups operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back + /// referenced by the IpGroups resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ipGroupsName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static IpGroup CreateOrUpdate(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters) + { + return ((IIPGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates tags of an IpGroups resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Parameters supplied to the update ipGroups operation. - /// - public static IpGroup UpdateGroups(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, TagsObject parameters) + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateGroupsAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates tags of an IpGroups resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static IpGroup UpdateGroups(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, TagsObject parameters) + { + return ((IIPGroupsOperations)operations).UpdateGroupsAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates tags of an IpGroups resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Parameters supplied to the update ipGroups operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateGroupsAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates tags of an IpGroups resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateGroupsAsync(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateGroupsWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateGroupsWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static void Delete(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName) + { + ((IIPGroupsOperations)operations).DeleteAsync(resourceGroupName, ipGroupsName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ipGroups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - public static void Delete(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName) - { - operations.DeleteAsync(resourceGroupName, ipGroupsName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all IpGroups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IIPGroupsOperations operations, string resourceGroupName) + { + return ((IIPGroupsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ipGroups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all IpGroups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IIPGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Gets all IpGroups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IIPGroupsOperations operations) + { + return ((IIPGroupsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all IpGroups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IIpGroupsOperations operations, string resourceGroupName) + /// + /// Gets all IpGroups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IIPGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static IpGroup BeginCreateOrUpdate(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters) + { + return ((IIPGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all IpGroups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IIpGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static void BeginDelete(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName) + { + ((IIPGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, ipGroupsName).GetAwaiter().GetResult(); + } - /// - /// Gets all IpGroups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IIpGroupsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IIPGroupsOperations operations, string resourceGroupName, string ipGroupsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all IpGroups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IIPGroupsOperations operations, string nextPageLink) + { + return ((IIPGroupsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all IpGroups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IIpGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all IpGroups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IIPGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all IpGroups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IIPGroupsOperations operations, string nextPageLink) + { + return ((IIPGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an ipGroups in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Parameters supplied to the create or update IpGroups operation. - /// - public static IpGroup BeginCreateOrUpdate(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters) + /// + /// Gets all IpGroups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IIPGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates or updates an ipGroups in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// Parameters supplied to the create or update IpGroups operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified ipGroups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - public static void BeginDelete(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName) - { - operations.BeginDeleteAsync(resourceGroupName, ipGroupsName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified ipGroups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ipGroups. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all IpGroups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IIpGroupsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all IpGroups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IIpGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all IpGroups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IIpGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all IpGroups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IIpGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperations.cs index dbbbf886fde5..263b4a8e84b0 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerBackendAddressPoolsOperations operations. /// - internal partial class LoadBalancerBackendAddressPoolsOperations : IServiceOperations, ILoadBalancerBackendAddressPoolsOperations + internal partial class LoadBalancerBackendAddressPoolsOperations : Microsoft.Rest.IServiceOperations, ILoadBalancerBackendAddressPoolsOperations { /// /// Initializes a new instance of the LoadBalancerBackendAddressPoolsOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancerBackendAddressPoolsOperations : IServiceOpera /// /// Thrown when a required parameter is null /// - internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient client) + internal LoadBalancerBackendAddressPoolsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets load balancer backend address pool. /// @@ -262,13 +266,13 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (backendAddressPoolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backendAddressPoolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backendAddressPoolName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("backendAddressPoolName", backendAddressPoolName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{backendAddressPoolName}", System.Uri.EscapeDataString(backendAddressPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a load balancer backend address pool. /// @@ -464,16 +485,16 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// pool operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -489,16 +510,16 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// The name of the backend address pool. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -523,13 +544,13 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,52 +559,65 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (backendAddressPoolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backendAddressPoolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backendAddressPoolName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("backendAddressPoolName", backendAddressPoolName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{backendAddressPoolName}", System.Uri.EscapeDataString(backendAddressPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -593,25 +627,24 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -623,61 +656,62 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -687,9 +721,10 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -700,16 +735,16 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -718,25 +753,29 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified load balancer backend address pool. /// @@ -755,10 +794,10 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -767,47 +806,59 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (backendAddressPoolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backendAddressPoolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backendAddressPoolName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("backendAddressPoolName", backendAddressPoolName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{backendAddressPoolName}", System.Uri.EscapeDataString(backendAddressPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +868,24 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +897,56 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,20 +956,25 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancer backed address pools. /// @@ -931,13 +987,13 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1002,54 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1061,56 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1120,10 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1134,28 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperationsExtensions.cs index 3deb44df2008..11b9b0602426 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerBackendAddressPoolsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancerBackendAddressPoolsOperations. + /// Extension methods for LoadBalancerBackendAddressPoolsOperations /// public static partial class LoadBalancerBackendAddressPoolsOperationsExtensions { - /// - /// Gets all the load balancer backed address pools. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancer backed address pools. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - public static BackendAddressPool Get(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName) - { - return operations.GetAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).GetAwaiter().GetResult(); - } - - /// - /// Gets load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// Parameters supplied to the create or update load balancer backend address - /// pool operation. - /// - public static BackendAddressPool CreateOrUpdate(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters).GetAwaiter().GetResult(); - } + /// + /// Gets all the load balancer backed address pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((ILoadBalancerBackendAddressPoolsOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// Parameters supplied to the create or update load balancer backend address - /// pool operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the load balancer backed address pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + public static BackendAddressPool Get(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName) + { + return ((ILoadBalancerBackendAddressPoolsOperations)operations).GetAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - public static void Delete(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName) + /// + /// Gets load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + public static BackendAddressPool CreateOrUpdate(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters) + { + return ((ILoadBalancerBackendAddressPoolsOperations)operations).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + public static void Delete(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName) + { + ((ILoadBalancerBackendAddressPoolsOperations)operations).DeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// Parameters supplied to the create or update load balancer backend address - /// pool operation. - /// - public static BackendAddressPool BeginCreateOrUpdate(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + public static BackendAddressPool BeginCreateOrUpdate(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters) + { + return ((ILoadBalancerBackendAddressPoolsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// Parameters supplied to the create or update load balancer backend address - /// pool operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, BackendAddressPool parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + public static void BeginDelete(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName) + { + ((ILoadBalancerBackendAddressPoolsOperations)operations).BeginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - public static void BeginDelete(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName) - { - operations.BeginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified load balancer backend address pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all the load balancer backed address pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancerBackendAddressPoolsOperations operations, string nextPageLink) + { + return ((ILoadBalancerBackendAddressPoolsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified load balancer backend address pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the backend address pool. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string resourceGroupName, string loadBalancerName, string backendAddressPoolName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the load balancer backed address pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Gets all the load balancer backed address pools. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancerBackendAddressPoolsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancer backed address pools. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancerBackendAddressPoolsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index d800d7c9c8f2..1cc0d6ae42b2 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerFrontendIPConfigurationsOperations operations. /// - internal partial class LoadBalancerFrontendIPConfigurationsOperations : IServiceOperations, ILoadBalancerFrontendIPConfigurationsOperations + internal partial class LoadBalancerFrontendIPConfigurationsOperations : Microsoft.Rest.IServiceOperations, ILoadBalancerFrontendIPConfigurationsOperations { /// /// Initializes a new instance of the LoadBalancerFrontendIPConfigurationsOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancerFrontendIPConfigurationsOperations : IService /// /// Thrown when a required parameter is null /// - internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient client) + internal LoadBalancerFrontendIPConfigurationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets load balancer frontend IP configuration. /// @@ -262,13 +266,13 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (frontendIPConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "frontendIPConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "frontendIPConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("frontendIPConfigurationName", frontendIPConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{frontendIPConfigurationName}", System.Uri.EscapeDataString(frontendIPConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancer frontend IP configurations. /// @@ -459,13 +480,13 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperationsExtensions.cs index a90b050c8850..8e9c83a89f78 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerFrontendIPConfigurationsOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancerFrontendIPConfigurationsOperations. + /// Extension methods for LoadBalancerFrontendIPConfigurationsOperations /// public static partial class LoadBalancerFrontendIPConfigurationsOperationsExtensions { - /// - /// Gets all the load balancer frontend IP configurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancer frontend IP configurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets all the load balancer frontend IP configurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((ILoadBalancerFrontendIPConfigurationsOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Gets load balancer frontend IP configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the frontend IP configuration. - /// - public static FrontendIPConfiguration Get(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName) + /// + /// Gets all the load balancer frontend IP configurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets load balancer frontend IP configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the frontend IP configuration. + /// + public static FrontendIPConfiguration Get(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName) + { + return ((ILoadBalancerFrontendIPConfigurationsOperations)operations).GetAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Gets load balancer frontend IP configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the frontend IP configuration. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets load balancer frontend IP configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the frontend IP configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancerFrontendIPConfigurationsOperations operations, string resourceGroupName, string loadBalancerName, string frontendIPConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the load balancer frontend IP configurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancerFrontendIPConfigurationsOperations operations, string nextPageLink) + { + return ((ILoadBalancerFrontendIPConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the load balancer frontend IP configurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancerFrontendIPConfigurationsOperations operations, string nextPageLink) + /// + /// Gets all the load balancer frontend IP configurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancerFrontendIPConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the load balancer frontend IP configurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancerFrontendIPConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperations.cs index 1dc44670dfe4..a338f481469d 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerLoadBalancingRulesOperations operations. /// - internal partial class LoadBalancerLoadBalancingRulesOperations : IServiceOperations, ILoadBalancerLoadBalancingRulesOperations + internal partial class LoadBalancerLoadBalancingRulesOperations : Microsoft.Rest.IServiceOperations, ILoadBalancerLoadBalancingRulesOperations { /// /// Initializes a new instance of the LoadBalancerLoadBalancingRulesOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancerLoadBalancingRulesOperations : IServiceOperat /// /// Thrown when a required parameter is null /// - internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client) + internal LoadBalancerLoadBalancingRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the specified load balancer load balancing rule. /// @@ -262,13 +266,13 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string loadBalancingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string loadBalancingRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (loadBalancingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancingRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancingRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("loadBalancingRuleName", loadBalancingRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{loadBalancingRuleName}", System.Uri.EscapeDataString(loadBalancingRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancing rules in a load balancer. /// @@ -459,13 +480,13 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperationsExtensions.cs index 98debe84760c..b3a439047695 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerLoadBalancingRulesOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancerLoadBalancingRulesOperations. + /// Extension methods for LoadBalancerLoadBalancingRulesOperations /// public static partial class LoadBalancerLoadBalancingRulesOperationsExtensions { - /// - /// Gets all the load balancing rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancing rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets all the load balancing rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((ILoadBalancerLoadBalancingRulesOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified load balancer load balancing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the load balancing rule. - /// - public static LoadBalancingRule Get(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName, string loadBalancingRuleName) + /// + /// Gets all the load balancing rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the specified load balancer load balancing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the load balancing rule. + /// + public static LoadBalancingRule Get(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName, string loadBalancingRuleName) + { + return ((ILoadBalancerLoadBalancingRulesOperations)operations).GetAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified load balancer load balancing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the load balancing rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName, string loadBalancingRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified load balancer load balancing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the load balancing rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancerLoadBalancingRulesOperations operations, string resourceGroupName, string loadBalancerName, string loadBalancingRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the load balancing rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancerLoadBalancingRulesOperations operations, string nextPageLink) + { + return ((ILoadBalancerLoadBalancingRulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the load balancing rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancerLoadBalancingRulesOperations operations, string nextPageLink) + /// + /// Gets all the load balancing rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancerLoadBalancingRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the load balancing rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancerLoadBalancingRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperations.cs index ac70284f2c3a..2b27608dedb4 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerNetworkInterfacesOperations operations. /// - internal partial class LoadBalancerNetworkInterfacesOperations : IServiceOperations, ILoadBalancerNetworkInterfacesOperations + internal partial class LoadBalancerNetworkInterfacesOperations : Microsoft.Rest.IServiceOperations, ILoadBalancerNetworkInterfacesOperations { /// /// Initializes a new instance of the LoadBalancerNetworkInterfacesOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancerNetworkInterfacesOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) + internal LoadBalancerNetworkInterfacesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets associated load balancer network interfaces. /// @@ -256,13 +260,13 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -271,51 +275,54 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -327,55 +334,56 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -385,9 +393,10 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -398,24 +407,28 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperationsExtensions.cs index 8671b46362c5..93545a89d67a 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerNetworkInterfacesOperationsExtensions.cs @@ -1,99 +1,88 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancerNetworkInterfacesOperations. + /// Extension methods for LoadBalancerNetworkInterfacesOperations /// public static partial class LoadBalancerNetworkInterfacesOperationsExtensions { - /// - /// Gets associated load balancer network interfaces. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this ILoadBalancerNetworkInterfacesOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } + /// + /// Gets associated load balancer network interfaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancerNetworkInterfacesOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((ILoadBalancerNetworkInterfacesOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Gets associated load balancer network interfaces. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancerNetworkInterfacesOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets associated load balancer network interfaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancerNetworkInterfacesOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets associated load balancer network interfaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancerNetworkInterfacesOperations operations, string nextPageLink) + { + return ((ILoadBalancerNetworkInterfacesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets associated load balancer network interfaces. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancerNetworkInterfacesOperations operations, string nextPageLink) + /// + /// Gets associated load balancer network interfaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancerNetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets associated load balancer network interfaces. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancerNetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperations.cs index 3e060a208eee..df42f56c35a3 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerOutboundRulesOperations operations. /// - internal partial class LoadBalancerOutboundRulesOperations : IServiceOperations, ILoadBalancerOutboundRulesOperations + internal partial class LoadBalancerOutboundRulesOperations : Microsoft.Rest.IServiceOperations, ILoadBalancerOutboundRulesOperations { /// /// Initializes a new instance of the LoadBalancerOutboundRulesOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancerOutboundRulesOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) + internal LoadBalancerOutboundRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the specified load balancer outbound rule. /// @@ -262,13 +266,13 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string outboundRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string outboundRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (outboundRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "outboundRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "outboundRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("outboundRuleName", outboundRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{outboundRuleName}", System.Uri.EscapeDataString(outboundRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the outbound rules in a load balancer. /// @@ -459,13 +480,13 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperationsExtensions.cs index eee33bc919d5..9090a1703445 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerOutboundRulesOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancerOutboundRulesOperations. + /// Extension methods for LoadBalancerOutboundRulesOperations /// public static partial class LoadBalancerOutboundRulesOperationsExtensions { - /// - /// Gets all the outbound rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the outbound rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets all the outbound rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((ILoadBalancerOutboundRulesOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified load balancer outbound rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the outbound rule. - /// - public static OutboundRule Get(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName, string outboundRuleName) + /// + /// Gets all the outbound rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, loadBalancerName, outboundRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the specified load balancer outbound rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the outbound rule. + /// + public static OutboundRule Get(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName, string outboundRuleName) + { + return ((ILoadBalancerOutboundRulesOperations)operations).GetAsync(resourceGroupName, loadBalancerName, outboundRuleName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified load balancer outbound rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the outbound rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName, string outboundRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified load balancer outbound rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the outbound rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancerOutboundRulesOperations operations, string resourceGroupName, string loadBalancerName, string outboundRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, outboundRuleName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, outboundRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the outbound rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancerOutboundRulesOperations operations, string nextPageLink) + { + return ((ILoadBalancerOutboundRulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the outbound rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancerOutboundRulesOperations operations, string nextPageLink) + /// + /// Gets all the outbound rules in a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancerOutboundRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the outbound rules in a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancerOutboundRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperations.cs index effe974f78b3..3f75e5280f0e 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancerProbesOperations operations. /// - internal partial class LoadBalancerProbesOperations : IServiceOperations, ILoadBalancerProbesOperations + internal partial class LoadBalancerProbesOperations : Microsoft.Rest.IServiceOperations, ILoadBalancerProbesOperations { /// /// Initializes a new instance of the LoadBalancerProbesOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancerProbesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal LoadBalancerProbesOperations(NetworkManagementClient client) + internal LoadBalancerProbesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets load balancer probe. /// @@ -262,13 +266,13 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string probeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string probeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (probeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "probeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "probeName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("probeName", probeName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{probeName}", System.Uri.EscapeDataString(probeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancer probes. /// @@ -459,13 +480,13 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperationsExtensions.cs index fbef8c94bfa9..636f01fc79d8 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancerProbesOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancerProbesOperations. + /// Extension methods for LoadBalancerProbesOperations /// public static partial class LoadBalancerProbesOperationsExtensions { - /// - /// Gets all the load balancer probes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static IPage List(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName) - { - return operations.ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancer probes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets all the load balancer probes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName) + { + return ((ILoadBalancerProbesOperations)operations).ListAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } - /// - /// Gets load balancer probe. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the probe. - /// - public static Probe Get(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName, string probeName) + /// + /// Gets all the load balancer probes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, loadBalancerName, probeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets load balancer probe. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the probe. + /// + public static Probe Get(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName, string probeName) + { + return ((ILoadBalancerProbesOperations)operations).GetAsync(resourceGroupName, loadBalancerName, probeName).GetAwaiter().GetResult(); + } - /// - /// Gets load balancer probe. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the probe. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName, string probeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets load balancer probe. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the probe. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancerProbesOperations operations, string resourceGroupName, string loadBalancerName, string probeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, probeName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, probeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the load balancer probes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancerProbesOperations operations, string nextPageLink) + { + return ((ILoadBalancerProbesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the load balancer probes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancerProbesOperations operations, string nextPageLink) + /// + /// Gets all the load balancer probes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancerProbesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the load balancer probes. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancerProbesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperations.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperations.cs index 4d0f51c8270e..3a84bdf8a841 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LoadBalancersOperations operations. /// - internal partial class LoadBalancersOperations : IServiceOperations, ILoadBalancersOperations + internal partial class LoadBalancersOperations : Microsoft.Rest.IServiceOperations, ILoadBalancersOperations { /// /// Initializes a new instance of the LoadBalancersOperations class. @@ -36,13 +24,13 @@ internal partial class LoadBalancersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal LoadBalancersOperations(NetworkManagementClient client) + internal LoadBalancersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// The name of the load balancer. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a load balancer. /// @@ -287,16 +292,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// Parameters supplied to the create or update load balancer operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (loadBalancerName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancers in a subscription. /// @@ -516,13 +537,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,29 +552,38 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +593,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +622,56 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +681,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +695,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancers in a resource group. /// @@ -695,13 +730,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,35 +745,45 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Swaps VIPs between two load balancers. /// @@ -878,16 +928,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// Parameters that define which VIPs should be swapped. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task SwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task SwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -906,16 +956,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// Query inbound NAT rule port mapping request. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(groupName, loadBalancerName, backendPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(groupName, loadBalancerName, backendPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -936,13 +986,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -951,56 +1001,66 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> MigrateToIpBasedWithHttpMessagesAsync(string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> MigrateToIpBasedWithHttpMessagesAsync(string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (groupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupName"); } if (groupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(groupName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "groupName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "groupName", "^[a-z][a-z0-9]*$"); } } if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } if (loadBalancerName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancerName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "loadBalancerName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "loadBalancerName", "^[a-z][a-z0-9]*$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("groupName", groupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "MigrateToIpBased", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "MigrateToIpBased", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/migrateToIpBased").ToString(); _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1010,25 +1070,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1040,61 +1099,62 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1104,9 +1164,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1117,25 +1178,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified load balancer. /// @@ -1151,10 +1216,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1163,41 +1228,52 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1207,25 +1283,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1237,55 +1312,56 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1295,20 +1371,25 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a load balancer. /// @@ -1327,13 +1408,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1342,46 +1423,58 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (loadBalancerName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1391,25 +1484,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1421,61 +1513,62 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1485,9 +1578,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1498,16 +1592,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1516,25 +1610,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Swaps VIPs between two load balancers. /// @@ -1550,10 +1648,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1562,40 +1660,51 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (parameters == null) + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapPublicIpAddresses", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSwapPublicIpAddresses", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1605,25 +1714,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1635,61 +1743,62 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1699,20 +1808,25 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List of inbound NAT rule port mappings. /// @@ -1734,13 +1848,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1749,52 +1863,65 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (groupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupName"); } + if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } + if (backendPoolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backendPoolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backendPoolName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("groupName", groupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("backendPoolName", backendPoolName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListInboundNatRulePortMappings", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListInboundNatRulePortMappings", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping").ToString(); _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{backendPoolName}", System.Uri.EscapeDataString(backendPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1804,25 +1931,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1834,61 +1960,62 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1898,9 +2025,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1911,16 +2039,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1929,25 +2057,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancers in a subscription. /// @@ -1960,13 +2092,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1975,51 +2107,54 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2031,55 +2166,56 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2089,9 +2225,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2102,25 +2239,29 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the load balancers in a resource group. /// @@ -2133,13 +2274,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2148,51 +2289,54 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2204,55 +2348,56 @@ internal LoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2262,9 +2407,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2275,24 +2421,28 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperationsExtensions.cs index 500cdcc275ea..e9c62eef6e30 100644 --- a/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LoadBalancersOperationsExtensions.cs @@ -1,637 +1,565 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LoadBalancersOperations. + /// Extension methods for LoadBalancersOperations /// public static partial class LoadBalancersOperationsExtensions { - /// - /// Deletes the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static void Delete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) + /// + /// Deletes the specified load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static void Delete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) + { + ((ILoadBalancersOperations)operations).DeleteAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// Expands referenced resources. + /// + public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string)) + { + return ((ILoadBalancersOperations)operations).GetAsync(resourceGroupName, loadBalancerName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Expands referenced resources. - /// - public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string)) + } + /// + /// Creates or updates a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) + { + return ((ILoadBalancersOperations)operations).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, loadBalancerName, expand).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// - public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) + } + /// + /// Updates a load balancer tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static LoadBalancer UpdateTags(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters) + { + return ((ILoadBalancersOperations)operations).UpdateTagsAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a load balancer tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates or updates a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Gets all the load balancers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this ILoadBalancersOperations operations) + { + return ((ILoadBalancersOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the load balancers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this ILoadBalancersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Updates a load balancer tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to update load balancer tags. - /// - public static LoadBalancer UpdateTags(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters) + } + /// + /// Gets all the load balancers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancersOperations operations, string resourceGroupName) + { + return ((ILoadBalancersOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the load balancers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Updates a load balancer tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to update load balancer tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where load balancers are located at. + /// + public static void SwapPublicIpAddresses(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters) + { + ((ILoadBalancersOperations)operations).SwapPublicIpAddressesAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where load balancers are located at. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SwapPublicIpAddressesAsync(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.SwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List of inbound NAT rule port mappings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the load balancer backend address pool. + /// + public static BackendAddressInboundNatRulePortMappings ListInboundNatRulePortMappings(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters) + { + return ((ILoadBalancersOperations)operations).ListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// List of inbound NAT rule port mappings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the load balancer backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListInboundNatRulePortMappingsAsync(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListInboundNatRulePortMappingsWithHttpMessagesAsync(groupName, loadBalancerName, backendPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all the load balancers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this ILoadBalancersOperations operations) + } + /// + /// Migrate load balancer to IP Based + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static MigratedPools MigrateToIpBased(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest)) + { + return ((ILoadBalancersOperations)operations).MigrateToIpBasedAsync(groupName, loadBalancerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Migrate load balancer to IP Based + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MigrateToIpBasedAsync(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.MigrateToIpBasedWithHttpMessagesAsync(groupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the load balancers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this ILoadBalancersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Deletes the specified load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) + { + ((ILoadBalancersOperations)operations).BeginDeleteAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) + { + return ((ILoadBalancersOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a load balancer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all the load balancers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this ILoadBalancersOperations operations, string resourceGroupName) + } + /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where load balancers are located at. + /// + public static void BeginSwapPublicIpAddresses(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters) + { + ((ILoadBalancersOperations)operations).BeginSwapPublicIpAddressesAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region where load balancers are located at. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginSwapPublicIpAddressesAsync(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List of inbound NAT rule port mappings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the load balancer backend address pool. + /// + public static BackendAddressInboundNatRulePortMappings BeginListInboundNatRulePortMappings(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters) + { + return ((ILoadBalancersOperations)operations).BeginListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// List of inbound NAT rule port mappings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + /// + /// The name of the load balancer backend address pool. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListInboundNatRulePortMappingsAsync(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(groupName, loadBalancerName, backendPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the load balancers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Gets all the load balancers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this ILoadBalancersOperations operations, string nextPageLink) + { + return ((ILoadBalancersOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the load balancers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - public static void SwapPublicIpAddresses(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters) - { - operations.SwapPublicIpAddressesAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The cancellation token. - /// - public static async Task SwapPublicIpAddressesAsync(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.SwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List of inbound NAT rule port mappings. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the load balancer backend address pool. - /// - /// - /// Query inbound NAT rule port mapping request. - /// - public static BackendAddressInboundNatRulePortMappings ListInboundNatRulePortMappings(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters) - { - return operations.ListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters).GetAwaiter().GetResult(); - } - - /// - /// List of inbound NAT rule port mappings. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the load balancer backend address pool. - /// - /// - /// Query inbound NAT rule port mapping request. - /// - /// - /// The cancellation token. - /// - public static async Task ListInboundNatRulePortMappingsAsync(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListInboundNatRulePortMappingsWithHttpMessagesAsync(groupName, loadBalancerName, backendPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Migrate load balancer to IP Based - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the migrateToIpBased Api. - /// - public static MigratedPools MigrateToIpBased(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest)) - { - return operations.MigrateToIpBasedAsync(groupName, loadBalancerName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Migrate load balancer to IP Based - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the migrateToIpBased Api. - /// - /// - /// The cancellation token. - /// - public static async Task MigrateToIpBasedAsync(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters = default(MigrateLoadBalancerToIpBasedRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.MigrateToIpBasedWithHttpMessagesAsync(groupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) + } + /// + /// Gets all the load balancers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancersOperations operations, string nextPageLink) + { + return ((ILoadBalancersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the load balancers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// - public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - public static void BeginSwapPublicIpAddresses(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters) - { - operations.BeginSwapPublicIpAddressesAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSwapPublicIpAddressesAsync(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List of inbound NAT rule port mappings. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the load balancer backend address pool. - /// - /// - /// Query inbound NAT rule port mapping request. - /// - public static BackendAddressInboundNatRulePortMappings BeginListInboundNatRulePortMappings(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters) - { - return operations.BeginListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters).GetAwaiter().GetResult(); - } - - /// - /// List of inbound NAT rule port mappings. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The name of the load balancer backend address pool. - /// - /// - /// Query inbound NAT rule port mapping request. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListInboundNatRulePortMappingsAsync(this ILoadBalancersOperations operations, string groupName, string loadBalancerName, string backendPoolName, QueryInboundNatRulePortMappingRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListInboundNatRulePortMappingsWithHttpMessagesAsync(groupName, loadBalancerName, backendPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the load balancers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this ILoadBalancersOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the load balancers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILoadBalancersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the load balancers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperations.cs index 64c40f3b5c32..a4aa3c8204f3 100644 --- a/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LocalNetworkGatewaysOperations operations. /// - internal partial class LocalNetworkGatewaysOperations : IServiceOperations, ILocalNetworkGatewaysOperations + internal partial class LocalNetworkGatewaysOperations : Microsoft.Rest.IServiceOperations, ILocalNetworkGatewaysOperations { /// /// Initializes a new instance of the LocalNetworkGatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class LocalNetworkGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal LocalNetworkGatewaysOperations(NetworkManagementClient client) + internal LocalNetworkGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -64,16 +52,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -91,13 +79,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -106,48 +94,58 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (localNetworkGatewayName != null) { if (localNetworkGatewayName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "localNetworkGatewayName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +155,24 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,55 +184,56 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -245,9 +243,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -258,25 +257,29 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified local network gateway. /// @@ -287,16 +290,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the local network gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +320,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,53 +335,63 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (localNetworkGatewayName != null) { if (localNetworkGatewayName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "localNetworkGatewayName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -388,25 +401,24 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -418,61 +430,62 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -482,9 +495,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -495,25 +509,29 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the local network gateways in a resource group. /// @@ -526,13 +544,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -541,35 +559,45 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -579,25 +607,24 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -609,55 +636,56 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -667,9 +695,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -680,25 +709,29 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a local network gateway in the specified resource group. /// @@ -718,13 +751,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -733,57 +766,67 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (localNetworkGatewayName != null) { if (localNetworkGatewayName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "localNetworkGatewayName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -793,25 +836,24 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -823,61 +865,62 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -887,9 +930,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -900,16 +944,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -918,25 +962,29 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified local network gateway. /// @@ -952,10 +1000,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -964,48 +1012,58 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (localNetworkGatewayName != null) { if (localNetworkGatewayName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "localNetworkGatewayName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1015,25 +1073,24 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1045,55 +1102,56 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1103,20 +1161,25 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the local network gateways in a resource group. /// @@ -1129,13 +1192,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1144,51 +1207,54 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1200,55 +1266,56 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1258,9 +1325,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1271,24 +1339,28 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperationsExtensions.cs index 57ef9990085b..e584fdd8da00 100644 --- a/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/LocalNetworkGatewaysOperationsExtensions.cs @@ -1,349 +1,310 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LocalNetworkGatewaysOperations. + /// Extension methods for LocalNetworkGatewaysOperations /// public static partial class LocalNetworkGatewaysOperationsExtensions { - /// - /// Creates or updates a local network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// - public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } + /// + /// Creates or updates a local network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) + { + return ((ILocalNetworkGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a local network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a local network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the specified local network gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + { + return ((ILocalNetworkGatewaysOperations)operations).GetAsync(resourceGroupName, localNetworkGatewayName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified local network gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + /// + /// Gets the specified local network gateway in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, localNetworkGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified local network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + { + ((ILocalNetworkGatewaysOperations)operations).DeleteAsync(resourceGroupName, localNetworkGatewayName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified local network gateway in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified local network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a local network gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + public static LocalNetworkGateway UpdateTags(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, TagsObject parameters) + { + return ((ILocalNetworkGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified local network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + /// + /// Updates a local network gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, localNetworkGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the local network gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) + { + return ((ILocalNetworkGatewaysOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified local network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the local network gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates or updates a local network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) + { + return ((ILocalNetworkGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a local network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to update local network gateway tags. - /// - public static LocalNetworkGateway UpdateTags(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, TagsObject parameters) + /// + /// Creates or updates a local network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified local network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + { + ((ILocalNetworkGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName).GetAwaiter().GetResult(); + } - /// - /// Updates a local network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to update local network gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified local network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the local network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all the local network gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILocalNetworkGatewaysOperations operations, string nextPageLink) + { + return ((ILocalNetworkGatewaysOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the local network gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) + /// + /// Gets all the local network gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILocalNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the local network gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a local network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// - public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a local network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified local network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) - { - operations.BeginDeleteAsync(resourceGroupName, localNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified local network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all the local network gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ILocalNetworkGatewaysOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the local network gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ILocalNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs index 7f2716a689c5..6d56021bd468 100644 --- a/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ManagementGroupNetworkManagerConnectionsOperations operations. /// - internal partial class ManagementGroupNetworkManagerConnectionsOperations : IServiceOperations, IManagementGroupNetworkManagerConnectionsOperations + internal partial class ManagementGroupNetworkManagerConnectionsOperations : Microsoft.Rest.IServiceOperations, IManagementGroupNetworkManagerConnectionsOperations { /// /// Initializes a new instance of the ManagementGroupNetworkManagerConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class ManagementGroupNetworkManagerConnectionsOperations : ISer /// /// Thrown when a required parameter is null /// - internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementClient client) + internal ManagementGroupNetworkManagerConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,9 +41,6 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// Create a network manager connection on this management group. /// - /// - /// Network manager connection to be created/updated. - /// /// /// The management group Id which uniquely identify the Microsoft Azure /// management group. @@ -63,19 +48,22 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// Name for the network manager connection. /// + /// + /// Network manager connection to be created/updated. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,41 +72,52 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, NetworkManagerConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } + if (networkManagerConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("managementGroupId", managementGroupId); tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -128,25 +127,24 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -158,61 +156,62 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -222,9 +221,10 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -235,16 +235,16 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -253,25 +253,29 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a specified connection created by this management group. /// @@ -288,13 +292,13 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -303,36 +307,46 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } + if (networkManagerConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("managementGroupId", managementGroupId); tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -342,25 +356,24 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -372,55 +385,56 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -430,9 +444,10 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -443,25 +458,29 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete specified pending connection created by this management group. /// @@ -478,10 +497,10 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -490,36 +509,46 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } + if (networkManagerConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("managementGroupId", managementGroupId); tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -529,25 +558,24 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -559,55 +587,56 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -617,20 +646,25 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network manager connections created by this management group. /// @@ -654,13 +688,13 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -669,50 +703,60 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string managementGroupId, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string managementGroupId, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (managementGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managementGroupId"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("managementGroupId", managementGroupId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections").ToString(); _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -723,25 +767,24 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -753,55 +796,56 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -811,9 +855,10 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -824,25 +869,29 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network manager connections created by this management group. /// @@ -855,13 +904,13 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -870,51 +919,54 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -926,55 +978,56 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -984,9 +1037,10 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -997,24 +1051,28 @@ internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementCli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs index b1696c6b5d43..8d857c970670 100644 --- a/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs @@ -1,244 +1,224 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ManagementGroupNetworkManagerConnectionsOperations. + /// Extension methods for ManagementGroupNetworkManagerConnectionsOperations /// public static partial class ManagementGroupNetworkManagerConnectionsOperationsExtensions { - /// - /// Create a network manager connection on this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Network manager connection to be created/updated. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// Name for the network manager connection. - /// - public static NetworkManagerConnection CreateOrUpdate(this IManagementGroupNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName) - { - return operations.CreateOrUpdateAsync(parameters, managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Create a network manager connection on this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Network manager connection to be created/updated. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// Name for the network manager connection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a specified connection created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// Name for the network manager connection. - /// - public static NetworkManagerConnection Get(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName) - { - return operations.GetAsync(managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); - } + /// + /// Create a network manager connection on this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection CreateOrUpdate(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, NetworkManagerConnection parameters) + { + return ((IManagementGroupNetworkManagerConnectionsOperations)operations).CreateOrUpdateAsync(managementGroupId, networkManagerConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Get a specified connection created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// Name for the network manager connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a network manager connection on this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, NetworkManagerConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get a specified connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection Get(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName) + { + return ((IManagementGroupNetworkManagerConnectionsOperations)operations).GetAsync(managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); + } - /// - /// Delete specified pending connection created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// Name for the network manager connection. - /// - public static void Delete(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName) + /// + /// Get a specified connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete specified pending connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + public static void Delete(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName) + { + ((IManagementGroupNetworkManagerConnectionsOperations)operations).DeleteAsync(managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); + } - /// - /// Delete specified pending connection created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// Name for the network manager connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List all network manager connections created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(managementGroupId, top, skipToken).GetAwaiter().GetResult(); - } + /// + /// Delete specified pending connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, int? top = default(int?), string skipToken = default(string)) + { + return ((IManagementGroupNetworkManagerConnectionsOperations)operations).ListAsync(managementGroupId, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// List all network manager connections created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The management group Id which uniquely identify the Microsoft Azure - /// management group. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(managementGroupId, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(managementGroupId, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IManagementGroupNetworkManagerConnectionsOperations operations, string nextPageLink) + { + return ((IManagementGroupNetworkManagerConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all network manager connections created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IManagementGroupNetworkManagerConnectionsOperations operations, string nextPageLink) + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all network manager connections created by this management group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AadAuthenticationParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/AadAuthenticationParameters.cs index c333467924de..4dc0efadd4ae 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AadAuthenticationParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AadAuthenticationParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AadAuthenticationParameters { /// - /// Initializes a new instance of the AadAuthenticationParameters - /// class. + /// Initializes a new instance of the AadAuthenticationParameters class. /// public AadAuthenticationParameters() { @@ -28,20 +21,23 @@ public AadAuthenticationParameters() } /// - /// Initializes a new instance of the AadAuthenticationParameters - /// class. + /// Initializes a new instance of the AadAuthenticationParameters class. /// - /// AAD Vpn authentication parameter AAD - /// tenant. - /// AAD Vpn authentication parameter AAD - /// audience. - /// AAD Vpn authentication parameter AAD - /// issuer. + + /// AAD Vpn authentication parameter AAD tenant. + /// + + /// AAD Vpn authentication parameter AAD audience. + /// + + /// AAD Vpn authentication parameter AAD issuer. + /// public AadAuthenticationParameters(string aadTenant = default(string), string aadAudience = default(string), string aadIssuer = default(string)) + { - AadTenant = aadTenant; - AadAudience = aadAudience; - AadIssuer = aadIssuer; + this.AadTenant = aadTenant; + this.AadAudience = aadAudience; + this.AadIssuer = aadIssuer; CustomInit(); } @@ -50,23 +46,23 @@ public AadAuthenticationParameters() /// partial void CustomInit(); + /// - /// Gets or sets AAD Vpn authentication parameter AAD tenant. + /// Gets or sets aAD Vpn authentication parameter AAD tenant. /// - [JsonProperty(PropertyName = "aadTenant")] - public string AadTenant { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aadTenant")] + public string AadTenant {get; set; } /// - /// Gets or sets AAD Vpn authentication parameter AAD audience. + /// Gets or sets aAD Vpn authentication parameter AAD audience. /// - [JsonProperty(PropertyName = "aadAudience")] - public string AadAudience { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aadAudience")] + public string AadAudience {get; set; } /// - /// Gets or sets AAD Vpn authentication parameter AAD issuer. + /// Gets or sets aAD Vpn authentication parameter AAD issuer. /// - [JsonProperty(PropertyName = "aadIssuer")] - public string AadIssuer { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "aadIssuer")] + public string AadIssuer {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Access.cs b/src/Network/Network.Management.Sdk/Generated/Models/Access.cs index 5b19a4cd7c65..d9cfc51f3f08 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Access.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Access.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for Access. /// + + public static class Access { public const string Allow = "Allow"; public const string Deny = "Deny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Action.cs b/src/Network/Network.Management.Sdk/Generated/Models/Action.cs index a6fe4b7be98c..bf1921759f9d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Action.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Action.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,20 @@ public Action() /// /// Initializes a new instance of the Action class. /// - /// Type of action to be taken. Supported types are - /// 'Remove', 'Add', 'Replace', and 'Drop.'. Possible values include: - /// 'Unknown', 'Remove', 'Add', 'Replace', 'Drop' - /// List of parameters relevant to the - /// action.For instance if type is drop then parameters has list of - /// prefixes to be dropped.If type is add, parameters would have list - /// of ASN numbers to be added - public Action(string type = default(string), IList parameters = default(IList)) + + /// Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', + /// and 'Drop.' + /// Possible values include: 'Unknown', 'Remove', 'Add', 'Replace', 'Drop' + + /// List of parameters relevant to the action.For instance if type is drop then + /// parameters has list of prefixes to be dropped.If type is add, parameters + /// would have list of ASN numbers to be added + /// + public Action(string type = default(string), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList)) + { - Type = type; - Parameters = parameters; + this.Type = type; + this.Parameters = parameters; CustomInit(); } @@ -50,22 +45,20 @@ public Action() /// partial void CustomInit(); + /// - /// Gets or sets type of action to be taken. Supported types are - /// 'Remove', 'Add', 'Replace', and 'Drop.'. Possible values include: - /// 'Unknown', 'Remove', 'Add', 'Replace', 'Drop' + /// Gets or sets type of action to be taken. Supported types are 'Remove', + /// 'Add', 'Replace', and 'Drop.' Possible values include: 'Unknown', 'Remove', 'Add', 'Replace', 'Drop' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets list of parameters relevant to the action.For instance - /// if type is drop then parameters has list of prefixes to be - /// dropped.If type is add, parameters would have list of ASN numbers - /// to be added + /// Gets or sets list of parameters relevant to the action.For instance if type + /// is drop then parameters has list of prefixes to be dropped.If type is add, + /// parameters would have list of ASN numbers to be added /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActionType.cs index 3fd10fee52e5..3a2f28cbde2a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ActionType. /// + + public static class ActionType { public const string AnomalyScoring = "AnomalyScoring"; @@ -22,4 +19,4 @@ public static class ActionType public const string Log = "Log"; public const string JSChallenge = "JSChallenge"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveBaseSecurityAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveBaseSecurityAdminRule.cs index 2b4c0e2bc2f0..00069acc7d43 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveBaseSecurityAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveBaseSecurityAdminRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ActiveBaseSecurityAdminRule { /// - /// Initializes a new instance of the ActiveBaseSecurityAdminRule - /// class. + /// Initializes a new instance of the ActiveBaseSecurityAdminRule class. /// public ActiveBaseSecurityAdminRule() { @@ -31,28 +22,39 @@ public ActiveBaseSecurityAdminRule() } /// - /// Initializes a new instance of the ActiveBaseSecurityAdminRule - /// class. + /// Initializes a new instance of the ActiveBaseSecurityAdminRule class. /// - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A description of the - /// security admin configuration. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - public ActiveBaseSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + + /// Resource ID. + /// + + /// Deployment time string. + /// + + /// Deployment region. + /// + + /// A description of the security admin configuration. + /// + + /// A description of the rule collection. + /// + + /// Groups for rule collection + /// + + /// Effective configuration groups. + /// + public ActiveBaseSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), System.Collections.Generic.IList ruleCollectionAppliesToGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList)) + { - Id = id; - CommitTime = commitTime; - Region = region; - ConfigurationDescription = configurationDescription; - RuleCollectionDescription = ruleCollectionDescription; - RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; - RuleGroups = ruleGroups; + this.Id = id; + this.CommitTime = commitTime; + this.Region = region; + this.ConfigurationDescription = configurationDescription; + this.RuleCollectionDescription = ruleCollectionDescription; + this.RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + this.RuleGroups = ruleGroups; CustomInit(); } @@ -61,47 +63,47 @@ public ActiveBaseSecurityAdminRule() /// partial void CustomInit(); + /// /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets deployment time string. /// - [JsonProperty(PropertyName = "commitTime")] - public System.DateTime? CommitTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime {get; set; } /// /// Gets or sets deployment region. /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; set; } /// /// Gets or sets a description of the security admin configuration. /// - [JsonProperty(PropertyName = "configurationDescription")] - public string ConfigurationDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription {get; set; } /// /// Gets or sets a description of the rule collection. /// - [JsonProperty(PropertyName = "ruleCollectionDescription")] - public string RuleCollectionDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription {get; set; } /// /// Gets or sets groups for rule collection /// - [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] - public IList RuleCollectionAppliesToGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public System.Collections.Generic.IList RuleCollectionAppliesToGroups {get; set; } /// /// Gets or sets effective configuration groups. /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroups")] + public System.Collections.Generic.IList RuleGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveConfigurationParameter.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveConfigurationParameter.cs index 1769e86f2518..6d3ee27d9fd9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveConfigurationParameter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveConfigurationParameter.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ActiveConfigurationParameter { /// - /// Initializes a new instance of the ActiveConfigurationParameter - /// class. + /// Initializes a new instance of the ActiveConfigurationParameter class. /// public ActiveConfigurationParameter() { @@ -30,17 +21,21 @@ public ActiveConfigurationParameter() } /// - /// Initializes a new instance of the ActiveConfigurationParameter - /// class. + /// Initializes a new instance of the ActiveConfigurationParameter class. /// - /// List of regions. - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. - public ActiveConfigurationParameter(IList regions = default(IList), string skipToken = default(string)) + + /// List of regions. + /// + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + public ActiveConfigurationParameter(System.Collections.Generic.IList regions = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Regions = regions; - SkipToken = skipToken; + this.Regions = regions; + this.SkipToken = skipToken; CustomInit(); } @@ -49,19 +44,19 @@ public ActiveConfigurationParameter() /// partial void CustomInit(); + /// /// Gets or sets list of regions. /// - [JsonProperty(PropertyName = "regions")] - public IList Regions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "regions")] + public System.Collections.Generic.IList Regions {get; set; } /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfiguration.cs index c9cd05eeed14..1c9c1a8ffb4b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ActiveConnectivityConfiguration : EffectiveConnectivityConfiguration { /// - /// Initializes a new instance of the ActiveConnectivityConfiguration - /// class. + /// Initializes a new instance of the ActiveConnectivityConfiguration class. /// public ActiveConnectivityConfiguration() { @@ -30,34 +21,50 @@ public ActiveConnectivityConfiguration() } /// - /// Initializes a new instance of the ActiveConnectivityConfiguration - /// class. + /// Initializes a new instance of the ActiveConnectivityConfiguration class. /// + /// Connectivity topology type. - /// Possible values include: 'HubAndSpoke', 'Mesh' - /// Groups for configuration - /// Connectivity configuration ID. - /// A description of the connectivity - /// configuration. - /// List of hubItems - /// Flag if global mesh is supported. Possible - /// values include: 'False', 'True' - /// The provisioning state of the - /// connectivity configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Flag if need to remove current - /// existing peerings. Possible values include: 'False', 'True' - /// Unique identifier for this - /// resource. - /// Effective configuration - /// groups. - /// Deployment time string. - /// Deployment region. - public ActiveConnectivityConfiguration(string connectivityTopology, IList appliesToGroups, string id = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), string resourceGuid = default(string), IList configurationGroups = default(IList), System.DateTime? commitTime = default(System.DateTime?), string region = default(string)) - : base(connectivityTopology, appliesToGroups, id, description, hubs, isGlobal, provisioningState, deleteExistingPeering, resourceGuid, configurationGroups) + /// Possible values include: 'HubAndSpoke', 'Mesh' + + /// Flag if global mesh is supported. + /// Possible values include: 'False', 'True' + + /// The provisioning state of the connectivity configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the connectivity configuration. + /// + + /// List of hubItems + /// + + /// Groups for configuration + /// + + /// Flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + + /// Unique identifier for this resource. + /// + + /// Connectivity configuration ID. + /// + + /// Effective configuration groups. + /// + + /// Deployment time string. + /// + + /// Deployment region. + /// + public ActiveConnectivityConfiguration(string connectivityTopology = default(string), string isGlobal = default(string), string provisioningState = default(string), string description = default(string), System.Collections.Generic.IList hubs = default(System.Collections.Generic.IList), System.Collections.Generic.IList appliesToGroups = default(System.Collections.Generic.IList), string deleteExistingPeering = default(string), string resourceGuid = default(string), string id = default(string), System.Collections.Generic.IList configurationGroups = default(System.Collections.Generic.IList), System.DateTime? commitTime = default(System.DateTime?), string region = default(string)) + + : base(id, configurationGroups, connectivityTopology, isGlobal, provisioningState, description, hubs, appliesToGroups, deleteExistingPeering, resourceGuid) { - CommitTime = commitTime; - Region = region; + this.CommitTime = commitTime; + this.Region = region; CustomInit(); } @@ -66,27 +73,17 @@ public ActiveConnectivityConfiguration() /// partial void CustomInit(); + /// /// Gets or sets deployment time string. /// - [JsonProperty(PropertyName = "commitTime")] - public System.DateTime? CommitTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime {get; set; } /// /// Gets or sets deployment region. /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfigurationsListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfigurationsListResult.cs index a6c9ddbd693b..ea5803902b51 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfigurationsListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveConnectivityConfigurationsListResult.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Result of the request to list active connectivity configurations. It - /// contains a list of active connectivity configurations and a skiptoken - /// to get the next set of results. + /// contains a list of active connectivity configurations and a skiptoken to + /// get the next set of results. /// public partial class ActiveConnectivityConfigurationsListResult { /// - /// Initializes a new instance of the - /// ActiveConnectivityConfigurationsListResult class. + /// Initializes a new instance of the ActiveConnectivityConfigurationsListResult class. /// public ActiveConnectivityConfigurationsListResult() { @@ -32,18 +23,21 @@ public ActiveConnectivityConfigurationsListResult() } /// - /// Initializes a new instance of the - /// ActiveConnectivityConfigurationsListResult class. + /// Initializes a new instance of the ActiveConnectivityConfigurationsListResult class. /// - /// Gets a page of active connectivity - /// configurations. - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. - public ActiveConnectivityConfigurationsListResult(IList value = default(IList), string skipToken = default(string)) + + /// Gets a page of active connectivity configurations. + /// + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + public ActiveConnectivityConfigurationsListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Value = value; - SkipToken = skipToken; + this.Value = value; + this.SkipToken = skipToken; CustomInit(); } @@ -52,19 +46,19 @@ public ActiveConnectivityConfigurationsListResult() /// partial void CustomInit(); + /// - /// Gets a page of active connectivity configurations. + /// Gets or sets gets a page of active connectivity configurations. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveDefaultSecurityAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveDefaultSecurityAdminRule.cs index c95124db09bb..dc20d7cdc5a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveDefaultSecurityAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveDefaultSecurityAdminRule.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network default admin rule. /// [Newtonsoft.Json.JsonObject("Default")] - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ActiveDefaultSecurityAdminRule : ActiveBaseSecurityAdminRule { /// - /// Initializes a new instance of the ActiveDefaultSecurityAdminRule - /// class. + /// Initializes a new instance of the ActiveDefaultSecurityAdminRule class. /// public ActiveDefaultSecurityAdminRule() { @@ -34,61 +23,83 @@ public ActiveDefaultSecurityAdminRule() } /// - /// Initializes a new instance of the ActiveDefaultSecurityAdminRule - /// class. + /// Initializes a new instance of the ActiveDefaultSecurityAdminRule class. /// - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A description of the - /// security admin configuration. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A description for this rule. Restricted - /// to 140 chars. - /// Default rule flag. + + /// Resource ID. + /// + + /// Deployment time string. + /// + + /// Deployment region. + /// + + /// A description of the security admin configuration. + /// + + /// A description of the rule collection. + /// + + /// Groups for rule collection + /// + + /// Effective configuration groups. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Default rule flag. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// The CIDR or source IP ranges. - /// The destination address prefixes. CIDR - /// or destination IP ranges. - /// The source port ranges. - /// The destination port - /// ranges. - /// Indicates the access allowed for this - /// particular rule. Possible values include: 'Allow', 'Deny', - /// 'AlwaysAllow' - /// The priority of the rule. The value can be - /// between 1 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. - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public ActiveDefaultSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string), string resourceGuid = default(string)) - : base(id, commitTime, region, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// Unique identifier for this resource. + /// + public ActiveDefaultSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), System.Collections.Generic.IList ruleCollectionAppliesToGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList), string provisioningState = default(string), string description = default(string), string flag = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string resourceGuid = default(string)) + + : base(id, commitTime, region, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) { - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Flag = flag; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -97,84 +108,80 @@ public ActiveDefaultSecurityAdminRule() /// partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; private set; } /// /// Gets or sets default rule flag. /// - [JsonProperty(PropertyName = "properties.flag")] - public string Flag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flag")] + public string Flag {get; set; } /// - /// Gets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// Gets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; private set; } /// /// Gets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sources")] + public System.Collections.Generic.IList Sources {get; private set; } /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. + /// Gets the destination address prefixes. CIDR or destination IP ranges. /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinations")] + public System.Collections.Generic.IList Destinations {get; private set; } /// /// Gets the source port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; private set; } /// /// Gets the destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; private set; } /// - /// Gets indicates the access allowed for this particular rule. - /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// Gets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; private set; } /// - /// Gets the priority of the rule. The value can be between 1 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. + /// Gets the priority of the rule. The value can be between 1 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. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; private set; } /// - /// Gets indicates if the traffic matched against the rule in inbound - /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// Gets indicates if the traffic matched against the rule in inbound or + /// outbound. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; private set; } - - /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; private set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRule.cs index b932de1e2bb3..5f5afa38439d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRule.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network admin rule. /// [Newtonsoft.Json.JsonObject("Custom")] - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ActiveSecurityAdminRule : ActiveBaseSecurityAdminRule { /// @@ -35,56 +25,77 @@ public ActiveSecurityAdminRule() /// /// Initializes a new instance of the ActiveSecurityAdminRule class. /// + + /// Resource ID. + /// + + /// Deployment time string. + /// + + /// Deployment region. + /// + + /// A description of the security admin configuration. + /// + + /// A description of the rule collection. + /// + + /// Groups for rule collection + /// + + /// Effective configuration groups. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// Indicates the access allowed for this - /// particular rule. Possible values include: 'Allow', 'Deny', - /// 'AlwaysAllow' - /// The priority of the rule. The value can be - /// between 1 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. - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A description of the - /// security admin configuration. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A description for this rule. Restricted - /// to 140 chars. - /// The CIDR or source IP ranges. - /// The destination address prefixes. CIDR - /// or destination IP ranges. - /// The source port ranges. - /// The destination port - /// ranges. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public ActiveSecurityAdminRule(string protocol, string access, int priority, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string), string resourceGuid = default(string)) - : base(id, commitTime, region, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// Unique identifier for this resource. + /// + public ActiveSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), System.Collections.Generic.IList ruleCollectionAppliesToGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList), string provisioningState = default(string), string description = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string resourceGuid = default(string)) + + : base(id, commitTime, region, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) { - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -93,108 +104,105 @@ public ActiveSecurityAdminRule() /// partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// Gets or sets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// /// Gets or sets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sources")] + public System.Collections.Generic.IList Sources {get; set; } /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. + /// Gets or sets the destination address prefixes. CIDR or destination IP + /// ranges. /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Gets or sets the source port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// /// Gets or sets the destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// - /// Gets or sets indicates the access allowed for this particular rule. - /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// Gets or sets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; set; } /// - /// Gets or sets the priority of the rule. The value can be between 1 - /// 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. + /// Gets or sets the priority of the rule. The value can be between 1 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. /// - [JsonProperty(PropertyName = "properties.priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets indicates if the traffic matched against the rule in - /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// Gets or sets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; set; } - - /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - if (Access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); - } - if (Direction == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); - } - if (Priority > 4096) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 4096); - } - if (Priority < 1) + + + + + + + + + if (this.Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + if (this.Priority > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRulesListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRulesListResult.cs index 343d36d55c0c..2e2aab8e9581 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRulesListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ActiveSecurityAdminRulesListResult.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Result of the request to list active security admin rules. It contains - /// a list of active security admin rules and a skiptoken to get the next - /// set of results. + /// Result of the request to list active security admin rules. It contains a + /// list of active security admin rules and a skiptoken to get the next set of + /// results. /// public partial class ActiveSecurityAdminRulesListResult { /// - /// Initializes a new instance of the - /// ActiveSecurityAdminRulesListResult class. + /// Initializes a new instance of the ActiveSecurityAdminRulesListResult class. /// public ActiveSecurityAdminRulesListResult() { @@ -32,18 +23,21 @@ public ActiveSecurityAdminRulesListResult() } /// - /// Initializes a new instance of the - /// ActiveSecurityAdminRulesListResult class. + /// Initializes a new instance of the ActiveSecurityAdminRulesListResult class. /// - /// Gets a page of active security admin - /// rules. - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. - public ActiveSecurityAdminRulesListResult(IList value = default(IList), string skipToken = default(string)) + + /// Gets a page of active security admin rules. + /// + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + public ActiveSecurityAdminRulesListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Value = value; - SkipToken = skipToken; + this.Value = value; + this.SkipToken = skipToken; CustomInit(); } @@ -52,19 +46,19 @@ public ActiveSecurityAdminRulesListResult() /// partial void CustomInit(); + /// - /// Gets a page of active security admin rules. + /// Gets or sets gets a page of active security admin rules. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixItem.cs b/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixItem.cs index 1874f1867c22..2fa09b7c8d2b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixItem.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixItem.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public AddressPrefixItem() /// /// Initializes a new instance of the AddressPrefixItem class. /// - /// Address prefix. - /// Address prefix type. Possible - /// values include: 'IPPrefix', 'ServiceTag' + + /// Address prefix. + /// + + /// Address prefix type. + /// Possible values include: 'IPPrefix', 'ServiceTag' public AddressPrefixItem(string addressPrefix = default(string), string addressPrefixType = default(string)) + { - AddressPrefix = addressPrefix; - AddressPrefixType = addressPrefixType; + this.AddressPrefix = addressPrefix; + this.AddressPrefixType = addressPrefixType; CustomInit(); } @@ -44,18 +42,17 @@ public AddressPrefixItem() /// partial void CustomInit(); + /// /// Gets or sets address prefix. /// - [JsonProperty(PropertyName = "addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets or sets address prefix type. Possible values include: - /// 'IPPrefix', 'ServiceTag' + /// Gets or sets address prefix type. Possible values include: 'IPPrefix', 'ServiceTag' /// - [JsonProperty(PropertyName = "addressPrefixType")] - public string AddressPrefixType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixType")] + public string AddressPrefixType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixType.cs index c094c49264ca..a5ae901a1797 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AddressPrefixType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AddressPrefixType. /// + + public static class AddressPrefixType { public const string IPPrefix = "IPPrefix"; public const string ServiceTag = "ServiceTag"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AddressSpace.cs b/src/Network/Network.Management.Sdk/Generated/Models/AddressSpace.cs index 516a18645a4a..f8fa2793d03f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AddressSpace.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AddressSpace.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,11 +24,14 @@ public AddressSpace() /// /// Initializes a new instance of the AddressSpace class. /// - /// A list of address blocks reserved for - /// this virtual network in CIDR notation. - public AddressSpace(IList addressPrefixes = default(IList)) + + /// A list of address blocks reserved for this virtual network in CIDR + /// notation. + /// + public AddressSpace(System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList)) + { - AddressPrefixes = addressPrefixes; + this.AddressPrefixes = addressPrefixes; CustomInit(); } @@ -45,12 +40,12 @@ public AddressSpace() /// partial void CustomInit(); + /// - /// Gets or sets a list of address blocks reserved for this virtual - /// network in CIDR notation. + /// Gets or sets a list of address blocks reserved for this virtual network in + /// CIDR notation. /// - [JsonProperty(PropertyName = "addressPrefixes")] - public IList AddressPrefixes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminPropertiesFormat.cs new file mode 100644 index 000000000000..6d63b5969f55 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminPropertiesFormat.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Security admin rule resource. + /// + public partial class AdminPropertiesFormat + { + /// + /// Initializes a new instance of the AdminPropertiesFormat class. + /// + public AdminPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminPropertiesFormat class. + /// + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Unique identifier for this resource. + /// + public AdminPropertiesFormat(string protocol, string access, int priority, string direction, string description = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sources")] + public System.Collections.Generic.IList Sources {get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } + + /// + /// Gets or sets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; set; } + + /// + /// Gets or sets the priority of the rule. The value can be between 1 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int Priority {get; set; } + + /// + /// Gets or sets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public string Direction {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Protocol == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + } + if (this.Access == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Access"); + } + if (this.Direction == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Direction"); + } + + + + + + + + if (this.Priority > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminRule.cs index 84f69a327d59..586a3025abca 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminRule.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network admin rule. /// [Newtonsoft.Json.JsonObject("Custom")] - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AdminRule : BaseAdminRule { /// @@ -35,53 +25,71 @@ public AdminRule() /// /// Initializes a new instance of the AdminRule class. /// + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// Indicates the access allowed for this - /// particular rule. Possible values include: 'Allow', 'Deny', - /// 'AlwaysAllow' - /// The priority of the rule. The value can be - /// between 1 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. - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The system metadata related to this - /// resource. - /// A description for this rule. Restricted - /// to 140 chars. - /// The CIDR or source IP ranges. - /// The destination address prefixes. CIDR - /// or destination IP ranges. - /// The source port ranges. - /// The destination port - /// ranges. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public AdminRule(string protocol, string access, int priority, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string), string resourceGuid = default(string)) - : base(id, name, type, etag, systemData) + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// Unique identifier for this resource. + /// + public AdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string resourceGuid = default(string)) + + : base(id, name, type, etag, systemData) { - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -90,108 +98,105 @@ public AdminRule() /// partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// Gets or sets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// /// Gets or sets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sources")] + public System.Collections.Generic.IList Sources {get; set; } /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. + /// Gets or sets the destination address prefixes. CIDR or destination IP + /// ranges. /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Gets or sets the source port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// /// Gets or sets the destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// - /// Gets or sets indicates the access allowed for this particular rule. - /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// Gets or sets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; set; } /// - /// Gets or sets the priority of the rule. The value can be between 1 - /// 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. + /// Gets or sets the priority of the rule. The value can be between 1 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. /// - [JsonProperty(PropertyName = "properties.priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets indicates if the traffic matched against the rule in - /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// Gets or sets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; set; } - - /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - if (Access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); - } - if (Direction == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); - } - if (Priority > 4096) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 4096); - } - if (Priority < 1) + + + + + + + + + if (this.Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + if (this.Priority > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollection.cs index 51dcae852778..dece4618789e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollection.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Defines the admin rule collection. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AdminRuleCollection : ChildResource { /// @@ -34,29 +24,42 @@ public AdminRuleCollection() /// /// Initializes a new instance of the AdminRuleCollection class. /// - /// Groups for configuration - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A description of the admin rule - /// collection. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - /// The system metadata related to this - /// resource. - public AdminRuleCollection(IList appliesToGroups, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), string provisioningState = default(string), string resourceGuid = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the admin rule collection. + /// + + /// Groups for configuration + /// + + /// Unique identifier for this resource. + /// + public AdminRuleCollection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), System.Collections.Generic.IList appliesToGroups = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, etag) { - Description = description; - AppliesToGroups = appliesToGroups; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; - SystemData = systemData; + this.SystemData = systemData; + this.ProvisioningState = provisioningState; + this.Description = description; + this.AppliesToGroups = appliesToGroups; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -65,59 +68,35 @@ public AdminRuleCollection() /// partial void CustomInit(); - /// - /// Gets or sets a description of the admin rule collection. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } /// - /// Gets or sets groups for configuration + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.appliesToGroups")] - public IList AppliesToGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets unique identifier for this resource. + /// Gets or sets a description of the admin rule collection. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets the system metadata related to this resource. + /// Gets or sets groups for configuration /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.appliesToGroups")] + public System.Collections.Generic.IList AppliesToGroups {get; set; } /// - /// Validate the object. + /// Gets unique identifier for this resource. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AppliesToGroups == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppliesToGroups"); - } - if (AppliesToGroups != null) - { - foreach (var element in AppliesToGroups) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionPropertiesFormat.cs new file mode 100644 index 000000000000..d9204c9b834a --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionPropertiesFormat.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Defines the admin rule collection properties. + /// + public partial class AdminRuleCollectionPropertiesFormat + { + /// + /// Initializes a new instance of the AdminRuleCollectionPropertiesFormat class. + /// + public AdminRuleCollectionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminRuleCollectionPropertiesFormat class. + /// + + /// A description of the admin rule collection. + /// + + /// Groups for configuration + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Unique identifier for this resource. + /// + public AdminRuleCollectionPropertiesFormat(System.Collections.Generic.IList appliesToGroups, string description = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.AppliesToGroups = appliesToGroups; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description of the admin rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets groups for configuration + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "appliesToGroups")] + public System.Collections.Generic.IList AppliesToGroups {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.AppliesToGroups == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AppliesToGroups"); + } + + if (this.AppliesToGroups != null) + { + foreach (var element in this.AppliesToGroups) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionsDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionsDeleteHeaders.cs index c0696140d27b..dbbeb3ec7959 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionsDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleCollectionsDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class AdminRuleCollectionsDeleteHeaders { /// - /// Initializes a new instance of the AdminRuleCollectionsDeleteHeaders - /// class. + /// Initializes a new instance of the AdminRuleCollectionsDeleteHeaders class. /// public AdminRuleCollectionsDeleteHeaders() { @@ -28,14 +18,15 @@ public AdminRuleCollectionsDeleteHeaders() } /// - /// Initializes a new instance of the AdminRuleCollectionsDeleteHeaders - /// class. + /// Initializes a new instance of the AdminRuleCollectionsDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public AdminRuleCollectionsDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public AdminRuleCollectionsDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleKind.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleKind.cs new file mode 100644 index 000000000000..679d22180b6e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminRuleKind.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for AdminRuleKind. + /// + + + public static class AdminRuleKind + { + public const string Custom = "Custom"; + public const string Default = "Default"; + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminRulesDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminRulesDeleteHeaders.cs index 8116bcf4595a..f791487ad104 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AdminRulesDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminRulesDeleteHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class AdminRulesDeleteHeaders { /// @@ -29,11 +20,13 @@ public AdminRulesDeleteHeaders() /// /// Initializes a new instance of the AdminRulesDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public AdminRulesDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,12 +35,11 @@ public AdminRulesDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AdminState.cs b/src/Network/Network.Management.Sdk/Generated/Models/AdminState.cs index 06c83cb367c1..12c1ec5dbb0b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AdminState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AdminState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AdminState. /// + + public static class AdminState { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGateway.cs index c3e39dac9c51..cd743854ae46 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Application gateway resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGateway : Resource { /// @@ -34,158 +24,216 @@ public ApplicationGateway() /// /// Initializes a new instance of the ApplicationGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// SKU of the application gateway resource. - /// SSL policy of the application gateway - /// resource. - /// Operational state of the application - /// gateway resource. Possible values include: 'Stopped', 'Starting', - /// 'Running', 'Stopping' - /// Subnets of the application - /// gateway resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Authentication - /// certificates of the application gateway resource. For default + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// A list of availability zones denoting where the resource needs to come + /// from. + /// + + /// The identity of the application gateway, if configured. + /// + + /// The provisioning state of the application gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// SKU of the application gateway resource. + /// + + /// SSL policy of the application gateway resource. + /// + + /// Operational state of the application gateway resource. + /// Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' + + /// Subnets of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Authentication certificates of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Trusted Root certificates of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Trusted client certificates of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// SSL certificates of the application gateway resource. For default limits, + /// see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Frontend IP addresses of the application gateway resource. For default /// limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Trusted Root certificates of - /// the application gateway resource. For default limits, see + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Frontend ports of the application gateway resource. For default limits, see /// [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Trusted client certificates - /// of the application gateway resource. For default limits, see + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Probes of the application gateway resource. + /// + + /// Backend address pool of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Backend http settings of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Backend settings of the application gateway resource. For default limits, + /// see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Http listeners of the application gateway resource. For default limits, see /// [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// SSL certificates of the application - /// gateway resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Frontend IP addresses of the - /// application gateway resource. For default limits, see [Application - /// Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Frontend ports of the application - /// gateway resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Probes of the application gateway - /// resource. - /// Backend address pool of the - /// application gateway resource. For default limits, see [Application - /// Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Backend http settings - /// of the application gateway resource. For default limits, see + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Listeners of the application gateway resource. For default limits, see /// [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Backend settings of the - /// application gateway resource. For default limits, see [Application - /// Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Http listeners of the application - /// gateway resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Listeners of the application gateway - /// resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// SSL profiles of the application gateway - /// resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// URL path map of the application gateway - /// resource. For default limits, see [Application Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Request routing rules of the - /// application gateway resource. - /// Routing rules of the application gateway - /// resource. - /// Rewrite rules for the application - /// gateway resource. - /// Redirect configurations of the - /// application gateway resource. For default limits, see [Application - /// Gateway - /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - /// Web application - /// firewall configuration. - /// Reference to the FirewallPolicy - /// resource. - /// Whether HTTP2 is enabled on the - /// application gateway resource. - /// Whether FIPS is enabled on the application - /// gateway resource. - /// Autoscale - /// Configuration. - /// PrivateLink configurations - /// on application gateway. - /// Private Endpoint - /// connections on application gateway. - /// The resource GUID property of the - /// application gateway resource. - /// The provisioning state of the - /// application gateway resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Custom error configurations - /// of the application gateway resource. - /// If true, associates a - /// firewall policy with an application gateway regardless whether the - /// policy differs from the WAF Config. - /// Load distribution policies - /// of the application gateway resource. - /// Global Configuration. - /// The default predefined SSL - /// Policy applied on the application gateway resource. Possible values - /// include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', - /// 'AppGwSslPolicy20220101S' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A list of availability zones denoting where the - /// resource needs to come from. - /// The identity of the application gateway, if - /// configured. - public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), IList gatewayIPConfigurations = default(IList), IList authenticationCertificates = default(IList), IList trustedRootCertificates = default(IList), IList trustedClientCertificates = default(IList), IList sslCertificates = default(IList), IList frontendIPConfigurations = default(IList), IList frontendPorts = default(IList), IList probes = default(IList), IList backendAddressPools = default(IList), IList backendHttpSettingsCollection = default(IList), IList backendSettingsCollection = default(IList), IList httpListeners = default(IList), IList listeners = default(IList), IList sslProfiles = default(IList), IList urlPathMaps = default(IList), IList requestRoutingRules = default(IList), IList routingRules = default(IList), IList rewriteRuleSets = default(IList), IList redirectConfigurations = default(IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), SubResource firewallPolicy = default(SubResource), bool? enableHttp2 = default(bool?), bool? enableFips = default(bool?), ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration = default(ApplicationGatewayAutoscaleConfiguration), IList privateLinkConfigurations = default(IList), IList privateEndpointConnections = default(IList), string resourceGuid = default(string), string provisioningState = default(string), IList customErrorConfigurations = default(IList), bool? forceFirewallPolicyAssociation = default(bool?), IList loadDistributionPolicies = default(IList), ApplicationGatewayGlobalConfiguration globalConfiguration = default(ApplicationGatewayGlobalConfiguration), string defaultPredefinedSslPolicy = default(string), string etag = default(string), IList zones = default(IList), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(id, name, type, location, tags) + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// SSL profiles of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// URL path map of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Request routing rules of the application gateway resource. + /// + + /// Routing rules of the application gateway resource. + /// + + /// Rewrite rules for the application gateway resource. + /// + + /// Redirect configurations of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Web application firewall configuration. + /// + + /// Reference to the FirewallPolicy resource. + /// + + /// Whether HTTP2 is enabled on the application gateway resource. + /// + + /// Whether FIPS is enabled on the application gateway resource. + /// + + /// Autoscale Configuration. + /// + + /// PrivateLink configurations on application gateway. + /// + + /// Private Endpoint connections on application gateway. + /// + + /// The resource GUID property of the application gateway resource. + /// + + /// Custom error configurations of the application gateway resource. + /// + + /// If true, associates a firewall policy with an application gateway + /// regardless whether the policy differs from the WAF Config. + /// + + /// Load distribution policies of the application gateway resource. + /// + + /// Global Configuration. + /// + + /// The default predefined SSL Policy applied on the application gateway + /// resource. + /// Possible values include: 'AppGwSslPolicy20150501', + /// 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', + /// 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), System.Collections.Generic.IList gatewayIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList trustedRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList trustedClientCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList sslCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList listeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList sslProfiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList routingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList rewriteRuleSets = default(System.Collections.Generic.IList), System.Collections.Generic.IList redirectConfigurations = default(System.Collections.Generic.IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), SubResource firewallPolicy = default(SubResource), bool? enableHttp2 = default(bool?), bool? enableFips = default(bool?), ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration = default(ApplicationGatewayAutoscaleConfiguration), System.Collections.Generic.IList privateLinkConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string resourceGuid = default(string), System.Collections.Generic.IList customErrorConfigurations = default(System.Collections.Generic.IList), bool? forceFirewallPolicyAssociation = default(bool?), System.Collections.Generic.IList loadDistributionPolicies = default(System.Collections.Generic.IList), ApplicationGatewayGlobalConfiguration globalConfiguration = default(ApplicationGatewayGlobalConfiguration), string defaultPredefinedSslPolicy = default(string)) + + : base(id, name, type, location, tags) { - Sku = sku; - SslPolicy = sslPolicy; - OperationalState = operationalState; - GatewayIPConfigurations = gatewayIPConfigurations; - AuthenticationCertificates = authenticationCertificates; - TrustedRootCertificates = trustedRootCertificates; - TrustedClientCertificates = trustedClientCertificates; - SslCertificates = sslCertificates; - FrontendIPConfigurations = frontendIPConfigurations; - FrontendPorts = frontendPorts; - Probes = probes; - BackendAddressPools = backendAddressPools; - BackendHttpSettingsCollection = backendHttpSettingsCollection; - BackendSettingsCollection = backendSettingsCollection; - HttpListeners = httpListeners; - Listeners = listeners; - SslProfiles = sslProfiles; - UrlPathMaps = urlPathMaps; - RequestRoutingRules = requestRoutingRules; - RoutingRules = routingRules; - RewriteRuleSets = rewriteRuleSets; - RedirectConfigurations = redirectConfigurations; - WebApplicationFirewallConfiguration = webApplicationFirewallConfiguration; - FirewallPolicy = firewallPolicy; - EnableHttp2 = enableHttp2; - EnableFips = enableFips; - AutoscaleConfiguration = autoscaleConfiguration; - PrivateLinkConfigurations = privateLinkConfigurations; - PrivateEndpointConnections = privateEndpointConnections; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - CustomErrorConfigurations = customErrorConfigurations; - ForceFirewallPolicyAssociation = forceFirewallPolicyAssociation; - LoadDistributionPolicies = loadDistributionPolicies; - GlobalConfiguration = globalConfiguration; - DefaultPredefinedSslPolicy = defaultPredefinedSslPolicy; - Etag = etag; - Zones = zones; - Identity = identity; + this.Etag = etag; + this.Zones = zones; + this.Identity = identity; + this.ProvisioningState = provisioningState; + this.Sku = sku; + this.SslPolicy = sslPolicy; + this.OperationalState = operationalState; + this.GatewayIPConfigurations = gatewayIPConfigurations; + this.AuthenticationCertificates = authenticationCertificates; + this.TrustedRootCertificates = trustedRootCertificates; + this.TrustedClientCertificates = trustedClientCertificates; + this.SslCertificates = sslCertificates; + this.FrontendIPConfigurations = frontendIPConfigurations; + this.FrontendPorts = frontendPorts; + this.Probes = probes; + this.BackendAddressPools = backendAddressPools; + this.BackendHttpSettingsCollection = backendHttpSettingsCollection; + this.BackendSettingsCollection = backendSettingsCollection; + this.HttpListeners = httpListeners; + this.Listeners = listeners; + this.SslProfiles = sslProfiles; + this.UrlPathMaps = urlPathMaps; + this.RequestRoutingRules = requestRoutingRules; + this.RoutingRules = routingRules; + this.RewriteRuleSets = rewriteRuleSets; + this.RedirectConfigurations = redirectConfigurations; + this.WebApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + this.FirewallPolicy = firewallPolicy; + this.EnableHttp2 = enableHttp2; + this.EnableFips = enableFips; + this.AutoscaleConfiguration = autoscaleConfiguration; + this.PrivateLinkConfigurations = privateLinkConfigurations; + this.PrivateEndpointConnections = privateEndpointConnections; + this.ResourceGuid = resourceGuid; + this.CustomErrorConfigurations = customErrorConfigurations; + this.ForceFirewallPolicyAssociation = forceFirewallPolicyAssociation; + this.LoadDistributionPolicies = loadDistributionPolicies; + this.GlobalConfiguration = globalConfiguration; + this.DefaultPredefinedSslPolicy = defaultPredefinedSslPolicy; CustomInit(); } @@ -194,300 +242,301 @@ public ApplicationGateway() /// partial void CustomInit(); + /// - /// Gets or sets SKU of the application gateway resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.sku")] - public ApplicationGatewaySku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets SSL policy of the application gateway resource. + /// Gets or sets a list of availability zones denoting where the resource needs + /// to come from. /// - [JsonProperty(PropertyName = "properties.sslPolicy")] - public ApplicationGatewaySslPolicy SslPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets operational state of the application gateway resource. - /// Possible values include: 'Stopped', 'Starting', 'Running', - /// 'Stopping' + /// Gets or sets the identity of the application gateway, if configured. /// - [JsonProperty(PropertyName = "properties.operationalState")] - public string OperationalState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// - /// Gets or sets subnets of the application gateway resource. For - /// default limits, see [Application Gateway + /// Gets the provisioning state of the application gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets sKU of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public ApplicationGatewaySku Sku {get; set; } + + /// + /// Gets or sets sSL policy of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslPolicy")] + public ApplicationGatewaySslPolicy SslPolicy {get; set; } + + /// + /// Gets operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.operationalState")] + public string OperationalState {get; private set; } + + /// + /// Gets or sets subnets of the application gateway resource. For default + /// limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] - public IList GatewayIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] + public System.Collections.Generic.IList GatewayIPConfigurations {get; set; } /// /// Gets or sets authentication certificates of the application gateway /// resource. For default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.authenticationCertificates")] - public IList AuthenticationCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationCertificates")] + public System.Collections.Generic.IList AuthenticationCertificates {get; set; } /// - /// Gets or sets trusted Root certificates of the application gateway - /// resource. For default limits, see [Application Gateway + /// Gets or sets trusted Root certificates of the application gateway resource. + /// For default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.trustedRootCertificates")] - public IList TrustedRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trustedRootCertificates")] + public System.Collections.Generic.IList TrustedRootCertificates {get; set; } /// /// Gets or sets trusted client certificates of the application gateway /// resource. For default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.trustedClientCertificates")] - public IList TrustedClientCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trustedClientCertificates")] + public System.Collections.Generic.IList TrustedClientCertificates {get; set; } /// - /// Gets or sets SSL certificates of the application gateway resource. - /// For default limits, see [Application Gateway + /// Gets or sets sSL certificates of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.sslCertificates")] - public IList SslCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificates")] + public System.Collections.Generic.IList SslCertificates {get; set; } /// - /// Gets or sets frontend IP addresses of the application gateway - /// resource. For default limits, see [Application Gateway + /// Gets or sets frontend IP addresses of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } /// - /// Gets or sets frontend ports of the application gateway resource. - /// For default limits, see [Application Gateway + /// Gets or sets frontend ports of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.frontendPorts")] - public IList FrontendPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPorts")] + public System.Collections.Generic.IList FrontendPorts {get; set; } /// /// Gets or sets probes of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.probes")] - public IList Probes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probes")] + public System.Collections.Generic.IList Probes {get; set; } /// - /// Gets or sets backend address pool of the application gateway - /// resource. For default limits, see [Application Gateway + /// Gets or sets backend address pool of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } /// - /// Gets or sets backend http settings of the application gateway - /// resource. For default limits, see [Application Gateway + /// Gets or sets backend http settings of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] - public IList BackendHttpSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] + public System.Collections.Generic.IList BackendHttpSettingsCollection {get; set; } /// - /// Gets or sets backend settings of the application gateway resource. - /// For default limits, see [Application Gateway + /// Gets or sets backend settings of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.backendSettingsCollection")] - public IList BackendSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendSettingsCollection")] + public System.Collections.Generic.IList BackendSettingsCollection {get; set; } /// - /// Gets or sets http listeners of the application gateway resource. - /// For default limits, see [Application Gateway + /// Gets or sets http listeners of the application gateway resource. For + /// default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.httpListeners")] - public IList HttpListeners { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListeners")] + public System.Collections.Generic.IList HttpListeners {get; set; } /// - /// Gets or sets listeners of the application gateway resource. For - /// default limits, see [Application Gateway + /// Gets or sets listeners of the application gateway resource. For default + /// limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.listeners")] - public IList Listeners { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.listeners")] + public System.Collections.Generic.IList Listeners {get; set; } /// - /// Gets or sets SSL profiles of the application gateway resource. For - /// default limits, see [Application Gateway + /// Gets or sets sSL profiles of the application gateway resource. For default + /// limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.sslProfiles")] - public IList SslProfiles { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslProfiles")] + public System.Collections.Generic.IList SslProfiles {get; set; } /// - /// Gets or sets URL path map of the application gateway resource. For - /// default limits, see [Application Gateway + /// Gets or sets uRL path map of the application gateway resource. For default + /// limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.urlPathMaps")] - public IList UrlPathMaps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMaps")] + public System.Collections.Generic.IList UrlPathMaps {get; set; } /// - /// Gets or sets request routing rules of the application gateway - /// resource. + /// Gets or sets request routing rules of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.requestRoutingRules")] - public IList RequestRoutingRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestRoutingRules")] + public System.Collections.Generic.IList RequestRoutingRules {get; set; } /// /// Gets or sets routing rules of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.routingRules")] - public IList RoutingRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingRules")] + public System.Collections.Generic.IList RoutingRules {get; set; } /// /// Gets or sets rewrite rules for the application gateway resource. /// - [JsonProperty(PropertyName = "properties.rewriteRuleSets")] - public IList RewriteRuleSets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rewriteRuleSets")] + public System.Collections.Generic.IList RewriteRuleSets {get; set; } /// - /// Gets or sets redirect configurations of the application gateway - /// resource. For default limits, see [Application Gateway + /// Gets or sets redirect configurations of the application gateway resource. + /// For default limits, see [Application Gateway /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). /// - [JsonProperty(PropertyName = "properties.redirectConfigurations")] - public IList RedirectConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.redirectConfigurations")] + public System.Collections.Generic.IList RedirectConfigurations {get; set; } /// /// Gets or sets web application firewall configuration. /// - [JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] - public ApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] + public ApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration {get; set; } /// /// Gets or sets reference to the FirewallPolicy resource. /// - [JsonProperty(PropertyName = "properties.firewallPolicy")] - public SubResource FirewallPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewallPolicy")] + public SubResource FirewallPolicy {get; set; } /// - /// Gets or sets whether HTTP2 is enabled on the application gateway - /// resource. + /// Gets or sets whether HTTP2 is enabled on the application gateway resource. /// - [JsonProperty(PropertyName = "properties.enableHttp2")] - public bool? EnableHttp2 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableHttp2")] + public bool? EnableHttp2 {get; set; } /// - /// Gets or sets whether FIPS is enabled on the application gateway - /// resource. + /// Gets or sets whether FIPS is enabled on the application gateway resource. /// - [JsonProperty(PropertyName = "properties.enableFips")] - public bool? EnableFips { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFips")] + public bool? EnableFips {get; set; } /// /// Gets or sets autoscale Configuration. /// - [JsonProperty(PropertyName = "properties.autoscaleConfiguration")] - public ApplicationGatewayAutoscaleConfiguration AutoscaleConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoscaleConfiguration")] + public ApplicationGatewayAutoscaleConfiguration AutoscaleConfiguration {get; set; } /// /// Gets or sets privateLink configurations on application gateway. /// - [JsonProperty(PropertyName = "properties.privateLinkConfigurations")] - public IList PrivateLinkConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkConfigurations")] + public System.Collections.Generic.IList PrivateLinkConfigurations {get; set; } /// /// Gets private Endpoint connections on application gateway. /// - [JsonProperty(PropertyName = "properties.privateEndpointConnections")] - public IList PrivateEndpointConnections { get; private set; } - - /// - /// Gets the resource GUID property of the application gateway - /// resource. - /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } /// - /// Gets the provisioning state of the application gateway resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the resource GUID property of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Gets or sets custom error configurations of the application gateway /// resource. /// - [JsonProperty(PropertyName = "properties.customErrorConfigurations")] - public IList CustomErrorConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customErrorConfigurations")] + public System.Collections.Generic.IList CustomErrorConfigurations {get; set; } /// - /// Gets or sets if true, associates a firewall policy with an - /// application gateway regardless whether the policy differs from the - /// WAF Config. + /// Gets or sets if true, associates a firewall policy with an application + /// gateway regardless whether the policy differs from the WAF Config. /// - [JsonProperty(PropertyName = "properties.forceFirewallPolicyAssociation")] - public bool? ForceFirewallPolicyAssociation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceFirewallPolicyAssociation")] + public bool? ForceFirewallPolicyAssociation {get; set; } /// /// Gets or sets load distribution policies of the application gateway /// resource. /// - [JsonProperty(PropertyName = "properties.loadDistributionPolicies")] - public IList LoadDistributionPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistributionPolicies")] + public System.Collections.Generic.IList LoadDistributionPolicies {get; set; } /// /// Gets or sets global Configuration. /// - [JsonProperty(PropertyName = "properties.globalConfiguration")] - public ApplicationGatewayGlobalConfiguration GlobalConfiguration { get; set; } - - /// - /// Gets the default predefined SSL Policy applied on the application - /// gateway resource. Possible values include: - /// 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', - /// 'AppGwSslPolicy20220101S' - /// - [JsonProperty(PropertyName = "properties.defaultPredefinedSslPolicy")] - public string DefaultPredefinedSslPolicy { get; private set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets or sets a list of availability zones denoting where the - /// resource needs to come from. - /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.globalConfiguration")] + public ApplicationGatewayGlobalConfiguration GlobalConfiguration {get; set; } /// - /// Gets or sets the identity of the application gateway, if - /// configured. + /// Gets the default predefined SSL Policy applied on the application gateway + /// resource. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultPredefinedSslPolicy")] + public string DefaultPredefinedSslPolicy {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Probes != null) + + + + + + + + + + + + + + + if (this.Probes != null) { - foreach (var element in Probes) + foreach (var element in this.Probes) { if (element != null) { @@ -495,44 +544,60 @@ public virtual void Validate() } } } - if (BackendHttpSettingsCollection != null) + + if (this.BackendHttpSettingsCollection != null) { - foreach (var element1 in BackendHttpSettingsCollection) + foreach (var element in this.BackendHttpSettingsCollection) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (RequestRoutingRules != null) + + + + + + if (this.RequestRoutingRules != null) { - foreach (var element2 in RequestRoutingRules) + foreach (var element in this.RequestRoutingRules) { - if (element2 != null) + if (element != null) { - element2.Validate(); + element.Validate(); } } } - if (RoutingRules != null) + if (this.RoutingRules != null) { - foreach (var element3 in RoutingRules) + foreach (var element in this.RoutingRules) { - if (element3 != null) + if (element != null) { - element3.Validate(); + element.Validate(); } } } - if (WebApplicationFirewallConfiguration != null) + + + if (this.WebApplicationFirewallConfiguration != null) { - WebApplicationFirewallConfiguration.Validate(); + this.WebApplicationFirewallConfiguration.Validate(); } - if (AutoscaleConfiguration != null) + + if (this.AutoscaleConfiguration != null) { - AutoscaleConfiguration.Validate(); + this.AutoscaleConfiguration.Validate(); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs index 6966b3f852bf..682c696733aa 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Authentication certificates of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayAuthenticationCertificate : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayAuthenticationCertificate class. + /// Initializes a new instance of the ApplicationGatewayAuthenticationCertificate class. /// public ApplicationGatewayAuthenticationCertificate() { @@ -31,27 +22,36 @@ public ApplicationGatewayAuthenticationCertificate() } /// - /// Initializes a new instance of the - /// ApplicationGatewayAuthenticationCertificate class. + /// Initializes a new instance of the ApplicationGatewayAuthenticationCertificate class. /// - /// Resource ID. - /// Certificate public data. - /// The provisioning state of the - /// authentication certificate resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the authentication certificate that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayAuthenticationCertificate(string id = default(string), string data = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the authentication certificate that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the authentication certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Certificate public data. + /// + public ApplicationGatewayAuthenticationCertificate(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string data = default(string)) + + : base(id) { - Data = data; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Data = data; CustomInit(); } @@ -60,39 +60,37 @@ public ApplicationGatewayAuthenticationCertificate() /// partial void CustomInit(); + /// - /// Gets or sets certificate public data. + /// Gets or sets name of the authentication certificate that is unique within + /// an Application Gateway. /// - [JsonProperty(PropertyName = "properties.data")] - public string Data { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the authentication certificate - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of the authentication certificate that is unique - /// within an Application Gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the authentication certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets certificate public data. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] + public string Data {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.cs new file mode 100644 index 000000000000..912129464373 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Authentication certificates properties of an application gateway. + /// + public partial class ApplicationGatewayAuthenticationCertificatePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayAuthenticationCertificatePropertiesFormat class. + /// + public ApplicationGatewayAuthenticationCertificatePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayAuthenticationCertificatePropertiesFormat class. + /// + + /// Certificate public data. + /// + + /// The provisioning state of the authentication certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayAuthenticationCertificatePropertiesFormat(string data = default(string), string provisioningState = default(string)) + + { + this.Data = data; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets certificate public data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public string Data {get; set; } + + /// + /// Gets the provisioning state of the authentication certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs index 310e30ea48b3..f4b910e81de1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayAutoscaleConfiguration { /// - /// Initializes a new instance of the - /// ApplicationGatewayAutoscaleConfiguration class. + /// Initializes a new instance of the ApplicationGatewayAutoscaleConfiguration class. /// public ApplicationGatewayAutoscaleConfiguration() { @@ -29,17 +21,19 @@ public ApplicationGatewayAutoscaleConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayAutoscaleConfiguration class. + /// Initializes a new instance of the ApplicationGatewayAutoscaleConfiguration class. /// - /// Lower bound on number of Application - /// Gateway capacity. - /// Upper bound on number of Application - /// Gateway capacity. + + /// Lower bound on number of Application Gateway capacity. + /// + + /// Upper bound on number of Application Gateway capacity. + /// public ApplicationGatewayAutoscaleConfiguration(int minCapacity, int? maxCapacity = default(int?)) + { - MinCapacity = minCapacity; - MaxCapacity = maxCapacity; + this.MinCapacity = minCapacity; + this.MaxCapacity = maxCapacity; CustomInit(); } @@ -48,37 +42,37 @@ public ApplicationGatewayAutoscaleConfiguration() /// partial void CustomInit(); + /// /// Gets or sets lower bound on number of Application Gateway capacity. /// - [JsonProperty(PropertyName = "minCapacity")] - public int MinCapacity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minCapacity")] + public int MinCapacity {get; set; } /// /// Gets or sets upper bound on number of Application Gateway capacity. /// - [JsonProperty(PropertyName = "maxCapacity")] - public int? MaxCapacity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maxCapacity")] + public int? MaxCapacity {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MinCapacity < 0) + if (this.MinCapacity < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MinCapacity", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MinCapacity", 0); } - if (MaxCapacity != null) + if (this.MaxCapacity != null) { - if (MaxCapacity < 2) + if (this.MaxCapacity < 2) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxCapacity", 2); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxCapacity", 2); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptions.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptions.cs index 0bc86c1cbd5d..efd04fd3cffd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptions.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Response for ApplicationGatewayAvailableSslOptions API service call. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayAvailableSslOptions : Resource { /// - /// Initializes a new instance of the - /// ApplicationGatewayAvailableSslOptions class. + /// Initializes a new instance of the ApplicationGatewayAvailableSslOptions class. /// public ApplicationGatewayAvailableSslOptions() { @@ -33,32 +22,46 @@ public ApplicationGatewayAvailableSslOptions() } /// - /// Initializes a new instance of the - /// ApplicationGatewayAvailableSslOptions class. + /// Initializes a new instance of the ApplicationGatewayAvailableSslOptions class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// List of available Ssl predefined - /// policy. - /// Name of the Ssl predefined policy - /// applied by default to application gateway. Possible values include: - /// 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', - /// 'AppGwSslPolicy20220101S' - /// List of available Ssl cipher - /// suites. - /// List of available Ssl - /// protocols. - public ApplicationGatewayAvailableSslOptions(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList predefinedPolicies = default(IList), string defaultPolicy = default(string), IList availableCipherSuites = default(IList), IList availableProtocols = default(IList)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// List of available Ssl predefined policy. + /// + + /// Name of the Ssl predefined policy applied by default to application + /// gateway. + /// Possible values include: 'AppGwSslPolicy20150501', + /// 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', + /// 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + + /// List of available Ssl cipher suites. + /// + + /// List of available Ssl protocols. + /// + public ApplicationGatewayAvailableSslOptions(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList predefinedPolicies = default(System.Collections.Generic.IList), string defaultPolicy = default(string), System.Collections.Generic.IList availableCipherSuites = default(System.Collections.Generic.IList), System.Collections.Generic.IList availableProtocols = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - PredefinedPolicies = predefinedPolicies; - DefaultPolicy = defaultPolicy; - AvailableCipherSuites = availableCipherSuites; - AvailableProtocols = availableProtocols; + this.PredefinedPolicies = predefinedPolicies; + this.DefaultPolicy = defaultPolicy; + this.AvailableCipherSuites = availableCipherSuites; + this.AvailableProtocols = availableProtocols; CustomInit(); } @@ -67,33 +70,30 @@ public ApplicationGatewayAvailableSslOptions() /// partial void CustomInit(); + /// /// Gets or sets list of available Ssl predefined policy. /// - [JsonProperty(PropertyName = "properties.predefinedPolicies")] - public IList PredefinedPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.predefinedPolicies")] + public System.Collections.Generic.IList PredefinedPolicies {get; set; } /// - /// Gets or sets name of the Ssl predefined policy applied by default - /// to application gateway. Possible values include: - /// 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', - /// 'AppGwSslPolicy20220101S' + /// Gets or sets name of the Ssl predefined policy applied by default to + /// application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' /// - [JsonProperty(PropertyName = "properties.defaultPolicy")] - public string DefaultPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultPolicy")] + public string DefaultPolicy {get; set; } /// /// Gets or sets list of available Ssl cipher suites. /// - [JsonProperty(PropertyName = "properties.availableCipherSuites")] - public IList AvailableCipherSuites { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availableCipherSuites")] + public System.Collections.Generic.IList AvailableCipherSuites {get; set; } /// /// Gets or sets list of available Ssl protocols. /// - [JsonProperty(PropertyName = "properties.availableProtocols")] - public IList AvailableProtocols { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availableProtocols")] + public System.Collections.Generic.IList AvailableProtocols {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.cs new file mode 100644 index 000000000000..1b46d681933f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ApplicationGatewayAvailableSslOptions. + /// + public partial class ApplicationGatewayAvailableSslOptionsPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayAvailableSslOptionsPropertiesFormat class. + /// + public ApplicationGatewayAvailableSslOptionsPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayAvailableSslOptionsPropertiesFormat class. + /// + + /// List of available Ssl predefined policy. + /// + + /// Name of the Ssl predefined policy applied by default to application + /// gateway. + /// Possible values include: 'AppGwSslPolicy20150501', + /// 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', + /// 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + + /// List of available Ssl cipher suites. + /// + + /// List of available Ssl protocols. + /// + public ApplicationGatewayAvailableSslOptionsPropertiesFormat(System.Collections.Generic.IList predefinedPolicies = default(System.Collections.Generic.IList), string defaultPolicy = default(string), System.Collections.Generic.IList availableCipherSuites = default(System.Collections.Generic.IList), System.Collections.Generic.IList availableProtocols = default(System.Collections.Generic.IList)) + + { + this.PredefinedPolicies = predefinedPolicies; + this.DefaultPolicy = defaultPolicy; + this.AvailableCipherSuites = availableCipherSuites; + this.AvailableProtocols = availableProtocols; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of available Ssl predefined policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "predefinedPolicies")] + public System.Collections.Generic.IList PredefinedPolicies {get; set; } + + /// + /// Gets or sets name of the Ssl predefined policy applied by default to + /// application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPolicy")] + public string DefaultPolicy {get; set; } + + /// + /// Gets or sets list of available Ssl cipher suites. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availableCipherSuites")] + public System.Collections.Generic.IList AvailableCipherSuites {get; set; } + + /// + /// Gets or sets list of available Ssl protocols. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availableProtocols")] + public System.Collections.Generic.IList AvailableProtocols {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableWafRuleSetsResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableWafRuleSetsResult.cs index 358089b97e58..3a83df0557fd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableWafRuleSetsResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayAvailableWafRuleSetsResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayAvailableWafRuleSetsResult { /// - /// Initializes a new instance of the - /// ApplicationGatewayAvailableWafRuleSetsResult class. + /// Initializes a new instance of the ApplicationGatewayAvailableWafRuleSetsResult class. /// public ApplicationGatewayAvailableWafRuleSetsResult() { @@ -30,14 +21,15 @@ public ApplicationGatewayAvailableWafRuleSetsResult() } /// - /// Initializes a new instance of the - /// ApplicationGatewayAvailableWafRuleSetsResult class. + /// Initializes a new instance of the ApplicationGatewayAvailableWafRuleSetsResult class. /// - /// The list of application gateway rule - /// sets. - public ApplicationGatewayAvailableWafRuleSetsResult(IList value = default(IList)) + + /// The list of application gateway rule sets. + /// + public ApplicationGatewayAvailableWafRuleSetsResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -46,11 +38,11 @@ public ApplicationGatewayAvailableWafRuleSetsResult() /// partial void CustomInit(); + /// /// Gets or sets the list of application gateway rule sets. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddress.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddress.cs index 3d1b433b5e36..c4da2c13395c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddress.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddress.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayBackendAddress { /// - /// Initializes a new instance of the ApplicationGatewayBackendAddress - /// class. + /// Initializes a new instance of the ApplicationGatewayBackendAddress class. /// public ApplicationGatewayBackendAddress() { @@ -28,15 +21,19 @@ public ApplicationGatewayBackendAddress() } /// - /// Initializes a new instance of the ApplicationGatewayBackendAddress - /// class. + /// Initializes a new instance of the ApplicationGatewayBackendAddress class. /// - /// Fully qualified domain name (FQDN). - /// IP address. + + /// Fully qualified domain name (FQDN). + /// + + /// IP address. + /// public ApplicationGatewayBackendAddress(string fqdn = default(string), string ipAddress = default(string)) + { - Fqdn = fqdn; - IpAddress = ipAddress; + this.Fqdn = fqdn; + this.IPAddress = ipAddress; CustomInit(); } @@ -45,17 +42,17 @@ public ApplicationGatewayBackendAddress() /// partial void CustomInit(); + /// /// Gets or sets fully qualified domain name (FQDN). /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } /// - /// Gets or sets IP address. + /// Gets or sets iP address. /// - [JsonProperty(PropertyName = "ipAddress")] - public string IpAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPool.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPool.cs index 8fa6760d40ed..b2f94f29d630 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPool.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPool.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Backend Address Pool of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayBackendAddressPool : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendAddressPool class. + /// Initializes a new instance of the ApplicationGatewayBackendAddressPool class. /// public ApplicationGatewayBackendAddressPool() { @@ -33,30 +22,40 @@ public ApplicationGatewayBackendAddressPool() } /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendAddressPool class. + /// Initializes a new instance of the ApplicationGatewayBackendAddressPool class. /// - /// Resource ID. - /// Collection of references to - /// IPs defined in network interfaces. - /// Backend addresses. - /// The provisioning state of the - /// backend address pool resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the backend address pool that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayBackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList backendAddresses = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the backend address pool that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the backend address pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Collection of references to IPs defined in network interfaces. + /// + + /// Backend addresses. + /// + public ApplicationGatewayBackendAddressPool(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddresses = default(System.Collections.Generic.IList)) + + : base(id) { - BackendIPConfigurations = backendIPConfigurations; - BackendAddresses = backendAddresses; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.BackendIPConfigurations = backendIPConfigurations; + this.BackendAddresses = backendAddresses; CustomInit(); } @@ -65,45 +64,43 @@ public ApplicationGatewayBackendAddressPool() /// partial void CustomInit(); + /// - /// Gets collection of references to IPs defined in network interfaces. + /// Gets or sets name of the backend address pool that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public IList BackendIPConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets backend addresses. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.backendAddresses")] - public IList BackendAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the backend address pool resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the backend address pool that is unique within - /// an Application Gateway. + /// Gets the provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets collection of references to IPs defined in network interfaces. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfigurations")] + public System.Collections.Generic.IList BackendIPConfigurations {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets backend addresses. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddresses")] + public System.Collections.Generic.IList BackendAddresses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPoolPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPoolPropertiesFormat.cs new file mode 100644 index 000000000000..8f2359440668 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendAddressPoolPropertiesFormat.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Backend Address Pool of an application gateway. + /// + public partial class ApplicationGatewayBackendAddressPoolPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayBackendAddressPoolPropertiesFormat class. + /// + public ApplicationGatewayBackendAddressPoolPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayBackendAddressPoolPropertiesFormat class. + /// + + /// Collection of references to IPs defined in network interfaces. + /// + + /// Backend addresses. + /// + + /// The provisioning state of the backend address pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayBackendAddressPoolPropertiesFormat(System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddresses = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.BackendIPConfigurations = backendIPConfigurations; + this.BackendAddresses = backendAddresses; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets collection of references to IPs defined in network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendIPConfigurations")] + public System.Collections.Generic.IList BackendIPConfigurations {get; private set; } + + /// + /// Gets or sets backend addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddresses")] + public System.Collections.Generic.IList BackendAddresses {get; set; } + + /// + /// Gets the provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealth.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealth.cs index 27c20ee83246..fe1d97a38d2e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealth.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealth.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayBackendHealth { /// - /// Initializes a new instance of the ApplicationGatewayBackendHealth - /// class. + /// Initializes a new instance of the ApplicationGatewayBackendHealth class. /// public ApplicationGatewayBackendHealth() { @@ -30,14 +21,15 @@ public ApplicationGatewayBackendHealth() } /// - /// Initializes a new instance of the ApplicationGatewayBackendHealth - /// class. + /// Initializes a new instance of the ApplicationGatewayBackendHealth class. /// - /// A list of - /// ApplicationGatewayBackendHealthPool resources. - public ApplicationGatewayBackendHealth(IList backendAddressPools = default(IList)) + + /// A list of ApplicationGatewayBackendHealthPool resources. + /// + public ApplicationGatewayBackendHealth(System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList)) + { - BackendAddressPools = backendAddressPools; + this.BackendAddressPools = backendAddressPools; CustomInit(); } @@ -46,12 +38,11 @@ public ApplicationGatewayBackendHealth() /// partial void CustomInit(); + /// - /// Gets or sets a list of ApplicationGatewayBackendHealthPool - /// resources. + /// Gets or sets a list of ApplicationGatewayBackendHealthPool resources. /// - [JsonProperty(PropertyName = "backendAddressPools")] - public IList BackendAddressPools { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index f031eeef3a70..80a77df895cc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayBackendHealthHttpSettings { /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthHttpSettings class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthHttpSettings class. /// public ApplicationGatewayBackendHealthHttpSettings() { @@ -30,17 +21,19 @@ public ApplicationGatewayBackendHealthHttpSettings() } /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthHttpSettings class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthHttpSettings class. /// - /// Reference to an - /// ApplicationGatewayBackendHttpSettings resource. - /// List of ApplicationGatewayBackendHealthServer - /// resources. - public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), IList servers = default(IList)) + + /// Reference to an ApplicationGatewayBackendHttpSettings resource. + /// + + /// List of ApplicationGatewayBackendHealthServer resources. + /// + public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), System.Collections.Generic.IList servers = default(System.Collections.Generic.IList)) + { - BackendHttpSettings = backendHttpSettings; - Servers = servers; + this.BackendHttpSettings = backendHttpSettings; + this.Servers = servers; CustomInit(); } @@ -49,32 +42,32 @@ public ApplicationGatewayBackendHealthHttpSettings() /// partial void CustomInit(); + /// /// Gets or sets reference to an ApplicationGatewayBackendHttpSettings /// resource. /// - [JsonProperty(PropertyName = "backendHttpSettings")] - public ApplicationGatewayBackendHttpSettings BackendHttpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettings")] + public ApplicationGatewayBackendHttpSettings BackendHttpSettings {get; set; } /// - /// Gets or sets list of ApplicationGatewayBackendHealthServer - /// resources. + /// Gets or sets list of ApplicationGatewayBackendHealthServer resources. /// - [JsonProperty(PropertyName = "servers")] - public IList Servers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "servers")] + public System.Collections.Generic.IList Servers {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BackendHttpSettings != null) + if (this.BackendHttpSettings != null) { - BackendHttpSettings.Validate(); + this.BackendHttpSettings.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthOnDemand.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthOnDemand.cs index 7796c1879650..64e92b5e66d1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthOnDemand.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthOnDemand.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayBackendHealthOnDemand { /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthOnDemand class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthOnDemand class. /// public ApplicationGatewayBackendHealthOnDemand() { @@ -28,17 +21,19 @@ public ApplicationGatewayBackendHealthOnDemand() } /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthOnDemand class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthOnDemand class. /// - /// Reference to an - /// ApplicationGatewayBackendAddressPool resource. - /// Application gateway - /// BackendHealthHttp settings. + + /// Reference to an ApplicationGatewayBackendAddressPool resource. + /// + + /// Application gateway BackendHealthHttp settings. + /// public ApplicationGatewayBackendHealthOnDemand(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings = default(ApplicationGatewayBackendHealthHttpSettings)) + { - BackendAddressPool = backendAddressPool; - BackendHealthHttpSettings = backendHealthHttpSettings; + this.BackendAddressPool = backendAddressPool; + this.BackendHealthHttpSettings = backendHealthHttpSettings; CustomInit(); } @@ -47,31 +42,31 @@ public ApplicationGatewayBackendHealthOnDemand() /// partial void CustomInit(); + /// - /// Gets or sets reference to an ApplicationGatewayBackendAddressPool - /// resource. + /// Gets or sets reference to an ApplicationGatewayBackendAddressPool resource. /// - [JsonProperty(PropertyName = "backendAddressPool")] - public ApplicationGatewayBackendAddressPool BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public ApplicationGatewayBackendAddressPool BackendAddressPool {get; set; } /// /// Gets or sets application gateway BackendHealthHttp settings. /// - [JsonProperty(PropertyName = "backendHealthHttpSettings")] - public ApplicationGatewayBackendHealthHttpSettings BackendHealthHttpSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHealthHttpSettings")] + public ApplicationGatewayBackendHealthHttpSettings BackendHealthHttpSettings {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BackendHealthHttpSettings != null) + + if (this.BackendHealthHttpSettings != null) { - BackendHealthHttpSettings.Validate(); + this.BackendHealthHttpSettings.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthPool.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthPool.cs index ac5c7bd1f761..db1936bdda10 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthPool.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthPool.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayBackendHealthPool { /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthPool class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthPool class. /// public ApplicationGatewayBackendHealthPool() { @@ -30,17 +21,19 @@ public ApplicationGatewayBackendHealthPool() } /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthPool class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthPool class. /// - /// Reference to an - /// ApplicationGatewayBackendAddressPool resource. - /// List of - /// ApplicationGatewayBackendHealthHttpSettings resources. - public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), IList backendHttpSettingsCollection = default(IList)) + + /// Reference to an ApplicationGatewayBackendAddressPool resource. + /// + + /// List of ApplicationGatewayBackendHealthHttpSettings resources. + /// + public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList)) + { - BackendAddressPool = backendAddressPool; - BackendHttpSettingsCollection = backendHttpSettingsCollection; + this.BackendAddressPool = backendAddressPool; + this.BackendHttpSettingsCollection = backendHttpSettingsCollection; CustomInit(); } @@ -49,19 +42,17 @@ public ApplicationGatewayBackendHealthPool() /// partial void CustomInit(); + /// - /// Gets or sets reference to an ApplicationGatewayBackendAddressPool - /// resource. + /// Gets or sets reference to an ApplicationGatewayBackendAddressPool resource. /// - [JsonProperty(PropertyName = "backendAddressPool")] - public ApplicationGatewayBackendAddressPool BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public ApplicationGatewayBackendAddressPool BackendAddressPool {get; set; } /// - /// Gets or sets list of ApplicationGatewayBackendHealthHttpSettings - /// resources. + /// Gets or sets list of ApplicationGatewayBackendHealthHttpSettings resources. /// - [JsonProperty(PropertyName = "backendHttpSettingsCollection")] - public IList BackendHttpSettingsCollection { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettingsCollection")] + public System.Collections.Generic.IList BackendHttpSettingsCollection {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 46b8ad150f46..1305e829be82 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayBackendHealthServer { /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthServer class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthServer class. /// public ApplicationGatewayBackendHealthServer() { @@ -28,21 +21,27 @@ public ApplicationGatewayBackendHealthServer() } /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHealthServer class. + /// Initializes a new instance of the ApplicationGatewayBackendHealthServer class. /// - /// IP address or FQDN of backend server. - /// Reference to IP configuration of - /// backend server. - /// Health of backend server. Possible values - /// include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' - /// Health Probe Log. + + /// IP address or FQDN of backend server. + /// + + /// Reference to IP configuration of backend server. + /// + + /// Health of backend server. + /// Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + + /// Health Probe Log. + /// public ApplicationGatewayBackendHealthServer(string address = default(string), NetworkInterfaceIPConfiguration ipConfiguration = default(NetworkInterfaceIPConfiguration), string health = default(string), string healthProbeLog = default(string)) + { - Address = address; - IpConfiguration = ipConfiguration; - Health = health; - HealthProbeLog = healthProbeLog; + this.Address = address; + this.IPConfiguration = ipConfiguration; + this.Health = health; + this.HealthProbeLog = healthProbeLog; CustomInit(); } @@ -51,30 +50,29 @@ public ApplicationGatewayBackendHealthServer() /// partial void CustomInit(); + /// - /// Gets or sets IP address or FQDN of backend server. + /// Gets or sets iP address or FQDN of backend server. /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } /// /// Gets or sets reference to IP configuration of backend server. /// - [JsonProperty(PropertyName = "ipConfiguration")] - public NetworkInterfaceIPConfiguration IpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfiguration")] + public NetworkInterfaceIPConfiguration IPConfiguration {get; set; } /// - /// Gets or sets health of backend server. Possible values include: - /// 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + /// Gets or sets health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' /// - [JsonProperty(PropertyName = "health")] - public string Health { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "health")] + public string Health {get; set; } /// /// Gets or sets health Probe Log. /// - [JsonProperty(PropertyName = "healthProbeLog")] - public string HealthProbeLog { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "healthProbeLog")] + public string HealthProbeLog {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs index 879f22cad041..042ed1e18637 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayBackendHealthServerHealth. /// + + public static class ApplicationGatewayBackendHealthServerHealth { public const string Unknown = "Unknown"; @@ -22,4 +19,4 @@ public static class ApplicationGatewayBackendHealthServerHealth public const string Partial = "Partial"; public const string Draining = "Draining"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettings.cs index b67db9ae68c5..5d54d9fe8140 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettings.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Backend address pool settings of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayBackendHttpSettings : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHttpSettings class. + /// Initializes a new instance of the ApplicationGatewayBackendHttpSettings class. /// public ApplicationGatewayBackendHttpSettings() { @@ -33,68 +22,88 @@ public ApplicationGatewayBackendHttpSettings() } /// - /// Initializes a new instance of the - /// ApplicationGatewayBackendHttpSettings class. - /// - /// Resource ID. - /// The destination port on the backend. - /// The protocol used to communicate with the - /// backend. Possible values include: 'Http', 'Https', 'Tcp', - /// 'Tls' - /// Cookie based affinity. Possible - /// values include: 'Enabled', 'Disabled' - /// 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. - /// Probe resource of an application - /// gateway. - /// Array of references to - /// application gateway authentication certificates. - /// Array of references to - /// application gateway trusted root certificates. - /// Connection draining of the backend - /// http settings resource. - /// Host header to be sent to the backend - /// servers. - /// Whether to pick host - /// header should be picked from the host name of the backend server. - /// Default value is false. - /// Cookie name to use for the - /// affinity cookie. - /// Whether the probe is enabled. Default - /// value is false. - /// Path which should be used as a prefix for all - /// HTTP requests. Null means no path will be prefixed. Default value - /// is null. - /// The provisioning state of the - /// backend HTTP settings resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the backend http settings that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayBackendHttpSettings(string id = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), IList authenticationCertificates = default(IList), IList trustedRootCertificates = default(IList), ApplicationGatewayConnectionDraining connectionDraining = default(ApplicationGatewayConnectionDraining), string hostName = default(string), bool? pickHostNameFromBackendAddress = default(bool?), string affinityCookieName = default(string), bool? probeEnabled = default(bool?), string path = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Initializes a new instance of the ApplicationGatewayBackendHttpSettings class. + /// + + /// Resource ID. + /// + + /// Name of the backend http settings that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the backend HTTP settings resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The destination port on the backend. + /// + + /// The protocol used to communicate with the backend. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Cookie based affinity. + /// Possible values include: 'Enabled', 'Disabled' + + /// 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. + /// + + /// Probe resource of an application gateway. + /// + + /// Array of references to application gateway authentication certificates. + /// + + /// Array of references to application gateway trusted root certificates. + /// + + /// Connection draining of the backend http settings resource. + /// + + /// Host header to be sent to the backend servers. + /// + + /// Whether to pick host header should be picked from the host name of the + /// backend server. Default value is false. + /// + + /// Cookie name to use for the affinity cookie. + /// + + /// Whether the probe is enabled. Default value is false. + /// + + /// Path which should be used as a prefix for all HTTP requests. Null means no + /// path will be prefixed. Default value is null. + /// + public ApplicationGatewayBackendHttpSettings(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList trustedRootCertificates = default(System.Collections.Generic.IList), ApplicationGatewayConnectionDraining connectionDraining = default(ApplicationGatewayConnectionDraining), string hostName = default(string), bool? pickHostNameFromBackendAddress = default(bool?), string affinityCookieName = default(string), bool? probeEnabled = default(bool?), string path = default(string)) + + : base(id) { - Port = port; - Protocol = protocol; - CookieBasedAffinity = cookieBasedAffinity; - RequestTimeout = requestTimeout; - Probe = probe; - AuthenticationCertificates = authenticationCertificates; - TrustedRootCertificates = trustedRootCertificates; - ConnectionDraining = connectionDraining; - HostName = hostName; - PickHostNameFromBackendAddress = pickHostNameFromBackendAddress; - AffinityCookieName = affinityCookieName; - ProbeEnabled = probeEnabled; - Path = path; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Port = port; + this.Protocol = protocol; + this.CookieBasedAffinity = cookieBasedAffinity; + this.RequestTimeout = requestTimeout; + this.Probe = probe; + this.AuthenticationCertificates = authenticationCertificates; + this.TrustedRootCertificates = trustedRootCertificates; + this.ConnectionDraining = connectionDraining; + this.HostName = hostName; + this.PickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + this.AffinityCookieName = affinityCookieName; + this.ProbeEnabled = probeEnabled; + this.Path = path; CustomInit(); } @@ -103,134 +112,140 @@ public ApplicationGatewayBackendHttpSettings() /// partial void CustomInit(); + /// - /// Gets or sets the destination port on the backend. + /// Gets or sets name of the backend http settings that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the protocol used to communicate with the backend. - /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets cookie based affinity. Possible values include: - /// 'Enabled', 'Disabled' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.cookieBasedAffinity")] - public string CookieBasedAffinity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets 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. + /// Gets the provisioning state of the backend HTTP settings resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.requestTimeout")] - public int? RequestTimeout { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets probe resource of an application gateway. + /// Gets or sets the destination port on the backend. /// - [JsonProperty(PropertyName = "properties.probe")] - public SubResource Probe { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + public int? Port {get; set; } /// - /// Gets or sets array of references to application gateway - /// authentication certificates. + /// Gets or sets the protocol used to communicate with the backend. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' /// - [JsonProperty(PropertyName = "properties.authenticationCertificates")] - public IList AuthenticationCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets array of references to application gateway trusted - /// root certificates. + /// Gets or sets cookie based affinity. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.trustedRootCertificates")] - public IList TrustedRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cookieBasedAffinity")] + public string CookieBasedAffinity {get; set; } /// - /// Gets or sets connection draining of the backend http settings - /// resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.connectionDraining")] - public ApplicationGatewayConnectionDraining ConnectionDraining { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestTimeout")] + public int? RequestTimeout {get; set; } /// - /// Gets or sets host header to be sent to the backend servers. + /// Gets or sets probe resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.hostName")] - public string HostName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] + public SubResource Probe {get; set; } /// - /// Gets or sets whether to pick host header should be picked from the - /// host name of the backend server. Default value is false. + /// Gets or sets array of references to application gateway authentication + /// certificates. /// - [JsonProperty(PropertyName = "properties.pickHostNameFromBackendAddress")] - public bool? PickHostNameFromBackendAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationCertificates")] + public System.Collections.Generic.IList AuthenticationCertificates {get; set; } /// - /// Gets or sets cookie name to use for the affinity cookie. + /// Gets or sets array of references to application gateway trusted root + /// certificates. /// - [JsonProperty(PropertyName = "properties.affinityCookieName")] - public string AffinityCookieName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trustedRootCertificates")] + public System.Collections.Generic.IList TrustedRootCertificates {get; set; } /// - /// Gets or sets whether the probe is enabled. Default value is false. + /// Gets or sets connection draining of the backend http settings resource. /// - [JsonProperty(PropertyName = "properties.probeEnabled")] - public bool? ProbeEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionDraining")] + public ApplicationGatewayConnectionDraining ConnectionDraining {get; set; } /// - /// Gets or sets path which should be used as a prefix for all HTTP - /// requests. Null means no path will be prefixed. Default value is - /// null. + /// Gets or sets host header to be sent to the backend servers. /// - [JsonProperty(PropertyName = "properties.path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostName")] + public string HostName {get; set; } /// - /// Gets the provisioning state of the backend HTTP settings resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets whether to pick host header should be picked from the host + /// name of the backend server. Default value is false. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pickHostNameFromBackendAddress")] + public bool? PickHostNameFromBackendAddress {get; set; } /// - /// Gets or sets name of the backend http settings that is unique - /// within an Application Gateway. + /// Gets or sets cookie name to use for the affinity cookie. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.affinityCookieName")] + public string AffinityCookieName {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets whether the probe is enabled. Default value is false. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probeEnabled")] + public bool? ProbeEnabled {get; set; } /// - /// Gets type of the resource. + /// Gets or sets path which should be used as a prefix for all HTTP requests. + /// Null means no path will be prefixed. Default value is null. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] + public string Path {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ConnectionDraining != null) + + + + + + + + + + if (this.ConnectionDraining != null) { - ConnectionDraining.Validate(); + this.ConnectionDraining.Validate(); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.cs new file mode 100644 index 000000000000..8509ab6624af --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Backend address pool settings of an application gateway. + /// + public partial class ApplicationGatewayBackendHttpSettingsPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayBackendHttpSettingsPropertiesFormat class. + /// + public ApplicationGatewayBackendHttpSettingsPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayBackendHttpSettingsPropertiesFormat class. + /// + + /// The destination port on the backend. + /// + + /// The protocol used to communicate with the backend. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Cookie based affinity. + /// Possible values include: 'Enabled', 'Disabled' + + /// 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. + /// + + /// Probe resource of an application gateway. + /// + + /// Array of references to application gateway authentication certificates. + /// + + /// Array of references to application gateway trusted root certificates. + /// + + /// Connection draining of the backend http settings resource. + /// + + /// Host header to be sent to the backend servers. + /// + + /// Whether to pick host header should be picked from the host name of the + /// backend server. Default value is false. + /// + + /// Cookie name to use for the affinity cookie. + /// + + /// Whether the probe is enabled. Default value is false. + /// + + /// Path which should be used as a prefix for all HTTP requests. Null means no + /// path will be prefixed. Default value is null. + /// + + /// The provisioning state of the backend HTTP settings resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayBackendHttpSettingsPropertiesFormat(int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList trustedRootCertificates = default(System.Collections.Generic.IList), ApplicationGatewayConnectionDraining connectionDraining = default(ApplicationGatewayConnectionDraining), string hostName = default(string), bool? pickHostNameFromBackendAddress = default(bool?), string affinityCookieName = default(string), bool? probeEnabled = default(bool?), string path = default(string), string provisioningState = default(string)) + + { + this.Port = port; + this.Protocol = protocol; + this.CookieBasedAffinity = cookieBasedAffinity; + this.RequestTimeout = requestTimeout; + this.Probe = probe; + this.AuthenticationCertificates = authenticationCertificates; + this.TrustedRootCertificates = trustedRootCertificates; + this.ConnectionDraining = connectionDraining; + this.HostName = hostName; + this.PickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + this.AffinityCookieName = affinityCookieName; + this.ProbeEnabled = probeEnabled; + this.Path = path; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the destination port on the backend. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } + + /// + /// Gets or sets the protocol used to communicate with the backend. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets cookie based affinity. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cookieBasedAffinity")] + public string CookieBasedAffinity {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestTimeout")] + public int? RequestTimeout {get; set; } + + /// + /// Gets or sets probe resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probe")] + public SubResource Probe {get; set; } + + /// + /// Gets or sets array of references to application gateway authentication + /// certificates. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationCertificates")] + public System.Collections.Generic.IList AuthenticationCertificates {get; set; } + + /// + /// Gets or sets array of references to application gateway trusted root + /// certificates. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trustedRootCertificates")] + public System.Collections.Generic.IList TrustedRootCertificates {get; set; } + + /// + /// Gets or sets connection draining of the backend http settings resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionDraining")] + public ApplicationGatewayConnectionDraining ConnectionDraining {get; set; } + + /// + /// Gets or sets host header to be sent to the backend servers. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostName")] + public string HostName {get; set; } + + /// + /// Gets or sets whether to pick host header should be picked from the host + /// name of the backend server. Default value is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pickHostNameFromBackendAddress")] + public bool? PickHostNameFromBackendAddress {get; set; } + + /// + /// Gets or sets cookie name to use for the affinity cookie. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "affinityCookieName")] + public string AffinityCookieName {get; set; } + + /// + /// Gets or sets whether the probe is enabled. Default value is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probeEnabled")] + public bool? ProbeEnabled {get; set; } + + /// + /// Gets or sets path which should be used as a prefix for all HTTP requests. + /// Null means no path will be prefixed. Default value is null. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } + + /// + /// Gets the provisioning state of the backend HTTP settings resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + if (this.ConnectionDraining != null) + { + this.ConnectionDraining.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettings.cs index 02281077edf1..2590a24b983d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettings.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Backend address pool settings of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayBackendSettings : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayBackendSettings - /// class. + /// Initializes a new instance of the ApplicationGatewayBackendSettings class. /// public ApplicationGatewayBackendSettings() { @@ -33,49 +22,62 @@ public ApplicationGatewayBackendSettings() } /// - /// Initializes a new instance of the ApplicationGatewayBackendSettings - /// class. + /// Initializes a new instance of the ApplicationGatewayBackendSettings class. /// - /// Resource ID. - /// The destination port on the backend. - /// The protocol used to communicate with the - /// backend. Possible values include: 'Http', 'Https', 'Tcp', - /// 'Tls' - /// Connection timeout in seconds. Application - /// Gateway will fail the request if response is not received within - /// ConnectionTimeout. Acceptable values are from 1 second to 86400 - /// seconds. - /// Probe resource of an application - /// gateway. - /// Array of references to - /// application gateway trusted root certificates. - /// Server name indication to be sent to the - /// backend servers for Tls protocol. - /// Whether to pick server - /// name indication from the host name of the backend server for Tls - /// protocol. Default value is false. - /// The provisioning state of the - /// backend HTTP settings resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the backend settings that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayBackendSettings(string id = default(string), int? port = default(int?), string protocol = default(string), int? timeout = default(int?), SubResource probe = default(SubResource), IList trustedRootCertificates = default(IList), string hostName = default(string), bool? pickHostNameFromBackendAddress = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the backend settings that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the backend HTTP settings resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The destination port on the backend. + /// + + /// The protocol used to communicate with the backend. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Connection timeout in seconds. Application Gateway will fail the request if + /// response is not received within ConnectionTimeout. Acceptable values are + /// from 1 second to 86400 seconds. + /// + + /// Probe resource of an application gateway. + /// + + /// Array of references to application gateway trusted root certificates. + /// + + /// Server name indication to be sent to the backend servers for Tls protocol. + /// + + /// Whether to pick server name indication from the host name of the backend + /// server for Tls protocol. Default value is false. + /// + public ApplicationGatewayBackendSettings(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), int? port = default(int?), string protocol = default(string), int? timeout = default(int?), SubResource probe = default(SubResource), System.Collections.Generic.IList trustedRootCertificates = default(System.Collections.Generic.IList), string hostName = default(string), bool? pickHostNameFromBackendAddress = default(bool?)) + + : base(id) { - Port = port; - Protocol = protocol; - Timeout = timeout; - Probe = probe; - TrustedRootCertificates = trustedRootCertificates; - HostName = hostName; - PickHostNameFromBackendAddress = pickHostNameFromBackendAddress; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Port = port; + this.Protocol = protocol; + this.Timeout = timeout; + this.Probe = probe; + this.TrustedRootCertificates = trustedRootCertificates; + this.HostName = hostName; + this.PickHostNameFromBackendAddress = pickHostNameFromBackendAddress; CustomInit(); } @@ -84,83 +86,78 @@ public ApplicationGatewayBackendSettings() /// partial void CustomInit(); + /// - /// Gets or sets the destination port on the backend. + /// Gets or sets name of the backend settings that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the protocol used to communicate with the backend. - /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets connection timeout in seconds. Application Gateway - /// will fail the request if response is not received within - /// ConnectionTimeout. Acceptable values are from 1 second to 86400 - /// seconds. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.timeout")] - public int? Timeout { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets probe resource of an application gateway. + /// Gets the provisioning state of the backend HTTP settings resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.probe")] - public SubResource Probe { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets array of references to application gateway trusted - /// root certificates. + /// Gets or sets the destination port on the backend. /// - [JsonProperty(PropertyName = "properties.trustedRootCertificates")] - public IList TrustedRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + public int? Port {get; set; } /// - /// Gets or sets server name indication to be sent to the backend - /// servers for Tls protocol. + /// Gets or sets the protocol used to communicate with the backend. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' /// - [JsonProperty(PropertyName = "properties.hostName")] - public string HostName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets whether to pick server name indication from the host - /// name of the backend server for Tls protocol. Default value is - /// false. + /// Gets or sets connection timeout in seconds. Application Gateway will fail + /// the request if response is not received within ConnectionTimeout. + /// Acceptable values are from 1 second to 86400 seconds. /// - [JsonProperty(PropertyName = "properties.pickHostNameFromBackendAddress")] - public bool? PickHostNameFromBackendAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeout")] + public int? Timeout {get; set; } /// - /// Gets the provisioning state of the backend HTTP settings resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets probe resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] + public SubResource Probe {get; set; } /// - /// Gets or sets name of the backend settings that is unique within an - /// Application Gateway. + /// Gets or sets array of references to application gateway trusted root + /// certificates. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trustedRootCertificates")] + public System.Collections.Generic.IList TrustedRootCertificates {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets server name indication to be sent to the backend servers for + /// Tls protocol. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostName")] + public string HostName {get; set; } /// - /// Gets type of the resource. + /// Gets or sets whether to pick server name indication from the host name of + /// the backend server for Tls protocol. Default value is false. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pickHostNameFromBackendAddress")] + public bool? PickHostNameFromBackendAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettingsPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettingsPropertiesFormat.cs new file mode 100644 index 000000000000..23b3d0d12ce2 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayBackendSettingsPropertiesFormat.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Backend address pool settings of an application gateway. + /// + public partial class ApplicationGatewayBackendSettingsPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayBackendSettingsPropertiesFormat class. + /// + public ApplicationGatewayBackendSettingsPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayBackendSettingsPropertiesFormat class. + /// + + /// The destination port on the backend. + /// + + /// The protocol used to communicate with the backend. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Connection timeout in seconds. Application Gateway will fail the request if + /// response is not received within ConnectionTimeout. Acceptable values are + /// from 1 second to 86400 seconds. + /// + + /// Probe resource of an application gateway. + /// + + /// Array of references to application gateway trusted root certificates. + /// + + /// Server name indication to be sent to the backend servers for Tls protocol. + /// + + /// Whether to pick server name indication from the host name of the backend + /// server for Tls protocol. Default value is false. + /// + + /// The provisioning state of the backend HTTP settings resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayBackendSettingsPropertiesFormat(int? port = default(int?), string protocol = default(string), int? timeout = default(int?), SubResource probe = default(SubResource), System.Collections.Generic.IList trustedRootCertificates = default(System.Collections.Generic.IList), string hostName = default(string), bool? pickHostNameFromBackendAddress = default(bool?), string provisioningState = default(string)) + + { + this.Port = port; + this.Protocol = protocol; + this.Timeout = timeout; + this.Probe = probe; + this.TrustedRootCertificates = trustedRootCertificates; + this.HostName = hostName; + this.PickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the destination port on the backend. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } + + /// + /// Gets or sets the protocol used to communicate with the backend. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets connection timeout in seconds. Application Gateway will fail + /// the request if response is not received within ConnectionTimeout. + /// Acceptable values are from 1 second to 86400 seconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeout")] + public int? Timeout {get; set; } + + /// + /// Gets or sets probe resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probe")] + public SubResource Probe {get; set; } + + /// + /// Gets or sets array of references to application gateway trusted root + /// certificates. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trustedRootCertificates")] + public System.Collections.Generic.IList TrustedRootCertificates {get; set; } + + /// + /// Gets or sets server name indication to be sent to the backend servers for + /// Tls protocol. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostName")] + public string HostName {get; set; } + + /// + /// Gets or sets whether to pick server name indication from the host name of + /// the backend server for Tls protocol. Default value is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pickHostNameFromBackendAddress")] + public bool? PickHostNameFromBackendAddress {get; set; } + + /// + /// Gets the provisioning state of the backend HTTP settings resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientAuthConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientAuthConfiguration.cs index 105f24b00ad2..b30c7ace0884 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientAuthConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientAuthConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayClientAuthConfiguration { /// - /// Initializes a new instance of the - /// ApplicationGatewayClientAuthConfiguration class. + /// Initializes a new instance of the ApplicationGatewayClientAuthConfiguration class. /// public ApplicationGatewayClientAuthConfiguration() { @@ -28,17 +21,19 @@ public ApplicationGatewayClientAuthConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayClientAuthConfiguration class. + /// Initializes a new instance of the ApplicationGatewayClientAuthConfiguration class. /// - /// Verify client certificate - /// issuer name on the application gateway. - /// Verify client certificate - /// revocation status. Possible values include: 'None', 'OCSP' - public ApplicationGatewayClientAuthConfiguration(bool? verifyClientCertIssuerDN = default(bool?), string verifyClientRevocation = default(string)) + + /// Verify client certificate issuer name on the application gateway. + /// + + /// Verify client certificate revocation status. + /// Possible values include: 'None', 'OCSP' + public ApplicationGatewayClientAuthConfiguration(bool? verifyClientCertIssuerDn = default(bool?), string verifyClientRevocation = default(string)) + { - VerifyClientCertIssuerDN = verifyClientCertIssuerDN; - VerifyClientRevocation = verifyClientRevocation; + this.VerifyClientCertIssuerDn = verifyClientCertIssuerDn; + this.VerifyClientRevocation = verifyClientRevocation; CustomInit(); } @@ -47,19 +42,18 @@ public ApplicationGatewayClientAuthConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets verify client certificate issuer name on the - /// application gateway. + /// Gets or sets verify client certificate issuer name on the application + /// gateway. /// - [JsonProperty(PropertyName = "verifyClientCertIssuerDN")] - public bool? VerifyClientCertIssuerDN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "verifyClientCertIssuerDN")] + public bool? VerifyClientCertIssuerDn {get; set; } /// - /// Gets or sets verify client certificate revocation status. Possible - /// values include: 'None', 'OCSP' + /// Gets or sets verify client certificate revocation status. Possible values include: 'None', 'OCSP' /// - [JsonProperty(PropertyName = "verifyClientRevocation")] - public string VerifyClientRevocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "verifyClientRevocation")] + public string VerifyClientRevocation {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientRevocationOptions.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientRevocationOptions.cs index e33bae05e38a..709102f40230 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientRevocationOptions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayClientRevocationOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayClientRevocationOptions. /// + + public static class ApplicationGatewayClientRevocationOptions { public const string None = "None"; - public const string OCSP = "OCSP"; + public const string Ocsp = "OCSP"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayConnectionDraining.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayConnectionDraining.cs index 509e776c51c9..b9856352674e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayConnectionDraining.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayConnectionDraining.cs @@ -1,29 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// /// 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. + /// active for a specified time after the backend server got removed from the + /// configuration. /// public partial class ApplicationGatewayConnectionDraining { /// - /// Initializes a new instance of the - /// ApplicationGatewayConnectionDraining class. + /// Initializes a new instance of the ApplicationGatewayConnectionDraining class. /// public ApplicationGatewayConnectionDraining() { @@ -31,18 +23,20 @@ public ApplicationGatewayConnectionDraining() } /// - /// Initializes a new instance of the - /// ApplicationGatewayConnectionDraining class. + /// Initializes a new instance of the ApplicationGatewayConnectionDraining class. /// - /// Whether connection draining is enabled or - /// not. - /// The number of seconds connection - /// draining is active. Acceptable values are from 1 second to 3600 - /// seconds. + + /// Whether connection draining is enabled or not. + /// + + /// The number of seconds connection draining is active. Acceptable values are + /// from 1 second to 3600 seconds. + /// public ApplicationGatewayConnectionDraining(bool enabled, int drainTimeoutInSec) + { - Enabled = enabled; - DrainTimeoutInSec = drainTimeoutInSec; + this.Enabled = enabled; + this.DrainTimeoutInSec = drainTimeoutInSec; CustomInit(); } @@ -51,35 +45,35 @@ public ApplicationGatewayConnectionDraining(bool enabled, int drainTimeoutInSec) /// partial void CustomInit(); + /// /// Gets or sets whether connection draining is enabled or not. /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled {get; set; } /// /// Gets or sets the number of seconds connection draining is active. /// Acceptable values are from 1 second to 3600 seconds. /// - [JsonProperty(PropertyName = "drainTimeoutInSec")] - public int DrainTimeoutInSec { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "drainTimeoutInSec")] + public int DrainTimeoutInSec {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DrainTimeoutInSec > 3600) + if (this.DrainTimeoutInSec > 3600) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "DrainTimeoutInSec", 3600); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "DrainTimeoutInSec", 3600); } - if (DrainTimeoutInSec < 1) + if (this.DrainTimeoutInSec < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DrainTimeoutInSec", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "DrainTimeoutInSec", 1); } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs index ce8d5763a917..71b3efe661a0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayCookieBasedAffinity. /// + + public static class ApplicationGatewayCookieBasedAffinity { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomError.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomError.cs index 1a6c40a41fbc..2ff0d68c46e7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomError.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomError.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayCustomError { /// - /// Initializes a new instance of the ApplicationGatewayCustomError - /// class. + /// Initializes a new instance of the ApplicationGatewayCustomError class. /// public ApplicationGatewayCustomError() { @@ -28,20 +21,21 @@ public ApplicationGatewayCustomError() } /// - /// Initializes a new instance of the ApplicationGatewayCustomError - /// class. + /// Initializes a new instance of the ApplicationGatewayCustomError class. /// - /// Status code of the application gateway - /// custom error. Possible values include: 'HttpStatus400', - /// 'HttpStatus403', 'HttpStatus404', 'HttpStatus405', 'HttpStatus408', - /// 'HttpStatus500', 'HttpStatus502', 'HttpStatus503', - /// 'HttpStatus504' - /// Error page URL of the application - /// gateway custom error. + + /// Status code of the application gateway custom error. + /// Possible values include: 'HttpStatus400', 'HttpStatus403', 'HttpStatus404', + /// 'HttpStatus405', 'HttpStatus408', 'HttpStatus500', 'HttpStatus502', + /// 'HttpStatus503', 'HttpStatus504' + + /// Error page URL of the application gateway custom error. + /// public ApplicationGatewayCustomError(string statusCode = default(string), string customErrorPageUrl = default(string)) + { - StatusCode = statusCode; - CustomErrorPageUrl = customErrorPageUrl; + this.StatusCode = statusCode; + this.CustomErrorPageUrl = customErrorPageUrl; CustomInit(); } @@ -50,21 +44,17 @@ public ApplicationGatewayCustomError() /// partial void CustomInit(); + /// - /// Gets or sets status code of the application gateway custom error. - /// Possible values include: 'HttpStatus400', 'HttpStatus403', - /// 'HttpStatus404', 'HttpStatus405', 'HttpStatus408', 'HttpStatus500', - /// 'HttpStatus502', 'HttpStatus503', 'HttpStatus504' + /// Gets or sets status code of the application gateway custom error. Possible values include: 'HttpStatus400', 'HttpStatus403', 'HttpStatus404', 'HttpStatus405', 'HttpStatus408', 'HttpStatus500', 'HttpStatus502', 'HttpStatus503', 'HttpStatus504' /// - [JsonProperty(PropertyName = "statusCode")] - public string StatusCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statusCode")] + public string StatusCode {get; set; } /// - /// Gets or sets error page URL of the application gateway custom - /// error. + /// Gets or sets error page URL of the application gateway custom error. /// - [JsonProperty(PropertyName = "customErrorPageUrl")] - public string CustomErrorPageUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "customErrorPageUrl")] + public string CustomErrorPageUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomErrorStatusCode.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomErrorStatusCode.cs index 5cba0263ee28..7e23493ca172 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomErrorStatusCode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayCustomErrorStatusCode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayCustomErrorStatusCode. /// + + public static class ApplicationGatewayCustomErrorStatusCode { public const string HttpStatus400 = "HttpStatus400"; @@ -26,4 +23,4 @@ public static class ApplicationGatewayCustomErrorStatusCode public const string HttpStatus503 = "HttpStatus503"; public const string HttpStatus504 = "HttpStatus504"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallDisabledRuleGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallDisabledRuleGroup.cs index c2b89b978c28..36bf00408d5f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallDisabledRuleGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallDisabledRuleGroup.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayFirewallDisabledRuleGroup { /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallDisabledRuleGroup class. + /// Initializes a new instance of the ApplicationGatewayFirewallDisabledRuleGroup class. /// public ApplicationGatewayFirewallDisabledRuleGroup() { @@ -31,17 +21,20 @@ public ApplicationGatewayFirewallDisabledRuleGroup() } /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallDisabledRuleGroup class. + /// Initializes a new instance of the ApplicationGatewayFirewallDisabledRuleGroup class. /// - /// The name of the rule group that will be - /// disabled. - /// The list of rules that will be disabled. If - /// null, all rules of the rule group will be disabled. - public ApplicationGatewayFirewallDisabledRuleGroup(string ruleGroupName, IList rules = default(IList)) + + /// The name of the rule group that will be disabled. + /// + + /// The list of rules that will be disabled. If null, all rules of the rule + /// group will be disabled. + /// + public ApplicationGatewayFirewallDisabledRuleGroup(string ruleGroupName, System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + { - RuleGroupName = ruleGroupName; - Rules = rules; + this.RuleGroupName = ruleGroupName; + this.Rules = rules; CustomInit(); } @@ -50,31 +43,33 @@ public ApplicationGatewayFirewallDisabledRuleGroup() /// partial void CustomInit(); + /// /// Gets or sets the name of the rule group that will be disabled. /// - [JsonProperty(PropertyName = "ruleGroupName")] - public string RuleGroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroupName")] + public string RuleGroupName {get; set; } /// - /// Gets or sets the list of rules that will be disabled. If null, all - /// rules of the rule group will be disabled. + /// Gets or sets the list of rules that will be disabled. If null, all rules of + /// the rule group will be disabled. /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleGroupName == null) + if (this.RuleGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleGroupName"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallExclusion.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallExclusion.cs index 9b1e559c8dd4..9a16c9a6ef91 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallExclusion.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallExclusion.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayFirewallExclusion { /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallExclusion class. + /// Initializes a new instance of the ApplicationGatewayFirewallExclusion class. /// public ApplicationGatewayFirewallExclusion() { @@ -29,21 +21,25 @@ public ApplicationGatewayFirewallExclusion() } /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallExclusion class. + /// Initializes a new instance of the ApplicationGatewayFirewallExclusion class. /// - /// The variable to be excluded. - /// When matchVariable is a - /// collection, operate on the selector to specify which elements in - /// the collection this exclusion applies to. - /// When matchVariable is a collection, operator - /// used to specify which elements in the collection this exclusion - /// applies to. + + /// The variable to be excluded. + /// + + /// When matchVariable is a collection, operate on the selector to specify + /// which elements in the collection this exclusion applies to. + /// + + /// When matchVariable is a collection, operator used to specify which elements + /// in the collection this exclusion applies to. + /// public ApplicationGatewayFirewallExclusion(string matchVariable, string selectorMatchOperator, string selector) + { - MatchVariable = matchVariable; - SelectorMatchOperator = selectorMatchOperator; - Selector = selector; + this.MatchVariable = matchVariable; + this.SelectorMatchOperator = selectorMatchOperator; + this.Selector = selector; CustomInit(); } @@ -52,47 +48,49 @@ public ApplicationGatewayFirewallExclusion(string matchVariable, string selector /// partial void CustomInit(); + /// /// Gets or sets the variable to be excluded. /// - [JsonProperty(PropertyName = "matchVariable")] - public string MatchVariable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchVariable")] + public string MatchVariable {get; set; } /// - /// Gets or sets when matchVariable is a collection, operate on the - /// selector to specify which elements in the collection this exclusion - /// applies to. + /// Gets or sets when matchVariable is a collection, operate on the selector to + /// specify which elements in the collection this exclusion applies to. /// - [JsonProperty(PropertyName = "selectorMatchOperator")] - public string SelectorMatchOperator { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "selectorMatchOperator")] + public string SelectorMatchOperator {get; set; } /// - /// Gets or sets when matchVariable is a collection, operator used to - /// specify which elements in the collection this exclusion applies to. + /// Gets or sets when matchVariable is a collection, operator used to specify + /// which elements in the collection this exclusion applies to. /// - [JsonProperty(PropertyName = "selector")] - public string Selector { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "selector")] + public string Selector {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MatchVariable == null) + if (this.MatchVariable == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchVariable"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MatchVariable"); } - if (SelectorMatchOperator == null) + if (this.SelectorMatchOperator == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SelectorMatchOperator"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SelectorMatchOperator"); } - if (Selector == null) + if (this.Selector == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Selector"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Selector"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallManifestRuleSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallManifestRuleSet.cs index bec39f4333d7..7e3ac9188374 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallManifestRuleSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallManifestRuleSet.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayFirewallManifestRuleSet { /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallManifestRuleSet class. + /// Initializes a new instance of the ApplicationGatewayFirewallManifestRuleSet class. /// public ApplicationGatewayFirewallManifestRuleSet() { @@ -31,26 +21,31 @@ public ApplicationGatewayFirewallManifestRuleSet() } /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallManifestRuleSet class. + /// Initializes a new instance of the ApplicationGatewayFirewallManifestRuleSet class. /// - /// The type of the web application firewall - /// rule set. - /// The version of the web application - /// firewall rule set type. - /// The rule groups of the web application - /// firewall rule set. - /// The rule set status. Possible values include: - /// 'Preview', 'GA', 'Supported', 'Deprecated' - /// Tier of an application gateway that support the - /// rule set. - public ApplicationGatewayFirewallManifestRuleSet(string ruleSetType, string ruleSetVersion, IList ruleGroups, string status = default(string), IList tiers = default(IList)) + + /// The type of the web application firewall rule set. + /// + + /// The version of the web application firewall rule set type. + /// + + /// The rule set status + /// Possible values include: 'Preview', 'GA', 'Supported', 'Deprecated' + + /// Tier of an application gateway that support the rule set. + /// + + /// The rule groups of the web application firewall rule set. + /// + public ApplicationGatewayFirewallManifestRuleSet(string ruleSetType, string ruleSetVersion, System.Collections.Generic.IList ruleGroups, string status = default(string), System.Collections.Generic.IList tiers = default(System.Collections.Generic.IList)) + { - RuleSetType = ruleSetType; - RuleSetVersion = ruleSetVersion; - Status = status; - Tiers = tiers; - RuleGroups = ruleGroups; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + this.Status = status; + this.Tiers = tiers; + this.RuleGroups = ruleGroups; CustomInit(); } @@ -59,63 +54,63 @@ public ApplicationGatewayFirewallManifestRuleSet() /// partial void CustomInit(); + /// /// Gets or sets the type of the web application firewall rule set. /// - [JsonProperty(PropertyName = "ruleSetType")] - public string RuleSetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetType")] + public string RuleSetType {get; set; } /// - /// Gets or sets the version of the web application firewall rule set - /// type. + /// Gets or sets the version of the web application firewall rule set type. /// - [JsonProperty(PropertyName = "ruleSetVersion")] - public string RuleSetVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetVersion")] + public string RuleSetVersion {get; set; } /// - /// Gets or sets the rule set status. Possible values include: - /// 'Preview', 'GA', 'Supported', 'Deprecated' + /// Gets or sets the rule set status Possible values include: 'Preview', 'GA', 'Supported', 'Deprecated' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets tier of an application gateway that support the rule - /// set. + /// Gets or sets tier of an application gateway that support the rule set. /// - [JsonProperty(PropertyName = "tiers")] - public IList Tiers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tiers")] + public System.Collections.Generic.IList Tiers {get; set; } /// - /// Gets or sets the rule groups of the web application firewall rule - /// set. + /// Gets or sets the rule groups of the web application firewall rule set. /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroups")] + public System.Collections.Generic.IList RuleGroups {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleSetType == null) + if (this.RuleSetType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetType"); } - if (RuleSetVersion == null) + if (this.RuleSetVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetVersion"); } - if (RuleGroups == null) + if (this.RuleGroups == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroups"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleGroups"); } - if (RuleGroups != null) + + + + + if (this.RuleGroups != null) { - foreach (var element in RuleGroups) + foreach (var element in this.RuleGroups) { if (element != null) { @@ -125,4 +120,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallMode.cs index 3f84b22c3ae8..388fb4364060 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayFirewallMode. /// + + public static class ApplicationGatewayFirewallMode { public const string Detection = "Detection"; public const string Prevention = "Prevention"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRateLimitDuration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRateLimitDuration.cs index 16bc91629965..e6e76e3217c8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRateLimitDuration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRateLimitDuration.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayFirewallRateLimitDuration. /// + + public static class ApplicationGatewayFirewallRateLimitDuration { public const string OneMin = "OneMin"; public const string FiveMins = "FiveMins"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRule.cs index a3a79f65aa62..e56cb2434704 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayFirewallRule { /// - /// Initializes a new instance of the ApplicationGatewayFirewallRule - /// class. + /// Initializes a new instance of the ApplicationGatewayFirewallRule class. /// public ApplicationGatewayFirewallRule() { @@ -28,28 +21,31 @@ public ApplicationGatewayFirewallRule() } /// - /// Initializes a new instance of the ApplicationGatewayFirewallRule - /// class. + /// Initializes a new instance of the ApplicationGatewayFirewallRule class. /// - /// The identifier of the web application firewall - /// rule. - /// The string representation of the web - /// application firewall rule identifier. - /// The string representation of the web - /// application firewall rule state. Possible values include: - /// 'Enabled', 'Disabled' - /// The string representation of the web - /// application firewall rule action. Possible values include: 'None', - /// 'AnomalyScoring', 'Allow', 'Block', 'Log' - /// The description of the web application - /// firewall rule. + + /// The identifier of the web application firewall rule. + /// + + /// The string representation of the web application firewall rule identifier. + /// + + /// The string representation of the web application firewall rule state. + /// Possible values include: 'Enabled', 'Disabled' + + /// The string representation of the web application firewall rule action. + /// Possible values include: 'None', 'AnomalyScoring', 'Allow', 'Block', 'Log' + + /// The description of the web application firewall rule. + /// public ApplicationGatewayFirewallRule(int ruleId, string ruleIdString = default(string), string state = default(string), string action = default(string), string description = default(string)) + { - RuleId = ruleId; - RuleIdString = ruleIdString; - State = state; - Action = action; - Description = description; + this.RuleId = ruleId; + this.RuleIdString = ruleIdString; + this.State = state; + this.Action = action; + this.Description = description; CustomInit(); } @@ -58,48 +54,51 @@ public ApplicationGatewayFirewallRule() /// partial void CustomInit(); + /// /// Gets or sets the identifier of the web application firewall rule. /// - [JsonProperty(PropertyName = "ruleId")] - public int RuleId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleId")] + public int RuleId {get; set; } /// - /// Gets or sets the string representation of the web application - /// firewall rule identifier. + /// Gets or sets the string representation of the web application firewall rule + /// identifier. /// - [JsonProperty(PropertyName = "ruleIdString")] - public string RuleIdString { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleIdString")] + public string RuleIdString {get; set; } /// - /// Gets or sets the string representation of the web application - /// firewall rule state. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets the string representation of the web application firewall rule + /// state. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// - /// Gets or sets the string representation of the web application - /// firewall rule action. Possible values include: 'None', - /// 'AnomalyScoring', 'Allow', 'Block', 'Log' + /// Gets or sets the string representation of the web application firewall rule + /// action. Possible values include: 'None', 'AnomalyScoring', 'Allow', 'Block', 'Log' /// - [JsonProperty(PropertyName = "action")] - public string Action { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public string Action {get; set; } /// /// Gets or sets the description of the web application firewall rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs index ac2a42098a70..1247a05f0050 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayFirewallRuleGroup { /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallRuleGroup class. + /// Initializes a new instance of the ApplicationGatewayFirewallRuleGroup class. /// public ApplicationGatewayFirewallRuleGroup() { @@ -31,20 +21,23 @@ public ApplicationGatewayFirewallRuleGroup() } /// - /// Initializes a new instance of the - /// ApplicationGatewayFirewallRuleGroup class. + /// Initializes a new instance of the ApplicationGatewayFirewallRuleGroup class. /// - /// The name of the web application - /// firewall rule group. - /// The rules of the web application firewall rule - /// group. - /// The description of the web application - /// firewall rule group. - public ApplicationGatewayFirewallRuleGroup(string ruleGroupName, IList rules, string description = default(string)) + + /// The name of the web application firewall rule group. + /// + + /// The description of the web application firewall rule group. + /// + + /// The rules of the web application firewall rule group. + /// + public ApplicationGatewayFirewallRuleGroup(string ruleGroupName, System.Collections.Generic.IList rules, string description = default(string)) + { - RuleGroupName = ruleGroupName; - Description = description; - Rules = rules; + this.RuleGroupName = ruleGroupName; + this.Description = description; + this.Rules = rules; CustomInit(); } @@ -53,44 +46,45 @@ public ApplicationGatewayFirewallRuleGroup() /// partial void CustomInit(); + /// /// Gets or sets the name of the web application firewall rule group. /// - [JsonProperty(PropertyName = "ruleGroupName")] - public string RuleGroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroupName")] + public string RuleGroupName {get; set; } /// - /// Gets or sets the description of the web application firewall rule - /// group. + /// Gets or sets the description of the web application firewall rule group. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets the rules of the web application firewall rule group. /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleGroupName == null) + if (this.RuleGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleGroupName"); } - if (Rules == null) + if (this.Rules == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Rules"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Rules"); } - if (Rules != null) + + + if (this.Rules != null) { - foreach (var element in Rules) + foreach (var element in this.Rules) { if (element != null) { @@ -100,4 +94,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSet.cs index 79052dfe1bd6..a5585da03c0a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSet.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A web application firewall rule set. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayFirewallRuleSet : Resource { /// - /// Initializes a new instance of the ApplicationGatewayFirewallRuleSet - /// class. + /// Initializes a new instance of the ApplicationGatewayFirewallRuleSet class. /// public ApplicationGatewayFirewallRuleSet() { @@ -33,33 +22,47 @@ public ApplicationGatewayFirewallRuleSet() } /// - /// Initializes a new instance of the ApplicationGatewayFirewallRuleSet - /// class. + /// Initializes a new instance of the ApplicationGatewayFirewallRuleSet class. /// - /// The type of the web application firewall - /// rule set. - /// The version of the web application - /// firewall rule set type. - /// The rule groups of the web application - /// firewall rule set. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The provisioning state of the web - /// application firewall rule set. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Tier of an application gateway that support the - /// rule set. - public ApplicationGatewayFirewallRuleSet(string ruleSetType, string ruleSetVersion, IList ruleGroups, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList tiers = default(IList)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The provisioning state of the web application firewall rule set. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of the web application firewall rule set. + /// + + /// The version of the web application firewall rule set type. + /// + + /// The rule groups of the web application firewall rule set. + /// + + /// Tier of an application gateway that support the rule set. + /// + public ApplicationGatewayFirewallRuleSet(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string provisioningState = default(string), string ruleSetType = default(string), string ruleSetVersion = default(string), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList tiers = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - ProvisioningState = provisioningState; - RuleSetType = ruleSetType; - RuleSetVersion = ruleSetVersion; - RuleGroups = ruleGroups; - Tiers = tiers; + this.ProvisioningState = provisioningState; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + this.RuleGroups = ruleGroups; + this.Tiers = tiers; CustomInit(); } @@ -68,71 +71,35 @@ public ApplicationGatewayFirewallRuleSet() /// partial void CustomInit(); - /// - /// Gets the provisioning state of the web application firewall rule - /// set. Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } /// - /// Gets or sets the type of the web application firewall rule set. + /// Gets the provisioning state of the web application firewall rule set. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.ruleSetType")] - public string RuleSetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the version of the web application firewall rule set - /// type. + /// Gets or sets the type of the web application firewall rule set. /// - [JsonProperty(PropertyName = "properties.ruleSetVersion")] - public string RuleSetVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleSetType")] + public string RuleSetType {get; set; } /// - /// Gets or sets the rule groups of the web application firewall rule - /// set. + /// Gets or sets the version of the web application firewall rule set type. /// - [JsonProperty(PropertyName = "properties.ruleGroups")] - public IList RuleGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleSetVersion")] + public string RuleSetVersion {get; set; } /// - /// Gets or sets tier of an application gateway that support the rule - /// set. + /// Gets or sets the rule groups of the web application firewall rule set. /// - [JsonProperty(PropertyName = "properties.tiers")] - public IList Tiers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleGroups")] + public System.Collections.Generic.IList RuleGroups {get; set; } /// - /// Validate the object. + /// Gets or sets tier of an application gateway that support the rule set. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (RuleSetType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType"); - } - if (RuleSetVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion"); - } - if (RuleGroups == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroups"); - } - if (RuleGroups != null) - { - foreach (var element in RuleGroups) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tiers")] + public System.Collections.Generic.IList Tiers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSetPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSetPropertiesFormat.cs new file mode 100644 index 000000000000..30c701d556f2 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallRuleSetPropertiesFormat.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the web application firewall rule set. + /// + public partial class ApplicationGatewayFirewallRuleSetPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayFirewallRuleSetPropertiesFormat class. + /// + public ApplicationGatewayFirewallRuleSetPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayFirewallRuleSetPropertiesFormat class. + /// + + /// The provisioning state of the web application firewall rule set. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of the web application firewall rule set. + /// + + /// The version of the web application firewall rule set type. + /// + + /// The rule groups of the web application firewall rule set. + /// + + /// Tier of an application gateway that support the rule set. + /// + public ApplicationGatewayFirewallRuleSetPropertiesFormat(string ruleSetType, string ruleSetVersion, System.Collections.Generic.IList ruleGroups, string provisioningState = default(string), System.Collections.Generic.IList tiers = default(System.Collections.Generic.IList)) + + { + this.ProvisioningState = provisioningState; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + this.RuleGroups = ruleGroups; + this.Tiers = tiers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the web application firewall rule set. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the type of the web application firewall rule set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetType")] + public string RuleSetType {get; set; } + + /// + /// Gets or sets the version of the web application firewall rule set type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetVersion")] + public string RuleSetVersion {get; set; } + + /// + /// Gets or sets the rule groups of the web application firewall rule set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroups")] + public System.Collections.Generic.IList RuleGroups {get; set; } + + /// + /// Gets or sets tier of an application gateway that support the rule set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tiers")] + public System.Collections.Generic.IList Tiers {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RuleSetType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetType"); + } + if (this.RuleSetVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetVersion"); + } + if (this.RuleGroups == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleGroups"); + } + + + + if (this.RuleGroups != null) + { + foreach (var element in this.RuleGroups) + { + if (element != null) + { + element.Validate(); + } + } + } + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallUserSessionVariable.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallUserSessionVariable.cs index fe6ff6d03de3..5d432ea35789 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallUserSessionVariable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFirewallUserSessionVariable.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayFirewallUserSessionVariable. /// + + public static class ApplicationGatewayFirewallUserSessionVariable { public const string ClientAddr = "ClientAddr"; public const string GeoLocation = "GeoLocation"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs index 122d0e45e3c3..d89705074cb1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Frontend IP configuration of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayFrontendIPConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayFrontendIPConfiguration class. + /// Initializes a new instance of the ApplicationGatewayFrontendIPConfiguration class. /// public ApplicationGatewayFrontendIPConfiguration() { @@ -31,40 +22,52 @@ public ApplicationGatewayFrontendIPConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayFrontendIPConfiguration class. + /// Initializes a new instance of the ApplicationGatewayFrontendIPConfiguration class. /// - /// Resource ID. - /// PrivateIPAddress of the network - /// interface IP Configuration. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// Reference to the subnet resource. - /// Reference to the PublicIP - /// resource. - /// Reference to the application - /// gateway private link configuration. - /// The provisioning state of the - /// frontend IP configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the frontend IP configuration that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayFrontendIPConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), SubResource privateLinkConfiguration = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the frontend IP configuration that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the frontend IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// PrivateIPAddress of the network interface IP Configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Reference to the subnet resource. + /// + + /// Reference to the PublicIP resource. + /// + + /// Reference to the application gateway private link configuration. + /// + public ApplicationGatewayFrontendIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), SubResource privateLinkConfiguration = default(SubResource)) + + : base(id) { - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - Subnet = subnet; - PublicIPAddress = publicIPAddress; - PrivateLinkConfiguration = privateLinkConfiguration; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.PrivateLinkConfiguration = privateLinkConfiguration; CustomInit(); } @@ -73,66 +76,62 @@ public ApplicationGatewayFrontendIPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets privateIPAddress of the network interface IP - /// Configuration. + /// Gets or sets name of the frontend IP configuration that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets reference to the subnet resource. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets reference to the PublicIP resource. + /// Gets the provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public SubResource PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets reference to the application gateway private link - /// configuration. + /// Gets or sets privateIPAddress of the network interface IP Configuration. /// - [JsonProperty(PropertyName = "properties.privateLinkConfiguration")] - public SubResource PrivateLinkConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets the provisioning state of the frontend IP configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets or sets name of the frontend IP configuration that is unique - /// within an Application Gateway. + /// Gets or sets reference to the subnet resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets reference to the PublicIP resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public SubResource PublicIPAddress {get; set; } /// - /// Gets type of the resource. + /// Gets or sets reference to the application gateway private link + /// configuration. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkConfiguration")] + public SubResource PrivateLinkConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..47588dcd26f3 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendIPConfigurationPropertiesFormat.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Frontend IP configuration of an application gateway. + /// + public partial class ApplicationGatewayFrontendIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayFrontendIPConfigurationPropertiesFormat class. + /// + public ApplicationGatewayFrontendIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayFrontendIPConfigurationPropertiesFormat class. + /// + + /// PrivateIPAddress of the network interface IP Configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Reference to the subnet resource. + /// + + /// Reference to the PublicIP resource. + /// + + /// Reference to the application gateway private link configuration. + /// + + /// The provisioning state of the frontend IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayFrontendIPConfigurationPropertiesFormat(string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), SubResource privateLinkConfiguration = default(SubResource), string provisioningState = default(string)) + + { + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.PrivateLinkConfiguration = privateLinkConfiguration; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets privateIPAddress of the network interface IP Configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets reference to the PublicIP resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public SubResource PublicIPAddress {get; set; } + + /// + /// Gets or sets reference to the application gateway private link + /// configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkConfiguration")] + public SubResource PrivateLinkConfiguration {get; set; } + + /// + /// Gets the provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPort.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPort.cs index dd472e8cf6a0..5118fceda2b4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPort.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPort.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Frontend port of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayFrontendPort : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayFrontendPort - /// class. + /// Initializes a new instance of the ApplicationGatewayFrontendPort class. /// public ApplicationGatewayFrontendPort() { @@ -31,27 +22,35 @@ public ApplicationGatewayFrontendPort() } /// - /// Initializes a new instance of the ApplicationGatewayFrontendPort - /// class. + /// Initializes a new instance of the ApplicationGatewayFrontendPort class. /// - /// Resource ID. - /// Frontend port. - /// The provisioning state of the - /// frontend port resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the frontend port that is unique within - /// an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayFrontendPort(string id = default(string), int? port = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the frontend port that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the frontend port resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Frontend port. + /// + public ApplicationGatewayFrontendPort(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), int? port = default(int?)) + + : base(id) { - Port = port; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Port = port; CustomInit(); } @@ -60,38 +59,37 @@ public ApplicationGatewayFrontendPort() /// partial void CustomInit(); + /// - /// Gets or sets frontend port. + /// Gets or sets name of the frontend port that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the frontend port resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of the frontend port that is unique within an - /// Application Gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the frontend port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets frontend port. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + public int? Port {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPortPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPortPropertiesFormat.cs new file mode 100644 index 000000000000..dd93d6a7e125 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayFrontendPortPropertiesFormat.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Frontend port of an application gateway. + /// + public partial class ApplicationGatewayFrontendPortPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayFrontendPortPropertiesFormat class. + /// + public ApplicationGatewayFrontendPortPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayFrontendPortPropertiesFormat class. + /// + + /// Frontend port. + /// + + /// The provisioning state of the frontend port resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayFrontendPortPropertiesFormat(int? port = default(int?), string provisioningState = default(string)) + + { + this.Port = port; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets frontend port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } + + /// + /// Gets the provisioning state of the frontend port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayGlobalConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayGlobalConfiguration.cs index d61f56a2f19d..14b5ca621efd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayGlobalConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayGlobalConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayGlobalConfiguration { /// - /// Initializes a new instance of the - /// ApplicationGatewayGlobalConfiguration class. + /// Initializes a new instance of the ApplicationGatewayGlobalConfiguration class. /// public ApplicationGatewayGlobalConfiguration() { @@ -28,17 +21,19 @@ public ApplicationGatewayGlobalConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayGlobalConfiguration class. + /// Initializes a new instance of the ApplicationGatewayGlobalConfiguration class. /// - /// Enable request - /// buffering. - /// Enable response - /// buffering. + + /// Enable request buffering. + /// + + /// Enable response buffering. + /// public ApplicationGatewayGlobalConfiguration(bool? enableRequestBuffering = default(bool?), bool? enableResponseBuffering = default(bool?)) + { - EnableRequestBuffering = enableRequestBuffering; - EnableResponseBuffering = enableResponseBuffering; + this.EnableRequestBuffering = enableRequestBuffering; + this.EnableResponseBuffering = enableResponseBuffering; CustomInit(); } @@ -47,17 +42,17 @@ public ApplicationGatewayGlobalConfiguration() /// partial void CustomInit(); + /// /// Gets or sets enable request buffering. /// - [JsonProperty(PropertyName = "enableRequestBuffering")] - public bool? EnableRequestBuffering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableRequestBuffering")] + public bool? EnableRequestBuffering {get; set; } /// /// Gets or sets enable response buffering. /// - [JsonProperty(PropertyName = "enableResponseBuffering")] - public bool? EnableResponseBuffering { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enableResponseBuffering")] + public bool? EnableResponseBuffering {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHeaderConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHeaderConfiguration.cs index ccb816cbb4d5..1d96f5f1ad03 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHeaderConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHeaderConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayHeaderConfiguration { /// - /// Initializes a new instance of the - /// ApplicationGatewayHeaderConfiguration class. + /// Initializes a new instance of the ApplicationGatewayHeaderConfiguration class. /// public ApplicationGatewayHeaderConfiguration() { @@ -28,17 +21,19 @@ public ApplicationGatewayHeaderConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayHeaderConfiguration class. + /// Initializes a new instance of the ApplicationGatewayHeaderConfiguration class. /// - /// Header name of the header - /// configuration. - /// Header value of the header - /// configuration. + + /// Header name of the header configuration. + /// + + /// Header value of the header configuration. + /// public ApplicationGatewayHeaderConfiguration(string headerName = default(string), string headerValue = default(string)) + { - HeaderName = headerName; - HeaderValue = headerValue; + this.HeaderName = headerName; + this.HeaderValue = headerValue; CustomInit(); } @@ -47,17 +42,17 @@ public ApplicationGatewayHeaderConfiguration() /// partial void CustomInit(); + /// /// Gets or sets header name of the header configuration. /// - [JsonProperty(PropertyName = "headerName")] - public string HeaderName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "headerName")] + public string HeaderName {get; set; } /// /// Gets or sets header value of the header configuration. /// - [JsonProperty(PropertyName = "headerValue")] - public string HeaderValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "headerValue")] + public string HeaderValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListener.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListener.cs index a4e5581149e0..f28c343a7625 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListener.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListener.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Http listener of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayHttpListener : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayHttpListener - /// class. + /// Initializes a new instance of the ApplicationGatewayHttpListener class. /// public ApplicationGatewayHttpListener() { @@ -33,54 +22,72 @@ public ApplicationGatewayHttpListener() } /// - /// Initializes a new instance of the ApplicationGatewayHttpListener - /// class. - /// - /// Resource ID. - /// Frontend IP configuration - /// resource of an application gateway. - /// Frontend port resource of an application - /// gateway. - /// Protocol of the HTTP listener. Possible - /// values include: 'Http', 'Https', 'Tcp', 'Tls' - /// Host name of HTTP listener. - /// SSL certificate resource of an - /// application gateway. - /// SSL profile resource of the application - /// gateway. - /// Applicable only if - /// protocol is https. Enables SNI for multi-hosting. - /// The provisioning state of the HTTP - /// listener resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Custom error configurations - /// of the HTTP listener. - /// Reference to the FirewallPolicy - /// resource. - /// List of Host names for HTTP Listener that - /// allows special wildcard characters as well. - /// Name of the HTTP listener that is unique within - /// an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), SubResource sslProfile = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), IList customErrorConfigurations = default(IList), SubResource firewallPolicy = default(SubResource), IList hostNames = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Initializes a new instance of the ApplicationGatewayHttpListener class. + /// + + /// Resource ID. + /// + + /// Name of the HTTP listener that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the HTTP listener resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Frontend IP configuration resource of an application gateway. + /// + + /// Frontend port resource of an application gateway. + /// + + /// Protocol of the HTTP listener. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Host name of HTTP listener. + /// + + /// SSL certificate resource of an application gateway. + /// + + /// SSL profile resource of the application gateway. + /// + + /// Applicable only if protocol is https. Enables SNI for multi-hosting. + /// + + /// Custom error configurations of the HTTP listener. + /// + + /// Reference to the FirewallPolicy resource. + /// + + /// List of Host names for HTTP Listener that allows special wildcard + /// characters as well. + /// + public ApplicationGatewayHttpListener(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), SubResource sslProfile = default(SubResource), bool? requireServerNameIndication = default(bool?), System.Collections.Generic.IList customErrorConfigurations = default(System.Collections.Generic.IList), SubResource firewallPolicy = default(SubResource), System.Collections.Generic.IList hostNames = default(System.Collections.Generic.IList)) + + : base(id) { - FrontendIPConfiguration = frontendIPConfiguration; - FrontendPort = frontendPort; - Protocol = protocol; - HostName = hostName; - SslCertificate = sslCertificate; - SslProfile = sslProfile; - RequireServerNameIndication = requireServerNameIndication; - ProvisioningState = provisioningState; - CustomErrorConfigurations = customErrorConfigurations; - FirewallPolicy = firewallPolicy; - HostNames = hostNames; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.FrontendIPConfiguration = frontendIPConfiguration; + this.FrontendPort = frontendPort; + this.Protocol = protocol; + this.HostName = hostName; + this.SslCertificate = sslCertificate; + this.SslProfile = sslProfile; + this.RequireServerNameIndication = requireServerNameIndication; + this.CustomErrorConfigurations = customErrorConfigurations; + this.FirewallPolicy = firewallPolicy; + this.HostNames = hostNames; CustomInit(); } @@ -89,96 +96,93 @@ public ApplicationGatewayHttpListener() /// partial void CustomInit(); + /// - /// Gets or sets frontend IP configuration resource of an application - /// gateway. + /// Gets or sets name of the HTTP listener that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] - public SubResource FrontendIPConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets frontend port resource of an application gateway. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.frontendPort")] - public SubResource FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets protocol of the HTTP listener. Possible values - /// include: 'Http', 'Https', 'Tcp', 'Tls' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets host name of HTTP listener. + /// Gets the provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.hostName")] - public string HostName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets SSL certificate resource of an application gateway. + /// Gets or sets frontend IP configuration resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.sslCertificate")] - public SubResource SslCertificate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } /// - /// Gets or sets SSL profile resource of the application gateway. + /// Gets or sets frontend port resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.sslProfile")] - public SubResource SslProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + public SubResource FrontendPort {get; set; } /// - /// Gets or sets applicable only if protocol is https. Enables SNI for - /// multi-hosting. + /// Gets or sets protocol of the HTTP listener. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' /// - [JsonProperty(PropertyName = "properties.requireServerNameIndication")] - public bool? RequireServerNameIndication { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets the provisioning state of the HTTP listener resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets host name of HTTP listener. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostName")] + public string HostName {get; set; } /// - /// Gets or sets custom error configurations of the HTTP listener. + /// Gets or sets sSL certificate resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.customErrorConfigurations")] - public IList CustomErrorConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificate")] + public SubResource SslCertificate {get; set; } /// - /// Gets or sets reference to the FirewallPolicy resource. + /// Gets or sets sSL profile resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.firewallPolicy")] - public SubResource FirewallPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslProfile")] + public SubResource SslProfile {get; set; } /// - /// Gets or sets list of Host names for HTTP Listener that allows - /// special wildcard characters as well. + /// Gets or sets applicable only if protocol is https. Enables SNI for + /// multi-hosting. /// - [JsonProperty(PropertyName = "properties.hostNames")] - public IList HostNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requireServerNameIndication")] + public bool? RequireServerNameIndication {get; set; } /// - /// Gets or sets name of the HTTP listener that is unique within an - /// Application Gateway. + /// Gets or sets custom error configurations of the HTTP listener. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customErrorConfigurations")] + public System.Collections.Generic.IList CustomErrorConfigurations {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets reference to the FirewallPolicy resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewallPolicy")] + public SubResource FirewallPolicy {get; set; } /// - /// Gets type of the resource. + /// Gets or sets list of Host names for HTTP Listener that allows special + /// wildcard characters as well. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostNames")] + public System.Collections.Generic.IList HostNames {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListenerPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListenerPropertiesFormat.cs new file mode 100644 index 000000000000..da4e836f907b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayHttpListenerPropertiesFormat.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of HTTP listener of an application gateway. + /// + public partial class ApplicationGatewayHttpListenerPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayHttpListenerPropertiesFormat class. + /// + public ApplicationGatewayHttpListenerPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayHttpListenerPropertiesFormat class. + /// + + /// Frontend IP configuration resource of an application gateway. + /// + + /// Frontend port resource of an application gateway. + /// + + /// Protocol of the HTTP listener. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Host name of HTTP listener. + /// + + /// SSL certificate resource of an application gateway. + /// + + /// SSL profile resource of the application gateway. + /// + + /// Applicable only if protocol is https. Enables SNI for multi-hosting. + /// + + /// The provisioning state of the HTTP listener resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Custom error configurations of the HTTP listener. + /// + + /// Reference to the FirewallPolicy resource. + /// + + /// List of Host names for HTTP Listener that allows special wildcard + /// characters as well. + /// + public ApplicationGatewayHttpListenerPropertiesFormat(SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), SubResource sslProfile = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), System.Collections.Generic.IList customErrorConfigurations = default(System.Collections.Generic.IList), SubResource firewallPolicy = default(SubResource), System.Collections.Generic.IList hostNames = default(System.Collections.Generic.IList)) + + { + this.FrontendIPConfiguration = frontendIPConfiguration; + this.FrontendPort = frontendPort; + this.Protocol = protocol; + this.HostName = hostName; + this.SslCertificate = sslCertificate; + this.SslProfile = sslProfile; + this.RequireServerNameIndication = requireServerNameIndication; + this.ProvisioningState = provisioningState; + this.CustomErrorConfigurations = customErrorConfigurations; + this.FirewallPolicy = firewallPolicy; + this.HostNames = hostNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets frontend IP configuration resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } + + /// + /// Gets or sets frontend port resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public SubResource FrontendPort {get; set; } + + /// + /// Gets or sets protocol of the HTTP listener. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets host name of HTTP listener. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostName")] + public string HostName {get; set; } + + /// + /// Gets or sets sSL certificate resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslCertificate")] + public SubResource SslCertificate {get; set; } + + /// + /// Gets or sets sSL profile resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslProfile")] + public SubResource SslProfile {get; set; } + + /// + /// Gets or sets applicable only if protocol is https. Enables SNI for + /// multi-hosting. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requireServerNameIndication")] + public bool? RequireServerNameIndication {get; set; } + + /// + /// Gets the provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets custom error configurations of the HTTP listener. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customErrorConfigurations")] + public System.Collections.Generic.IList CustomErrorConfigurations {get; set; } + + /// + /// Gets or sets reference to the FirewallPolicy resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallPolicy")] + public SubResource FirewallPolicy {get; set; } + + /// + /// Gets or sets list of Host names for HTTP Listener that allows special + /// wildcard characters as well. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostNames")] + public System.Collections.Generic.IList HostNames {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfiguration.cs index 857e1e1830b3..b7898e338a59 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfiguration.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IP configuration of an application gateway. Currently 1 public and 1 /// private IP configuration is allowed. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayIPConfiguration : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayIPConfiguration - /// class. + /// Initializes a new instance of the ApplicationGatewayIPConfiguration class. /// public ApplicationGatewayIPConfiguration() { @@ -32,28 +23,37 @@ public ApplicationGatewayIPConfiguration() } /// - /// Initializes a new instance of the ApplicationGatewayIPConfiguration - /// class. + /// Initializes a new instance of the ApplicationGatewayIPConfiguration class. /// - /// Resource ID. - /// Reference to the subnet resource. A subnet - /// from where application gateway gets its private address. - /// The provisioning state of the - /// application gateway IP configuration resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the IP configuration that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayIPConfiguration(string id = default(string), SubResource subnet = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the IP configuration that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the application gateway IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Reference to the subnet resource. A subnet from where application gateway + /// gets its private address. + /// + public ApplicationGatewayIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource subnet = default(SubResource)) + + : base(id) { - Subnet = subnet; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Subnet = subnet; CustomInit(); } @@ -62,40 +62,39 @@ public ApplicationGatewayIPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets reference to the subnet resource. A subnet from where - /// application gateway gets its private address. + /// Gets or sets name of the IP configuration that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the application gateway IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of the IP configuration that is unique within an - /// Application Gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the application gateway IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets reference to the subnet resource. A subnet from where + /// application gateway gets its private address. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..f1b068e81b1a --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayIPConfigurationPropertiesFormat.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of IP configuration of an application gateway. + /// + public partial class ApplicationGatewayIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayIPConfigurationPropertiesFormat class. + /// + public ApplicationGatewayIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayIPConfigurationPropertiesFormat class. + /// + + /// Reference to the subnet resource. A subnet from where application gateway + /// gets its private address. + /// + + /// The provisioning state of the application gateway IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayIPConfigurationPropertiesFormat(SubResource subnet = default(SubResource), string provisioningState = default(string)) + + { + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets reference to the subnet resource. A subnet from where + /// application gateway gets its private address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets the provisioning state of the application gateway IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListener.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListener.cs index 392bd36107ba..265b57116257 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListener.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListener.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Listener of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayListener : SubResource { /// @@ -34,41 +24,54 @@ public ApplicationGatewayListener() /// /// Initializes a new instance of the ApplicationGatewayListener class. /// - /// Resource ID. - /// Frontend IP configuration - /// resource of an application gateway. - /// Frontend port resource of an application - /// gateway. - /// Protocol of the listener. Possible values - /// include: 'Http', 'Https', 'Tcp', 'Tls' - /// SSL certificate resource of an - /// application gateway. - /// SSL profile resource of the application - /// gateway. - /// The provisioning state of the - /// listener resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// List of Server Name Indications(SNI) for - /// TLS Multi-site Listener that allows special wildcard characters as - /// well. - /// Name of the listener that is unique within an - /// Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), SubResource sslCertificate = default(SubResource), SubResource sslProfile = default(SubResource), string provisioningState = default(string), IList hostNames = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the listener that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the listener resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Frontend IP configuration resource of an application gateway. + /// + + /// Frontend port resource of an application gateway. + /// + + /// Protocol of the listener. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// SSL certificate resource of an application gateway. + /// + + /// SSL profile resource of the application gateway. + /// + + /// List of Server Name Indications(SNI) for TLS Multi-site Listener that + /// allows special wildcard characters as well. + /// + public ApplicationGatewayListener(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), SubResource sslCertificate = default(SubResource), SubResource sslProfile = default(SubResource), System.Collections.Generic.IList hostNames = default(System.Collections.Generic.IList)) + + : base(id) { - FrontendIPConfiguration = frontendIPConfiguration; - FrontendPort = frontendPort; - Protocol = protocol; - SslCertificate = sslCertificate; - SslProfile = sslProfile; - ProvisioningState = provisioningState; - HostNames = hostNames; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.FrontendIPConfiguration = frontendIPConfiguration; + this.FrontendPort = frontendPort; + this.Protocol = protocol; + this.SslCertificate = sslCertificate; + this.SslProfile = sslProfile; + this.HostNames = hostNames; CustomInit(); } @@ -77,72 +80,68 @@ public ApplicationGatewayListener() /// partial void CustomInit(); + /// - /// Gets or sets frontend IP configuration resource of an application - /// gateway. + /// Gets or sets name of the listener that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] - public SubResource FrontendIPConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets frontend port resource of an application gateway. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.frontendPort")] - public SubResource FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets protocol of the listener. Possible values include: - /// 'Http', 'Https', 'Tcp', 'Tls' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets SSL certificate resource of an application gateway. + /// Gets the provisioning state of the listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.sslCertificate")] - public SubResource SslCertificate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets SSL profile resource of the application gateway. + /// Gets or sets frontend IP configuration resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.sslProfile")] - public SubResource SslProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } /// - /// Gets the provisioning state of the listener resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets frontend port resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + public SubResource FrontendPort {get; set; } /// - /// Gets or sets list of Server Name Indications(SNI) for TLS - /// Multi-site Listener that allows special wildcard characters as - /// well. + /// Gets or sets protocol of the listener. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' /// - [JsonProperty(PropertyName = "properties.hostNames")] - public IList HostNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets name of the listener that is unique within an - /// Application Gateway. + /// Gets or sets sSL certificate resource of an application gateway. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificate")] + public SubResource SslCertificate {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets sSL profile resource of the application gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslProfile")] + public SubResource SslProfile {get; set; } /// - /// Gets type of the resource. + /// Gets or sets list of Server Name Indications(SNI) for TLS Multi-site + /// Listener that allows special wildcard characters as well. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostNames")] + public System.Collections.Generic.IList HostNames {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListenerPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListenerPropertiesFormat.cs new file mode 100644 index 000000000000..ee78a8609fa5 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayListenerPropertiesFormat.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of listener of an application gateway. + /// + public partial class ApplicationGatewayListenerPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayListenerPropertiesFormat class. + /// + public ApplicationGatewayListenerPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayListenerPropertiesFormat class. + /// + + /// Frontend IP configuration resource of an application gateway. + /// + + /// Frontend port resource of an application gateway. + /// + + /// Protocol of the listener. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// SSL certificate resource of an application gateway. + /// + + /// SSL profile resource of the application gateway. + /// + + /// The provisioning state of the listener resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of Server Name Indications(SNI) for TLS Multi-site Listener that + /// allows special wildcard characters as well. + /// + public ApplicationGatewayListenerPropertiesFormat(SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), SubResource sslCertificate = default(SubResource), SubResource sslProfile = default(SubResource), string provisioningState = default(string), System.Collections.Generic.IList hostNames = default(System.Collections.Generic.IList)) + + { + this.FrontendIPConfiguration = frontendIPConfiguration; + this.FrontendPort = frontendPort; + this.Protocol = protocol; + this.SslCertificate = sslCertificate; + this.SslProfile = sslProfile; + this.ProvisioningState = provisioningState; + this.HostNames = hostNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets frontend IP configuration resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } + + /// + /// Gets or sets frontend port resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public SubResource FrontendPort {get; set; } + + /// + /// Gets or sets protocol of the listener. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets sSL certificate resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslCertificate")] + public SubResource SslCertificate {get; set; } + + /// + /// Gets or sets sSL profile resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslProfile")] + public SubResource SslProfile {get; set; } + + /// + /// Gets the provisioning state of the listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets list of Server Name Indications(SNI) for TLS Multi-site + /// Listener that allows special wildcard characters as well. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostNames")] + public System.Collections.Generic.IList HostNames {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs index a640014216dc..8a1cbd88ec16 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayLoadDistributionAlgorithm. /// + + public static class ApplicationGatewayLoadDistributionAlgorithm { public const string RoundRobin = "RoundRobin"; public const string LeastConnections = "LeastConnections"; public const string IpHash = "IpHash"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs index c6bfc5cbff49..7b3142f90dbe 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Load Distribution Policy of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayLoadDistributionPolicy : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayLoadDistributionPolicy class. + /// Initializes a new instance of the ApplicationGatewayLoadDistributionPolicy class. /// public ApplicationGatewayLoadDistributionPolicy() { @@ -33,32 +22,40 @@ public ApplicationGatewayLoadDistributionPolicy() } /// - /// Initializes a new instance of the - /// ApplicationGatewayLoadDistributionPolicy class. + /// Initializes a new instance of the ApplicationGatewayLoadDistributionPolicy class. /// - /// Resource ID. - /// Load Distribution Targets - /// resource of an application gateway. - /// Load Distribution Targets - /// resource of an application gateway. Possible values include: - /// 'RoundRobin', 'LeastConnections', 'IpHash' - /// The provisioning state of the Load - /// Distribution Policy resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the load distribution policy that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayLoadDistributionPolicy(string id = default(string), IList loadDistributionTargets = default(IList), string loadDistributionAlgorithm = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the load distribution policy that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the Load Distribution Policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Load Distribution Targets resource of an application gateway. + /// + + /// Load Distribution Targets resource of an application gateway. + /// Possible values include: 'RoundRobin', 'LeastConnections', 'IpHash' + public ApplicationGatewayLoadDistributionPolicy(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList loadDistributionTargets = default(System.Collections.Generic.IList), string loadDistributionAlgorithm = default(string)) + + : base(id) { - LoadDistributionTargets = loadDistributionTargets; - LoadDistributionAlgorithm = loadDistributionAlgorithm; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.LoadDistributionTargets = loadDistributionTargets; + this.LoadDistributionAlgorithm = loadDistributionAlgorithm; CustomInit(); } @@ -67,48 +64,43 @@ public ApplicationGatewayLoadDistributionPolicy() /// partial void CustomInit(); + /// - /// Gets or sets load Distribution Targets resource of an application - /// gateway. + /// Gets or sets name of the load distribution policy that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.loadDistributionTargets")] - public IList LoadDistributionTargets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets load Distribution Targets resource of an application - /// gateway. Possible values include: 'RoundRobin', 'LeastConnections', - /// 'IpHash' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.loadDistributionAlgorithm")] - public string LoadDistributionAlgorithm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the Load Distribution Policy - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the load distribution policy that is unique - /// within an Application Gateway. + /// Gets the provisioning state of the Load Distribution Policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets load Distribution Targets resource of an application gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistributionTargets")] + public System.Collections.Generic.IList LoadDistributionTargets {get; set; } /// - /// Gets type of the resource. + /// Gets or sets load Distribution Targets resource of an application gateway. Possible values include: 'RoundRobin', 'LeastConnections', 'IpHash' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistributionAlgorithm")] + public string LoadDistributionAlgorithm {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.cs new file mode 100644 index 000000000000..00766059ab93 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Load Distribution Policy of an application gateway. + /// + public partial class ApplicationGatewayLoadDistributionPolicyPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayLoadDistributionPolicyPropertiesFormat class. + /// + public ApplicationGatewayLoadDistributionPolicyPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayLoadDistributionPolicyPropertiesFormat class. + /// + + /// Load Distribution Targets resource of an application gateway. + /// + + /// Load Distribution Targets resource of an application gateway. + /// Possible values include: 'RoundRobin', 'LeastConnections', 'IpHash' + + /// The provisioning state of the Load Distribution Policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayLoadDistributionPolicyPropertiesFormat(System.Collections.Generic.IList loadDistributionTargets = default(System.Collections.Generic.IList), string loadDistributionAlgorithm = default(string), string provisioningState = default(string)) + + { + this.LoadDistributionTargets = loadDistributionTargets; + this.LoadDistributionAlgorithm = loadDistributionAlgorithm; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets load Distribution Targets resource of an application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadDistributionTargets")] + public System.Collections.Generic.IList LoadDistributionTargets {get; set; } + + /// + /// Gets or sets load Distribution Targets resource of an application gateway. Possible values include: 'RoundRobin', 'LeastConnections', 'IpHash' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadDistributionAlgorithm")] + public string LoadDistributionAlgorithm {get; set; } + + /// + /// Gets the provisioning state of the Load Distribution Policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs index 8ddb867b2931..d8f50d802b9f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Load Distribution Target of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayLoadDistributionTarget : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayLoadDistributionTarget class. + /// Initializes a new instance of the ApplicationGatewayLoadDistributionTarget class. /// public ApplicationGatewayLoadDistributionTarget() { @@ -31,27 +22,36 @@ public ApplicationGatewayLoadDistributionTarget() } /// - /// Initializes a new instance of the - /// ApplicationGatewayLoadDistributionTarget class. + /// Initializes a new instance of the ApplicationGatewayLoadDistributionTarget class. /// - /// Resource ID. - /// Weight per server. Range between 1 - /// and 100. - /// Backend address pool resource of - /// the application gateway. - /// Name of the load distribution policy that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayLoadDistributionTarget(string id = default(string), int? weightPerServer = default(int?), SubResource backendAddressPool = default(SubResource), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the load distribution policy that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// Weight per server. Range between 1 and 100. + /// + + /// Backend address pool resource of the application gateway. + /// + public ApplicationGatewayLoadDistributionTarget(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), int? weightPerServer = default(int?), SubResource backendAddressPool = default(SubResource)) + + : base(id) { - WeightPerServer = weightPerServer; - BackendAddressPool = backendAddressPool; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.WeightPerServer = weightPerServer; + this.BackendAddressPool = backendAddressPool; CustomInit(); } @@ -60,58 +60,61 @@ public ApplicationGatewayLoadDistributionTarget() /// partial void CustomInit(); + /// - /// Gets or sets weight per server. Range between 1 and 100. + /// Gets or sets name of the load distribution policy that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.weightPerServer")] - public int? WeightPerServer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets backend address pool resource of the application - /// gateway. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of the load distribution policy that is unique - /// within an Application Gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets weight per server. Range between 1 and 100. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weightPerServer")] + public int? WeightPerServer {get; set; } /// - /// Gets type of the resource. + /// Gets or sets backend address pool resource of the application gateway. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (WeightPerServer != null) + + + + if (this.WeightPerServer != null) { - if (WeightPerServer > 100) + if (this.WeightPerServer > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "WeightPerServer", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "WeightPerServer", 100); } - if (WeightPerServer < 1) + if (this.WeightPerServer < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "WeightPerServer", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "WeightPerServer", 1); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.cs new file mode 100644 index 000000000000..4d116322a356 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + public partial class ApplicationGatewayLoadDistributionTargetPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayLoadDistributionTargetPropertiesFormat class. + /// + public ApplicationGatewayLoadDistributionTargetPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayLoadDistributionTargetPropertiesFormat class. + /// + + /// Weight per server. Range between 1 and 100. + /// + + /// Backend address pool resource of the application gateway. + /// + public ApplicationGatewayLoadDistributionTargetPropertiesFormat(int? weightPerServer = default(int?), SubResource backendAddressPool = default(SubResource)) + + { + this.WeightPerServer = weightPerServer; + this.BackendAddressPool = backendAddressPool; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets weight per server. Range between 1 and 100. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "weightPerServer")] + public int? WeightPerServer {get; set; } + + /// + /// Gets or sets backend address pool resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.WeightPerServer != null) + { + if (this.WeightPerServer > 100) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "WeightPerServer", 100); + } + if (this.WeightPerServer < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "WeightPerServer", 1); + } + } + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOnDemandProbe.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOnDemandProbe.cs index 340919954013..c5a4bd7839f5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOnDemandProbe.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOnDemandProbe.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayOnDemandProbe { /// - /// Initializes a new instance of the ApplicationGatewayOnDemandProbe - /// class. + /// Initializes a new instance of the ApplicationGatewayOnDemandProbe class. /// public ApplicationGatewayOnDemandProbe() { @@ -28,37 +21,49 @@ public ApplicationGatewayOnDemandProbe() } /// - /// Initializes a new instance of the ApplicationGatewayOnDemandProbe - /// class. + /// Initializes a new instance of the ApplicationGatewayOnDemandProbe class. /// - /// The protocol used for the probe. Possible - /// values include: 'Http', 'Https', 'Tcp', 'Tls' - /// Host name to send the probe to. - /// Relative path of probe. Valid path starts from - /// '/'. Probe is sent to - /// <Protocol>://<host>:<port><path>. - /// 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. - /// Whether the host - /// header should be picked from the backend http settings. Default - /// value is false. - /// Criterion for classifying a healthy probe - /// response. - /// Reference to backend pool of - /// application gateway to which probe request will be sent. - /// Reference to backend http setting - /// of application gateway to be used for test probe. + + /// The protocol used for the probe. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Host name to send the probe to. + /// + + /// Relative path of probe. Valid path starts from '/'. Probe is sent to + /// <Protocol>://<host>:<port><path>. + /// + + /// 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. + /// + + /// Whether the host header should be picked from the backend http settings. + /// Default value is false. + /// + + /// Criterion for classifying a healthy probe response. + /// + + /// Reference to backend pool of application gateway to which probe request + /// will be sent. + /// + + /// Reference to backend http setting of application gateway to be used for + /// test probe. + /// public ApplicationGatewayOnDemandProbe(string protocol = default(string), string host = default(string), string path = default(string), int? timeout = default(int?), bool? pickHostNameFromBackendHttpSettings = default(bool?), ApplicationGatewayProbeHealthResponseMatch match = default(ApplicationGatewayProbeHealthResponseMatch), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource)) + { - Protocol = protocol; - Host = host; - Path = path; - Timeout = timeout; - PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; - Match = match; - BackendAddressPool = backendAddressPool; - BackendHttpSettings = backendHttpSettings; + this.Protocol = protocol; + this.Host = host; + this.Path = path; + this.Timeout = timeout; + this.PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + this.Match = match; + this.BackendAddressPool = backendAddressPool; + this.BackendHttpSettings = backendHttpSettings; CustomInit(); } @@ -67,61 +72,59 @@ public ApplicationGatewayOnDemandProbe() /// partial void CustomInit(); + /// - /// Gets or sets the protocol used for the probe. Possible values - /// include: 'Http', 'Https', 'Tcp', 'Tls' + /// Gets or sets the protocol used for the probe. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// /// Gets or sets host name to send the probe to. /// - [JsonProperty(PropertyName = "host")] - public string Host { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "host")] + public string Host {get; set; } /// - /// Gets or sets relative path of probe. Valid path starts from '/'. - /// Probe is sent to - /// &lt;Protocol&gt;://&lt;host&gt;:&lt;port&gt;&lt;path&gt;. + /// Gets or sets relative path of probe. Valid path starts from '/'. Probe is + /// sent to <Protocol>://<host>:<port><path>. /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "timeout")] - public int? Timeout { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeout")] + public int? Timeout {get; set; } /// - /// Gets or sets whether the host header should be picked from the - /// backend http settings. Default value is false. + /// Gets or sets whether the host header should be picked from the backend http + /// settings. Default value is false. /// - [JsonProperty(PropertyName = "pickHostNameFromBackendHttpSettings")] - public bool? PickHostNameFromBackendHttpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pickHostNameFromBackendHttpSettings")] + public bool? PickHostNameFromBackendHttpSettings {get; set; } /// /// Gets or sets criterion for classifying a healthy probe response. /// - [JsonProperty(PropertyName = "match")] - public ApplicationGatewayProbeHealthResponseMatch Match { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "match")] + public ApplicationGatewayProbeHealthResponseMatch Match {get; set; } /// - /// Gets or sets reference to backend pool of application gateway to - /// which probe request will be sent. + /// Gets or sets reference to backend pool of application gateway to which + /// probe request will be sent. /// - [JsonProperty(PropertyName = "backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// - /// Gets or sets reference to backend http setting of application - /// gateway to be used for test probe. + /// Gets or sets reference to backend http setting of application gateway to be + /// used for test probe. /// - [JsonProperty(PropertyName = "backendHttpSettings")] - public SubResource BackendHttpSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettings")] + public SubResource BackendHttpSettings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOperationalState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOperationalState.cs index b9647bfcdcc7..84ed850ab559 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOperationalState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayOperationalState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayOperationalState. /// + + public static class ApplicationGatewayOperationalState { public const string Stopped = "Stopped"; @@ -21,4 +18,4 @@ public static class ApplicationGatewayOperationalState public const string Running = "Running"; public const string Stopping = "Stopping"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRule.cs index 371156250b12..7bb590c42af7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Path rule of URL path map of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayPathRule : SubResource { /// @@ -34,42 +24,57 @@ public ApplicationGatewayPathRule() /// /// Initializes a new instance of the ApplicationGatewayPathRule class. /// - /// Resource ID. - /// Path rules of URL path map. - /// Backend address pool resource of - /// URL path map path rule. - /// Backend http settings resource of - /// URL path map path rule. - /// Redirect configuration resource - /// of URL path map path rule. - /// Rewrite rule set resource of URL path - /// map path rule. - /// Load Distribution Policy - /// resource of URL path map path rule. - /// The provisioning state of the path - /// rule resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Reference to the FirewallPolicy - /// resource. - /// Name of the path rule that is unique within an - /// Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayPathRule(string id = default(string), IList paths = default(IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource rewriteRuleSet = default(SubResource), SubResource loadDistributionPolicy = default(SubResource), string provisioningState = default(string), SubResource firewallPolicy = default(SubResource), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the path rule that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the path rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Path rules of URL path map. + /// + + /// Backend address pool resource of URL path map path rule. + /// + + /// Backend http settings resource of URL path map path rule. + /// + + /// Redirect configuration resource of URL path map path rule. + /// + + /// Rewrite rule set resource of URL path map path rule. + /// + + /// Load Distribution Policy resource of URL path map path rule. + /// + + /// Reference to the FirewallPolicy resource. + /// + public ApplicationGatewayPathRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList paths = default(System.Collections.Generic.IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource rewriteRuleSet = default(SubResource), SubResource loadDistributionPolicy = default(SubResource), SubResource firewallPolicy = default(SubResource)) + + : base(id) { - Paths = paths; - BackendAddressPool = backendAddressPool; - BackendHttpSettings = backendHttpSettings; - RedirectConfiguration = redirectConfiguration; - RewriteRuleSet = rewriteRuleSet; - LoadDistributionPolicy = loadDistributionPolicy; - ProvisioningState = provisioningState; - FirewallPolicy = firewallPolicy; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Paths = paths; + this.BackendAddressPool = backendAddressPool; + this.BackendHttpSettings = backendHttpSettings; + this.RedirectConfiguration = redirectConfiguration; + this.RewriteRuleSet = rewriteRuleSet; + this.LoadDistributionPolicy = loadDistributionPolicy; + this.FirewallPolicy = firewallPolicy; CustomInit(); } @@ -78,78 +83,73 @@ public ApplicationGatewayPathRule() /// partial void CustomInit(); + /// - /// Gets or sets path rules of URL path map. + /// Gets or sets name of the path rule that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.paths")] - public IList Paths { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets backend address pool resource of URL path map path - /// rule. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets backend http settings resource of URL path map path - /// rule. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.backendHttpSettings")] - public SubResource BackendHttpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets redirect configuration resource of URL path map path - /// rule. + /// Gets the provisioning state of the path rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.redirectConfiguration")] - public SubResource RedirectConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets rewrite rule set resource of URL path map path rule. + /// Gets or sets path rules of URL path map. /// - [JsonProperty(PropertyName = "properties.rewriteRuleSet")] - public SubResource RewriteRuleSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.paths")] + public System.Collections.Generic.IList Paths {get; set; } /// - /// Gets or sets load Distribution Policy resource of URL path map path - /// rule. + /// Gets or sets backend address pool resource of URL path map path rule. /// - [JsonProperty(PropertyName = "properties.loadDistributionPolicy")] - public SubResource LoadDistributionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// - /// Gets the provisioning state of the path rule resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets backend http settings resource of URL path map path rule. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettings")] + public SubResource BackendHttpSettings {get; set; } /// - /// Gets or sets reference to the FirewallPolicy resource. + /// Gets or sets redirect configuration resource of URL path map path rule. /// - [JsonProperty(PropertyName = "properties.firewallPolicy")] - public SubResource FirewallPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.redirectConfiguration")] + public SubResource RedirectConfiguration {get; set; } /// - /// Gets or sets name of the path rule that is unique within an - /// Application Gateway. + /// Gets or sets rewrite rule set resource of URL path map path rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rewriteRuleSet")] + public SubResource RewriteRuleSet {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets load Distribution Policy resource of URL path map path rule. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistributionPolicy")] + public SubResource LoadDistributionPolicy {get; set; } /// - /// Gets type of the resource. + /// Gets or sets reference to the FirewallPolicy resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewallPolicy")] + public SubResource FirewallPolicy {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRulePropertiesFormat.cs new file mode 100644 index 000000000000..7d9203dbe981 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPathRulePropertiesFormat.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of path rule of an application gateway. + /// + public partial class ApplicationGatewayPathRulePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayPathRulePropertiesFormat class. + /// + public ApplicationGatewayPathRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayPathRulePropertiesFormat class. + /// + + /// Path rules of URL path map. + /// + + /// Backend address pool resource of URL path map path rule. + /// + + /// Backend http settings resource of URL path map path rule. + /// + + /// Redirect configuration resource of URL path map path rule. + /// + + /// Rewrite rule set resource of URL path map path rule. + /// + + /// Load Distribution Policy resource of URL path map path rule. + /// + + /// The provisioning state of the path rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Reference to the FirewallPolicy resource. + /// + public ApplicationGatewayPathRulePropertiesFormat(System.Collections.Generic.IList paths = default(System.Collections.Generic.IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource rewriteRuleSet = default(SubResource), SubResource loadDistributionPolicy = default(SubResource), string provisioningState = default(string), SubResource firewallPolicy = default(SubResource)) + + { + this.Paths = paths; + this.BackendAddressPool = backendAddressPool; + this.BackendHttpSettings = backendHttpSettings; + this.RedirectConfiguration = redirectConfiguration; + this.RewriteRuleSet = rewriteRuleSet; + this.LoadDistributionPolicy = loadDistributionPolicy; + this.ProvisioningState = provisioningState; + this.FirewallPolicy = firewallPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets path rules of URL path map. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "paths")] + public System.Collections.Generic.IList Paths {get; set; } + + /// + /// Gets or sets backend address pool resource of URL path map path rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + + /// + /// Gets or sets backend http settings resource of URL path map path rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettings")] + public SubResource BackendHttpSettings {get; set; } + + /// + /// Gets or sets redirect configuration resource of URL path map path rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "redirectConfiguration")] + public SubResource RedirectConfiguration {get; set; } + + /// + /// Gets or sets rewrite rule set resource of URL path map path rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rewriteRuleSet")] + public SubResource RewriteRuleSet {get; set; } + + /// + /// Gets or sets load Distribution Policy resource of URL path map path rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadDistributionPolicy")] + public SubResource LoadDistributionPolicy {get; set; } + + /// + /// Gets the provisioning state of the path rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets reference to the FirewallPolicy resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallPolicy")] + public SubResource FirewallPolicy {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs index 4d0fe00919cd..685eb4b23457 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Private Endpoint connection on an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayPrivateEndpointConnection : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateEndpointConnection class. + /// Initializes a new instance of the ApplicationGatewayPrivateEndpointConnection class. /// public ApplicationGatewayPrivateEndpointConnection() { @@ -31,35 +22,45 @@ public ApplicationGatewayPrivateEndpointConnection() } /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateEndpointConnection class. + /// Initializes a new instance of the ApplicationGatewayPrivateEndpointConnection class. /// - /// Resource ID. - /// The resource of private end - /// point. - /// A collection of - /// information about the state of the connection between service - /// consumer and provider. - /// The provisioning state of the - /// application gateway private endpoint connection resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// The consumer link id. - /// Name of the private endpoint connection on an - /// application gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayPrivateEndpointConnection(string id = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string), string linkIdentifier = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the private endpoint connection on an application gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The resource of private end point. + /// + + /// The provisioning state of the application gateway private endpoint + /// connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + + /// The consumer link id. + /// + public ApplicationGatewayPrivateEndpointConnection(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string linkIdentifier = default(string)) + + : base(id) { - PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - ProvisioningState = provisioningState; - LinkIdentifier = linkIdentifier; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.PrivateEndpoint = privateEndpoint; + this.ProvisioningState = provisioningState; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + this.LinkIdentifier = linkIdentifier; CustomInit(); } @@ -68,52 +69,51 @@ public ApplicationGatewayPrivateEndpointConnection() /// partial void CustomInit(); + /// - /// Gets the resource of private end point. + /// Gets or sets name of the private endpoint connection on an application + /// gateway. /// - [JsonProperty(PropertyName = "properties.privateEndpoint")] - public PrivateEndpoint PrivateEndpoint { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets a collection of information about the state of the - /// connection between service consumer and provider. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] - public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the application gateway private - /// endpoint connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the consumer link id. + /// Gets the resource of private end point. /// - [JsonProperty(PropertyName = "properties.linkIdentifier")] - public string LinkIdentifier { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } /// - /// Gets or sets name of the private endpoint connection on an - /// application gateway. + /// Gets the provisioning state of the application gateway private endpoint + /// connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets a collection of information about the state of the connection + /// between service consumer and provider. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } /// - /// Gets type of the resource. + /// Gets the consumer link id. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkIdentifier")] + public string LinkIdentifier {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..108ac750b232 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateEndpointConnectionProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Private Link Resource of an application gateway. + /// + public partial class ApplicationGatewayPrivateEndpointConnectionProperties + { + /// + /// Initializes a new instance of the ApplicationGatewayPrivateEndpointConnectionProperties class. + /// + public ApplicationGatewayPrivateEndpointConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayPrivateEndpointConnectionProperties class. + /// + + /// The resource of private end point. + /// + + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + + /// The provisioning state of the application gateway private endpoint + /// connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The consumer link id. + /// + public ApplicationGatewayPrivateEndpointConnectionProperties(PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string), string linkIdentifier = default(string)) + + { + this.PrivateEndpoint = privateEndpoint; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + this.ProvisioningState = provisioningState; + this.LinkIdentifier = linkIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the resource of private end point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } + + /// + /// Gets or sets a collection of information about the state of the connection + /// between service consumer and provider. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } + + /// + /// Gets the provisioning state of the application gateway private endpoint + /// connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the consumer link id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkIdentifier")] + public string LinkIdentifier {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfiguration.cs index aee0e9022295..ff228aed4cf2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Private Link Configuration on an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayPrivateLinkConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateLinkConfiguration class. + /// Initializes a new instance of the ApplicationGatewayPrivateLinkConfiguration class. /// public ApplicationGatewayPrivateLinkConfiguration() { @@ -33,28 +22,37 @@ public ApplicationGatewayPrivateLinkConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateLinkConfiguration class. + /// Initializes a new instance of the ApplicationGatewayPrivateLinkConfiguration class. /// - /// Resource ID. - /// An array of application gateway - /// private link ip configurations. - /// The provisioning state of the - /// application gateway private link configuration. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the private link configuration that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayPrivateLinkConfiguration(string id = default(string), IList ipConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the private link configuration that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the application gateway private link + /// configuration. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// An array of application gateway private link ip configurations. + /// + public ApplicationGatewayPrivateLinkConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList)) + + : base(id) { - IpConfigurations = ipConfigurations; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.IPConfigurations = ipConfigurations; CustomInit(); } @@ -63,40 +61,39 @@ public ApplicationGatewayPrivateLinkConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets an array of application gateway private link ip - /// configurations. + /// Gets or sets name of the private link configuration that is unique within + /// an Application Gateway. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the application gateway private link - /// configuration. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of the private link configuration that is unique - /// within an Application Gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the application gateway private link + /// configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets an array of application gateway private link ip + /// configurations. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfigurationProperties.cs new file mode 100644 index 000000000000..51b8655bb2f1 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkConfigurationProperties.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of private link configuration on an application gateway. + /// + public partial class ApplicationGatewayPrivateLinkConfigurationProperties + { + /// + /// Initializes a new instance of the ApplicationGatewayPrivateLinkConfigurationProperties class. + /// + public ApplicationGatewayPrivateLinkConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayPrivateLinkConfigurationProperties class. + /// + + /// An array of application gateway private link ip configurations. + /// + + /// The provisioning state of the application gateway private link + /// configuration. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayPrivateLinkConfigurationProperties(System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.IPConfigurations = ipConfigurations; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets an array of application gateway private link ip + /// configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets the provisioning state of the application gateway private link + /// configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfiguration.cs index 6f2b8dbeb991..641ce031d353 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The application gateway private link ip configuration. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayPrivateLinkIpConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateLinkIpConfiguration class. + /// Initializes a new instance of the ApplicationGatewayPrivateLinkIpConfiguration class. /// public ApplicationGatewayPrivateLinkIpConfiguration() { @@ -31,37 +22,48 @@ public ApplicationGatewayPrivateLinkIpConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateLinkIpConfiguration class. + /// Initializes a new instance of the ApplicationGatewayPrivateLinkIpConfiguration class. /// - /// Resource ID. - /// The private IP address of the IP - /// configuration. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// Reference to the subnet resource. - /// Whether the ip configuration is primary or - /// not. - /// The provisioning state of the - /// application gateway private link IP configuration. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of application gateway private link ip - /// configuration. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The resource type. - public ApplicationGatewayPrivateLinkIpConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), bool? primary = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of application gateway private link ip configuration. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The resource type. + /// + + /// The provisioning state of the application gateway private link IP + /// configuration. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Reference to the subnet resource. + /// + + /// Whether the ip configuration is primary or not. + /// + public ApplicationGatewayPrivateLinkIpConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), bool? primary = default(bool?)) + + : base(id) { - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - Subnet = subnet; - Primary = primary; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.Primary = primary; CustomInit(); } @@ -70,58 +72,55 @@ public ApplicationGatewayPrivateLinkIpConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the private IP address of the IP configuration. + /// Gets or sets the name of application gateway private link ip configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets reference to the subnet resource. + /// Gets the resource type. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets whether the ip configuration is primary or not. + /// Gets the provisioning state of the application gateway private link IP + /// configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the application gateway private link - /// IP configuration. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets or sets the name of application gateway private link ip - /// configuration. + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets reference to the subnet resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets the resource type. + /// Gets or sets whether the ip configuration is primary or not. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfigurationProperties.cs new file mode 100644 index 000000000000..55ab445334b2 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkIpConfigurationProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of an application gateway private link IP configuration. + /// + public partial class ApplicationGatewayPrivateLinkIpConfigurationProperties + { + /// + /// Initializes a new instance of the ApplicationGatewayPrivateLinkIpConfigurationProperties class. + /// + public ApplicationGatewayPrivateLinkIpConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayPrivateLinkIpConfigurationProperties class. + /// + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Reference to the subnet resource. + /// + + /// Whether the ip configuration is primary or not. + /// + + /// The provisioning state of the application gateway private link IP + /// configuration. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayPrivateLinkIpConfigurationProperties(string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), bool? primary = default(bool?), string provisioningState = default(string)) + + { + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.Primary = primary; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the private IP address of the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets whether the ip configuration is primary or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets the provisioning state of the application gateway private link IP + /// configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResource.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResource.cs index 54b5d8c0b5ec..ee7ea148bcce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResource.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// PrivateLink Resource of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayPrivateLinkResource : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateLinkResource class. + /// Initializes a new instance of the ApplicationGatewayPrivateLinkResource class. /// public ApplicationGatewayPrivateLinkResource() { @@ -33,30 +22,40 @@ public ApplicationGatewayPrivateLinkResource() } /// - /// Initializes a new instance of the - /// ApplicationGatewayPrivateLinkResource class. + /// Initializes a new instance of the ApplicationGatewayPrivateLinkResource class. /// - /// Resource ID. - /// Group identifier of private link - /// resource. - /// Required member names of private link - /// resource. - /// Required DNS zone names of the the - /// private link resource. - /// Name of the private link resource that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayPrivateLinkResource(string id = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the private link resource that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// Group identifier of private link resource. + /// + + /// Required member names of private link resource. + /// + + /// Required DNS zone names of the the private link resource. + /// + public ApplicationGatewayPrivateLinkResource(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + + : base(id) { - GroupId = groupId; - RequiredMembers = requiredMembers; - RequiredZoneNames = requiredZoneNames; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.GroupId = groupId; + this.RequiredMembers = requiredMembers; + this.RequiredZoneNames = requiredZoneNames; CustomInit(); } @@ -65,44 +64,43 @@ public ApplicationGatewayPrivateLinkResource() /// partial void CustomInit(); + /// - /// Gets group identifier of private link resource. + /// Gets or sets name of the private link resource that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.groupId")] - public string GroupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets required member names of private link resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.requiredMembers")] - public IList RequiredMembers { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets required DNS zone names of the the private link - /// resource. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.requiredZoneNames")] - public IList RequiredZoneNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the private link resource that is unique - /// within an Application Gateway. + /// Gets group identifier of private link resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.groupId")] + public string GroupId {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets required member names of private link resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requiredMembers")] + public System.Collections.Generic.IList RequiredMembers {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets required DNS zone names of the the private link resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requiredZoneNames")] + public System.Collections.Generic.IList RequiredZoneNames {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResourceProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..6e7db6a2af89 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPrivateLinkResourceProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of a private link resource. + /// + public partial class ApplicationGatewayPrivateLinkResourceProperties + { + /// + /// Initializes a new instance of the ApplicationGatewayPrivateLinkResourceProperties class. + /// + public ApplicationGatewayPrivateLinkResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayPrivateLinkResourceProperties class. + /// + + /// Group identifier of private link resource. + /// + + /// Required member names of private link resource. + /// + + /// Required DNS zone names of the the private link resource. + /// + public ApplicationGatewayPrivateLinkResourceProperties(string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + + { + this.GroupId = groupId; + this.RequiredMembers = requiredMembers; + this.RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets group identifier of private link resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "groupId")] + public string GroupId {get; private set; } + + /// + /// Gets required member names of private link resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requiredMembers")] + public System.Collections.Generic.IList RequiredMembers {get; private set; } + + /// + /// Gets or sets required DNS zone names of the the private link resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requiredZoneNames")] + public System.Collections.Generic.IList RequiredZoneNames {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbe.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbe.cs index 7f72d76d955b..5268777538fe 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbe.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbe.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Probe of the application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayProbe : SubResource { /// @@ -32,63 +24,84 @@ public ApplicationGatewayProbe() /// /// Initializes a new instance of the ApplicationGatewayProbe class. /// - /// Resource ID. - /// The protocol used for the probe. Possible - /// values include: 'Http', 'Https', 'Tcp', 'Tls' - /// Host name to send the probe to. - /// Relative path of probe. Valid path starts from - /// '/'. Probe is sent to - /// <Protocol>://<host>:<port><path>. - /// The probing interval in seconds. This is the - /// time interval between two consecutive probes. Acceptable values are - /// from 1 second to 86400 seconds. - /// 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. - /// The probe retry count. Backend - /// server is marked down after consecutive probe failure count reaches - /// UnhealthyThreshold. Acceptable values are from 1 second to - /// 20. - /// Whether the host - /// header should be picked from the backend http settings. Default - /// value is false. - /// Whether the server - /// name indication should be picked from the backend settings for Tls - /// protocol. Default value is false. - /// Minimum number of servers that are always - /// marked healthy. Default value is 0. - /// Criterion for classifying a healthy probe - /// response. - /// The provisioning state of the probe - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Custom port which will be used for probing the - /// backend servers. The valid value ranges from 1 to 65535. In case - /// not set, port from http settings will be used. This property is - /// valid for Basic, Standard_v2 and WAF_v2 only. - /// Name of the probe that is unique within an - /// Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayProbe(string id = default(string), string protocol = default(string), string host = default(string), string path = default(string), int? interval = default(int?), int? timeout = default(int?), int? unhealthyThreshold = default(int?), bool? pickHostNameFromBackendHttpSettings = default(bool?), bool? pickHostNameFromBackendSettings = default(bool?), int? minServers = default(int?), ApplicationGatewayProbeHealthResponseMatch match = default(ApplicationGatewayProbeHealthResponseMatch), string provisioningState = default(string), int? port = default(int?), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the probe that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the probe resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The protocol used for the probe. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Host name to send the probe to. + /// + + /// Relative path of probe. Valid path starts from '/'. Probe is sent to + /// <Protocol>://<host>:<port><path>. + /// + + /// The probing interval in seconds. This is the time interval between two + /// consecutive probes. Acceptable values are from 1 second to 86400 seconds. + /// + + /// 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. + /// + + /// The probe retry count. Backend server is marked down after consecutive + /// probe failure count reaches UnhealthyThreshold. Acceptable values are from + /// 1 second to 20. + /// + + /// Whether the host header should be picked from the backend http settings. + /// Default value is false. + /// + + /// Whether the server name indication should be picked from the backend + /// settings for Tls protocol. Default value is false. + /// + + /// Minimum number of servers that are always marked healthy. Default value is + /// 0. + /// + + /// Criterion for classifying a healthy probe response. + /// + + /// Custom port which will be used for probing the backend servers. The valid + /// value ranges from 1 to 65535. In case not set, port from http settings will + /// be used. This property is valid for Basic, Standard_v2 and WAF_v2 only. + /// + public ApplicationGatewayProbe(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string protocol = default(string), string host = default(string), string path = default(string), int? interval = default(int?), int? timeout = default(int?), int? unhealthyThreshold = default(int?), bool? pickHostNameFromBackendHttpSettings = default(bool?), bool? pickHostNameFromBackendSettings = default(bool?), int? minServers = default(int?), ApplicationGatewayProbeHealthResponseMatch match = default(ApplicationGatewayProbeHealthResponseMatch), int? port = default(int?)) + + : base(id) { - Protocol = protocol; - Host = host; - Path = path; - Interval = interval; - Timeout = timeout; - UnhealthyThreshold = unhealthyThreshold; - PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; - PickHostNameFromBackendSettings = pickHostNameFromBackendSettings; - MinServers = minServers; - Match = match; - ProvisioningState = provisioningState; - Port = port; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Protocol = protocol; + this.Host = host; + this.Path = path; + this.Interval = interval; + this.Timeout = timeout; + this.UnhealthyThreshold = unhealthyThreshold; + this.PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + this.PickHostNameFromBackendSettings = pickHostNameFromBackendSettings; + this.MinServers = minServers; + this.Match = match; + this.Port = port; CustomInit(); } @@ -97,133 +110,138 @@ public ApplicationGatewayProbe() /// partial void CustomInit(); + /// - /// Gets or sets the protocol used for the probe. Possible values - /// include: 'Http', 'Https', 'Tcp', 'Tls' + /// Gets or sets name of the probe that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets host name to send the probe to. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.host")] - public string Host { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets relative path of probe. Valid path starts from '/'. - /// Probe is sent to - /// &lt;Protocol&gt;://&lt;host&gt;:&lt;port&gt;&lt;path&gt;. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the probing interval in seconds. This is the time - /// interval between two consecutive probes. Acceptable values are from - /// 1 second to 86400 seconds. + /// Gets the provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.interval")] - public int? Interval { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets 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. + /// Gets or sets the protocol used for the probe. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' /// - [JsonProperty(PropertyName = "properties.timeout")] - public int? Timeout { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets the probe retry count. Backend server is marked down - /// after consecutive probe failure count reaches UnhealthyThreshold. - /// Acceptable values are from 1 second to 20. + /// Gets or sets host name to send the probe to. /// - [JsonProperty(PropertyName = "properties.unhealthyThreshold")] - public int? UnhealthyThreshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.host")] + public string Host {get; set; } /// - /// Gets or sets whether the host header should be picked from the - /// backend http settings. Default value is false. + /// Gets or sets relative path of probe. Valid path starts from '/'. Probe is + /// sent to <Protocol>://<host>:<port><path>. /// - [JsonProperty(PropertyName = "properties.pickHostNameFromBackendHttpSettings")] - public bool? PickHostNameFromBackendHttpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] + public string Path {get; set; } /// - /// Gets or sets whether the server name indication should be picked - /// from the backend settings for Tls protocol. Default value is false. + /// Gets or sets the probing interval in seconds. This is the time interval + /// between two consecutive probes. Acceptable values are from 1 second to + /// 86400 seconds. /// - [JsonProperty(PropertyName = "properties.pickHostNameFromBackendSettings")] - public bool? PickHostNameFromBackendSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.interval")] + public int? Interval {get; set; } /// - /// Gets or sets minimum number of servers that are always marked - /// healthy. Default value is 0. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.minServers")] - public int? MinServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeout")] + public int? Timeout {get; set; } /// - /// Gets or sets criterion for classifying a healthy probe response. + /// Gets or sets the probe retry count. Backend server is marked down after + /// consecutive probe failure count reaches UnhealthyThreshold. Acceptable + /// values are from 1 second to 20. /// - [JsonProperty(PropertyName = "properties.match")] - public ApplicationGatewayProbeHealthResponseMatch Match { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.unhealthyThreshold")] + public int? UnhealthyThreshold {get; set; } /// - /// Gets the provisioning state of the probe resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets whether the host header should be picked from the backend http + /// settings. Default value is false. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pickHostNameFromBackendHttpSettings")] + public bool? PickHostNameFromBackendHttpSettings {get; set; } /// - /// Gets or sets custom port which will be used for probing the backend - /// servers. The valid value ranges from 1 to 65535. In case not set, - /// port from http settings will be used. This property is valid for - /// Basic, Standard_v2 and WAF_v2 only. + /// Gets or sets whether the server name indication should be picked from the + /// backend settings for Tls protocol. Default value is false. /// - [JsonProperty(PropertyName = "properties.port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pickHostNameFromBackendSettings")] + public bool? PickHostNameFromBackendSettings {get; set; } /// - /// Gets or sets name of the probe that is unique within an Application - /// Gateway. + /// Gets or sets minimum number of servers that are always marked healthy. + /// Default value is 0. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minServers")] + public int? MinServers {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets criterion for classifying a healthy probe response. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.match")] + public ApplicationGatewayProbeHealthResponseMatch Match {get; set; } /// - /// Gets type of the resource. + /// Gets or sets custom port which will be used for probing the backend + /// servers. The valid value ranges from 1 to 65535. In case not set, port from + /// http settings will be used. This property is valid for Basic, Standard_v2 + /// and WAF_v2 only. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + + + + + + + + + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 1) + if (this.Port < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 1); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbeHealthResponseMatch.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbeHealthResponseMatch.cs index 72dc5ee092cf..a89922a210b6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbeHealthResponseMatch.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbeHealthResponseMatch.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayProbeHealthResponseMatch { /// - /// Initializes a new instance of the - /// ApplicationGatewayProbeHealthResponseMatch class. + /// Initializes a new instance of the ApplicationGatewayProbeHealthResponseMatch class. /// public ApplicationGatewayProbeHealthResponseMatch() { @@ -30,17 +21,20 @@ public ApplicationGatewayProbeHealthResponseMatch() } /// - /// Initializes a new instance of the - /// ApplicationGatewayProbeHealthResponseMatch class. + /// Initializes a new instance of the ApplicationGatewayProbeHealthResponseMatch class. /// - /// Body that must be contained in the health - /// response. Default value is empty. - /// Allowed ranges of healthy status codes. - /// Default range of healthy status codes is 200-399. - public ApplicationGatewayProbeHealthResponseMatch(string body = default(string), IList statusCodes = default(IList)) + + /// Body that must be contained in the health response. Default value is empty. + /// + + /// Allowed ranges of healthy status codes. Default range of healthy status + /// codes is 200-399. + /// + public ApplicationGatewayProbeHealthResponseMatch(string body = default(string), System.Collections.Generic.IList statusCodes = default(System.Collections.Generic.IList)) + { - Body = body; - StatusCodes = statusCodes; + this.Body = body; + this.StatusCodes = statusCodes; CustomInit(); } @@ -49,19 +43,19 @@ public ApplicationGatewayProbeHealthResponseMatch() /// partial void CustomInit(); + /// - /// Gets or sets body that must be contained in the health response. - /// Default value is empty. + /// Gets or sets body that must be contained in the health response. Default + /// value is empty. /// - [JsonProperty(PropertyName = "body")] - public string Body { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "body")] + public string Body {get; set; } /// - /// Gets or sets allowed ranges of healthy status codes. Default range - /// of healthy status codes is 200-399. + /// Gets or sets allowed ranges of healthy status codes. Default range of + /// healthy status codes is 200-399. /// - [JsonProperty(PropertyName = "statusCodes")] - public IList StatusCodes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statusCodes")] + public System.Collections.Generic.IList StatusCodes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbePropertiesFormat.cs new file mode 100644 index 000000000000..fc904d4e3255 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProbePropertiesFormat.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of probe of an application gateway. + /// + public partial class ApplicationGatewayProbePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayProbePropertiesFormat class. + /// + public ApplicationGatewayProbePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayProbePropertiesFormat class. + /// + + /// The protocol used for the probe. + /// Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + + /// Host name to send the probe to. + /// + + /// Relative path of probe. Valid path starts from '/'. Probe is sent to + /// <Protocol>://<host>:<port><path>. + /// + + /// The probing interval in seconds. This is the time interval between two + /// consecutive probes. Acceptable values are from 1 second to 86400 seconds. + /// + + /// 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. + /// + + /// The probe retry count. Backend server is marked down after consecutive + /// probe failure count reaches UnhealthyThreshold. Acceptable values are from + /// 1 second to 20. + /// + + /// Whether the host header should be picked from the backend http settings. + /// Default value is false. + /// + + /// Whether the server name indication should be picked from the backend + /// settings for Tls protocol. Default value is false. + /// + + /// Minimum number of servers that are always marked healthy. Default value is + /// 0. + /// + + /// Criterion for classifying a healthy probe response. + /// + + /// The provisioning state of the probe resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Custom port which will be used for probing the backend servers. The valid + /// value ranges from 1 to 65535. In case not set, port from http settings will + /// be used. This property is valid for Basic, Standard_v2 and WAF_v2 only. + /// + public ApplicationGatewayProbePropertiesFormat(string protocol = default(string), string host = default(string), string path = default(string), int? interval = default(int?), int? timeout = default(int?), int? unhealthyThreshold = default(int?), bool? pickHostNameFromBackendHttpSettings = default(bool?), bool? pickHostNameFromBackendSettings = default(bool?), int? minServers = default(int?), ApplicationGatewayProbeHealthResponseMatch match = default(ApplicationGatewayProbeHealthResponseMatch), string provisioningState = default(string), int? port = default(int?)) + + { + this.Protocol = protocol; + this.Host = host; + this.Path = path; + this.Interval = interval; + this.Timeout = timeout; + this.UnhealthyThreshold = unhealthyThreshold; + this.PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + this.PickHostNameFromBackendSettings = pickHostNameFromBackendSettings; + this.MinServers = minServers; + this.Match = match; + this.ProvisioningState = provisioningState; + this.Port = port; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the protocol used for the probe. Possible values include: 'Http', 'Https', 'Tcp', 'Tls' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets host name to send the probe to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "host")] + public string Host {get; set; } + + /// + /// Gets or sets relative path of probe. Valid path starts from '/'. Probe is + /// sent to <Protocol>://<host>:<port><path>. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } + + /// + /// Gets or sets the probing interval in seconds. This is the time interval + /// between two consecutive probes. Acceptable values are from 1 second to + /// 86400 seconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "interval")] + public int? Interval {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeout")] + public int? Timeout {get; set; } + + /// + /// Gets or sets the probe retry count. Backend server is marked down after + /// consecutive probe failure count reaches UnhealthyThreshold. Acceptable + /// values are from 1 second to 20. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unhealthyThreshold")] + public int? UnhealthyThreshold {get; set; } + + /// + /// Gets or sets whether the host header should be picked from the backend http + /// settings. Default value is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pickHostNameFromBackendHttpSettings")] + public bool? PickHostNameFromBackendHttpSettings {get; set; } + + /// + /// Gets or sets whether the server name indication should be picked from the + /// backend settings for Tls protocol. Default value is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pickHostNameFromBackendSettings")] + public bool? PickHostNameFromBackendSettings {get; set; } + + /// + /// Gets or sets minimum number of servers that are always marked healthy. + /// Default value is 0. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minServers")] + public int? MinServers {get; set; } + + /// + /// Gets or sets criterion for classifying a healthy probe response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "match")] + public ApplicationGatewayProbeHealthResponseMatch Match {get; set; } + + /// + /// Gets the provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets custom port which will be used for probing the backend + /// servers. The valid value ranges from 1 to 65535. In case not set, port from + /// http settings will be used. This property is valid for Basic, Standard_v2 + /// and WAF_v2 only. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + if (this.Port != null) + { + if (this.Port > 65535) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (this.Port < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 1); + } + } + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPropertiesFormat.cs new file mode 100644 index 000000000000..1b9c9c5a2066 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayPropertiesFormat.cs @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the application gateway. + /// + public partial class ApplicationGatewayPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayPropertiesFormat class. + /// + public ApplicationGatewayPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayPropertiesFormat class. + /// + + /// SKU of the application gateway resource. + /// + + /// SSL policy of the application gateway resource. + /// + + /// Operational state of the application gateway resource. + /// Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' + + /// Subnets of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Authentication certificates of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Trusted Root certificates of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Trusted client certificates of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// SSL certificates of the application gateway resource. For default limits, + /// see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Frontend IP addresses of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Frontend ports of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Probes of the application gateway resource. + /// + + /// Backend address pool of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Backend http settings of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Backend settings of the application gateway resource. For default limits, + /// see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Http listeners of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Listeners of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// SSL profiles of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// URL path map of the application gateway resource. For default limits, see + /// [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Request routing rules of the application gateway resource. + /// + + /// Routing rules of the application gateway resource. + /// + + /// Rewrite rules for the application gateway resource. + /// + + /// Redirect configurations of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + + /// Web application firewall configuration. + /// + + /// Reference to the FirewallPolicy resource. + /// + + /// Whether HTTP2 is enabled on the application gateway resource. + /// + + /// Whether FIPS is enabled on the application gateway resource. + /// + + /// Autoscale Configuration. + /// + + /// PrivateLink configurations on application gateway. + /// + + /// Private Endpoint connections on application gateway. + /// + + /// The resource GUID property of the application gateway resource. + /// + + /// The provisioning state of the application gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Custom error configurations of the application gateway resource. + /// + + /// If true, associates a firewall policy with an application gateway + /// regardless whether the policy differs from the WAF Config. + /// + + /// Load distribution policies of the application gateway resource. + /// + + /// Global Configuration. + /// + + /// The default predefined SSL Policy applied on the application gateway + /// resource. + /// Possible values include: 'AppGwSslPolicy20150501', + /// 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', + /// 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + public ApplicationGatewayPropertiesFormat(ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), System.Collections.Generic.IList gatewayIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList trustedRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList trustedClientCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList sslCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList listeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList sslProfiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList routingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList rewriteRuleSets = default(System.Collections.Generic.IList), System.Collections.Generic.IList redirectConfigurations = default(System.Collections.Generic.IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), SubResource firewallPolicy = default(SubResource), bool? enableHttp2 = default(bool?), bool? enableFips = default(bool?), ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration = default(ApplicationGatewayAutoscaleConfiguration), System.Collections.Generic.IList privateLinkConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), System.Collections.Generic.IList customErrorConfigurations = default(System.Collections.Generic.IList), bool? forceFirewallPolicyAssociation = default(bool?), System.Collections.Generic.IList loadDistributionPolicies = default(System.Collections.Generic.IList), ApplicationGatewayGlobalConfiguration globalConfiguration = default(ApplicationGatewayGlobalConfiguration), string defaultPredefinedSslPolicy = default(string)) + + { + this.Sku = sku; + this.SslPolicy = sslPolicy; + this.OperationalState = operationalState; + this.GatewayIPConfigurations = gatewayIPConfigurations; + this.AuthenticationCertificates = authenticationCertificates; + this.TrustedRootCertificates = trustedRootCertificates; + this.TrustedClientCertificates = trustedClientCertificates; + this.SslCertificates = sslCertificates; + this.FrontendIPConfigurations = frontendIPConfigurations; + this.FrontendPorts = frontendPorts; + this.Probes = probes; + this.BackendAddressPools = backendAddressPools; + this.BackendHttpSettingsCollection = backendHttpSettingsCollection; + this.BackendSettingsCollection = backendSettingsCollection; + this.HttpListeners = httpListeners; + this.Listeners = listeners; + this.SslProfiles = sslProfiles; + this.UrlPathMaps = urlPathMaps; + this.RequestRoutingRules = requestRoutingRules; + this.RoutingRules = routingRules; + this.RewriteRuleSets = rewriteRuleSets; + this.RedirectConfigurations = redirectConfigurations; + this.WebApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + this.FirewallPolicy = firewallPolicy; + this.EnableHttp2 = enableHttp2; + this.EnableFips = enableFips; + this.AutoscaleConfiguration = autoscaleConfiguration; + this.PrivateLinkConfigurations = privateLinkConfigurations; + this.PrivateEndpointConnections = privateEndpointConnections; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.CustomErrorConfigurations = customErrorConfigurations; + this.ForceFirewallPolicyAssociation = forceFirewallPolicyAssociation; + this.LoadDistributionPolicies = loadDistributionPolicies; + this.GlobalConfiguration = globalConfiguration; + this.DefaultPredefinedSslPolicy = defaultPredefinedSslPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets sKU of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ApplicationGatewaySku Sku {get; set; } + + /// + /// Gets or sets sSL policy of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslPolicy")] + public ApplicationGatewaySslPolicy SslPolicy {get; set; } + + /// + /// Gets operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operationalState")] + public string OperationalState {get; private set; } + + /// + /// Gets or sets subnets of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayIPConfigurations")] + public System.Collections.Generic.IList GatewayIPConfigurations {get; set; } + + /// + /// Gets or sets authentication certificates of the application gateway + /// resource. For default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationCertificates")] + public System.Collections.Generic.IList AuthenticationCertificates {get; set; } + + /// + /// Gets or sets trusted Root certificates of the application gateway resource. + /// For default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trustedRootCertificates")] + public System.Collections.Generic.IList TrustedRootCertificates {get; set; } + + /// + /// Gets or sets trusted client certificates of the application gateway + /// resource. For default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trustedClientCertificates")] + public System.Collections.Generic.IList TrustedClientCertificates {get; set; } + + /// + /// Gets or sets sSL certificates of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslCertificates")] + public System.Collections.Generic.IList SslCertificates {get; set; } + + /// + /// Gets or sets frontend IP addresses of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } + + /// + /// Gets or sets frontend ports of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPorts")] + public System.Collections.Generic.IList FrontendPorts {get; set; } + + /// + /// Gets or sets probes of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probes")] + public System.Collections.Generic.IList Probes {get; set; } + + /// + /// Gets or sets backend address pool of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } + + /// + /// Gets or sets backend http settings of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettingsCollection")] + public System.Collections.Generic.IList BackendHttpSettingsCollection {get; set; } + + /// + /// Gets or sets backend settings of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendSettingsCollection")] + public System.Collections.Generic.IList BackendSettingsCollection {get; set; } + + /// + /// Gets or sets http listeners of the application gateway resource. For + /// default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "httpListeners")] + public System.Collections.Generic.IList HttpListeners {get; set; } + + /// + /// Gets or sets listeners of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "listeners")] + public System.Collections.Generic.IList Listeners {get; set; } + + /// + /// Gets or sets sSL profiles of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslProfiles")] + public System.Collections.Generic.IList SslProfiles {get; set; } + + /// + /// Gets or sets uRL path map of the application gateway resource. For default + /// limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "urlPathMaps")] + public System.Collections.Generic.IList UrlPathMaps {get; set; } + + /// + /// Gets or sets request routing rules of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestRoutingRules")] + public System.Collections.Generic.IList RequestRoutingRules {get; set; } + + /// + /// Gets or sets routing rules of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingRules")] + public System.Collections.Generic.IList RoutingRules {get; set; } + + /// + /// Gets or sets rewrite rules for the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rewriteRuleSets")] + public System.Collections.Generic.IList RewriteRuleSets {get; set; } + + /// + /// Gets or sets redirect configurations of the application gateway resource. + /// For default limits, see [Application Gateway + /// limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "redirectConfigurations")] + public System.Collections.Generic.IList RedirectConfigurations {get; set; } + + /// + /// Gets or sets web application firewall configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "webApplicationFirewallConfiguration")] + public ApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration {get; set; } + + /// + /// Gets or sets reference to the FirewallPolicy resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallPolicy")] + public SubResource FirewallPolicy {get; set; } + + /// + /// Gets or sets whether HTTP2 is enabled on the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableHttp2")] + public bool? EnableHttp2 {get; set; } + + /// + /// Gets or sets whether FIPS is enabled on the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFips")] + public bool? EnableFips {get; set; } + + /// + /// Gets or sets autoscale Configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoscaleConfiguration")] + public ApplicationGatewayAutoscaleConfiguration AutoscaleConfiguration {get; set; } + + /// + /// Gets or sets privateLink configurations on application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkConfigurations")] + public System.Collections.Generic.IList PrivateLinkConfigurations {get; set; } + + /// + /// Gets private Endpoint connections on application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } + + /// + /// Gets the resource GUID property of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the application gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets custom error configurations of the application gateway + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customErrorConfigurations")] + public System.Collections.Generic.IList CustomErrorConfigurations {get; set; } + + /// + /// Gets or sets if true, associates a firewall policy with an application + /// gateway regardless whether the policy differs from the WAF Config. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceFirewallPolicyAssociation")] + public bool? ForceFirewallPolicyAssociation {get; set; } + + /// + /// Gets or sets load distribution policies of the application gateway + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadDistributionPolicies")] + public System.Collections.Generic.IList LoadDistributionPolicies {get; set; } + + /// + /// Gets or sets global Configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "globalConfiguration")] + public ApplicationGatewayGlobalConfiguration GlobalConfiguration {get; set; } + + /// + /// Gets the default predefined SSL Policy applied on the application gateway + /// resource. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPredefinedSslPolicy")] + public string DefaultPredefinedSslPolicy {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + + + if (this.Probes != null) + { + foreach (var element in this.Probes) + { + if (element != null) + { + element.Validate(); + } + } + } + + if (this.BackendHttpSettingsCollection != null) + { + foreach (var element in this.BackendHttpSettingsCollection) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + + + if (this.RequestRoutingRules != null) + { + foreach (var element in this.RequestRoutingRules) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.RoutingRules != null) + { + foreach (var element in this.RoutingRules) + { + if (element != null) + { + element.Validate(); + } + } + } + + + if (this.WebApplicationFirewallConfiguration != null) + { + this.WebApplicationFirewallConfiguration.Validate(); + } + + if (this.AutoscaleConfiguration != null) + { + this.AutoscaleConfiguration.Validate(); + } + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProtocol.cs index 511aca701a2c..c79e054f93d4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,16 +9,16 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayProtocol. /// + + public static class ApplicationGatewayProtocol { /// - /// Supported for httpListeners and backendHttpSettingsCollection - /// properties. + /// Supported for httpListeners and backendHttpSettingsCollection properties. /// public const string Http = "Http"; /// - /// Supported for httpListeners and backendHttpSettingsCollection - /// properties. + /// Supported for httpListeners and backendHttpSettingsCollection properties. /// public const string Https = "Https"; /// @@ -35,4 +30,4 @@ public static class ApplicationGatewayProtocol /// public const string Tls = "Tls"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfiguration.cs index 5fdddb7f1bd0..39f5d13c4cdc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Redirect configuration of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayRedirectConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayRedirectConfiguration class. + /// Initializes a new instance of the ApplicationGatewayRedirectConfiguration class. /// public ApplicationGatewayRedirectConfiguration() { @@ -33,44 +22,60 @@ public ApplicationGatewayRedirectConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayRedirectConfiguration class. + /// Initializes a new instance of the ApplicationGatewayRedirectConfiguration class. /// - /// Resource ID. - /// HTTP redirection type. Possible values - /// include: 'Permanent', 'Found', 'SeeOther', 'Temporary' - /// Reference to a listener to redirect - /// the request to. - /// Url to redirect the request to. - /// Include path in the redirected - /// url. - /// Include query string in the - /// redirected url. - /// Request routing specifying - /// redirect configuration. - /// Url path maps specifying default redirect - /// configuration. - /// Path rules specifying redirect - /// configuration. - /// Name of the redirect configuration that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayRedirectConfiguration(string id = default(string), string redirectType = default(string), SubResource targetListener = default(SubResource), string targetUrl = default(string), bool? includePath = default(bool?), bool? includeQueryString = default(bool?), IList requestRoutingRules = default(IList), IList urlPathMaps = default(IList), IList pathRules = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the redirect configuration that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// HTTP redirection type. + /// Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' + + /// Reference to a listener to redirect the request to. + /// + + /// Url to redirect the request to. + /// + + /// Include path in the redirected url. + /// + + /// Include query string in the redirected url. + /// + + /// Request routing specifying redirect configuration. + /// + + /// Url path maps specifying default redirect configuration. + /// + + /// Path rules specifying redirect configuration. + /// + public ApplicationGatewayRedirectConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string redirectType = default(string), SubResource targetListener = default(SubResource), string targetUrl = default(string), bool? includePath = default(bool?), bool? includeQueryString = default(bool?), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList pathRules = default(System.Collections.Generic.IList)) + + : base(id) { - RedirectType = redirectType; - TargetListener = targetListener; - TargetUrl = targetUrl; - IncludePath = includePath; - IncludeQueryString = includeQueryString; - RequestRoutingRules = requestRoutingRules; - UrlPathMaps = urlPathMaps; - PathRules = pathRules; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.RedirectType = redirectType; + this.TargetListener = targetListener; + this.TargetUrl = targetUrl; + this.IncludePath = includePath; + this.IncludeQueryString = includeQueryString; + this.RequestRoutingRules = requestRoutingRules; + this.UrlPathMaps = urlPathMaps; + this.PathRules = pathRules; CustomInit(); } @@ -79,75 +84,73 @@ public ApplicationGatewayRedirectConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets HTTP redirection type. Possible values include: - /// 'Permanent', 'Found', 'SeeOther', 'Temporary' + /// Gets or sets name of the redirect configuration that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.redirectType")] - public string RedirectType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets reference to a listener to redirect the request to. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.targetListener")] - public SubResource TargetListener { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets url to redirect the request to. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.targetUrl")] - public string TargetUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets include path in the redirected url. + /// Gets or sets hTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' /// - [JsonProperty(PropertyName = "properties.includePath")] - public bool? IncludePath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.redirectType")] + public string RedirectType {get; set; } /// - /// Gets or sets include query string in the redirected url. + /// Gets or sets reference to a listener to redirect the request to. /// - [JsonProperty(PropertyName = "properties.includeQueryString")] - public bool? IncludeQueryString { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetListener")] + public SubResource TargetListener {get; set; } /// - /// Gets or sets request routing specifying redirect configuration. + /// Gets or sets url to redirect the request to. /// - [JsonProperty(PropertyName = "properties.requestRoutingRules")] - public IList RequestRoutingRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetUrl")] + public string TargetUrl {get; set; } /// - /// Gets or sets url path maps specifying default redirect - /// configuration. + /// Gets or sets include path in the redirected url. /// - [JsonProperty(PropertyName = "properties.urlPathMaps")] - public IList UrlPathMaps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.includePath")] + public bool? IncludePath {get; set; } /// - /// Gets or sets path rules specifying redirect configuration. + /// Gets or sets include query string in the redirected url. /// - [JsonProperty(PropertyName = "properties.pathRules")] - public IList PathRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.includeQueryString")] + public bool? IncludeQueryString {get; set; } /// - /// Gets or sets name of the redirect configuration that is unique - /// within an Application Gateway. + /// Gets or sets request routing specifying redirect configuration. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestRoutingRules")] + public System.Collections.Generic.IList RequestRoutingRules {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets url path maps specifying default redirect configuration. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMaps")] + public System.Collections.Generic.IList UrlPathMaps {get; set; } /// - /// Gets type of the resource. + /// Gets or sets path rules specifying redirect configuration. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pathRules")] + public System.Collections.Generic.IList PathRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..fb46d80d5995 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectConfigurationPropertiesFormat.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of redirect configuration of the application gateway. + /// + public partial class ApplicationGatewayRedirectConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayRedirectConfigurationPropertiesFormat class. + /// + public ApplicationGatewayRedirectConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayRedirectConfigurationPropertiesFormat class. + /// + + /// HTTP redirection type. + /// Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' + + /// Reference to a listener to redirect the request to. + /// + + /// Url to redirect the request to. + /// + + /// Include path in the redirected url. + /// + + /// Include query string in the redirected url. + /// + + /// Request routing specifying redirect configuration. + /// + + /// Url path maps specifying default redirect configuration. + /// + + /// Path rules specifying redirect configuration. + /// + public ApplicationGatewayRedirectConfigurationPropertiesFormat(string redirectType = default(string), SubResource targetListener = default(SubResource), string targetUrl = default(string), bool? includePath = default(bool?), bool? includeQueryString = default(bool?), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList pathRules = default(System.Collections.Generic.IList)) + + { + this.RedirectType = redirectType; + this.TargetListener = targetListener; + this.TargetUrl = targetUrl; + this.IncludePath = includePath; + this.IncludeQueryString = includeQueryString; + this.RequestRoutingRules = requestRoutingRules; + this.UrlPathMaps = urlPathMaps; + this.PathRules = pathRules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets hTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "redirectType")] + public string RedirectType {get; set; } + + /// + /// Gets or sets reference to a listener to redirect the request to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetListener")] + public SubResource TargetListener {get; set; } + + /// + /// Gets or sets url to redirect the request to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetUrl")] + public string TargetUrl {get; set; } + + /// + /// Gets or sets include path in the redirected url. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "includePath")] + public bool? IncludePath {get; set; } + + /// + /// Gets or sets include query string in the redirected url. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "includeQueryString")] + public bool? IncludeQueryString {get; set; } + + /// + /// Gets or sets request routing specifying redirect configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestRoutingRules")] + public System.Collections.Generic.IList RequestRoutingRules {get; set; } + + /// + /// Gets or sets url path maps specifying default redirect configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "urlPathMaps")] + public System.Collections.Generic.IList UrlPathMaps {get; set; } + + /// + /// Gets or sets path rules specifying redirect configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pathRules")] + public System.Collections.Generic.IList PathRules {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectType.cs index 4d6c51826b46..b07fb9c29bd5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRedirectType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayRedirectType. /// + + public static class ApplicationGatewayRedirectType { public const string Permanent = "Permanent"; @@ -21,4 +18,4 @@ public static class ApplicationGatewayRedirectType public const string SeeOther = "SeeOther"; public const string Temporary = "Temporary"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRule.cs index 3d12aaebb9d9..724c05afc12b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRule.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Request routing rule of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayRequestRoutingRule : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayRequestRoutingRule class. + /// Initializes a new instance of the ApplicationGatewayRequestRoutingRule class. /// public ApplicationGatewayRequestRoutingRule() { @@ -31,52 +22,68 @@ public ApplicationGatewayRequestRoutingRule() } /// - /// Initializes a new instance of the - /// ApplicationGatewayRequestRoutingRule class. - /// - /// Resource ID. - /// Rule type. Possible values include: 'Basic', - /// 'PathBasedRouting' - /// Priority of the request routing - /// rule. - /// Backend address pool resource of - /// the application gateway. - /// Backend http settings resource of - /// the application gateway. - /// Http listener resource of the - /// application gateway. - /// URL path map resource of the application - /// gateway. - /// Rewrite Rule Set resource in Basic - /// rule of the application gateway. - /// Redirect configuration resource - /// of the application gateway. - /// Load Distribution Policy - /// resource of the application gateway. - /// The provisioning state of the - /// request routing rule resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the request routing rule that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayRequestRoutingRule(string id = default(string), string ruleType = default(string), int? priority = default(int?), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource httpListener = default(SubResource), SubResource urlPathMap = default(SubResource), SubResource rewriteRuleSet = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource loadDistributionPolicy = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Initializes a new instance of the ApplicationGatewayRequestRoutingRule class. + /// + + /// Resource ID. + /// + + /// Name of the request routing rule that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the request routing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Rule type. + /// Possible values include: 'Basic', 'PathBasedRouting' + + /// Priority of the request routing rule. + /// + + /// Backend address pool resource of the application gateway. + /// + + /// Backend http settings resource of the application gateway. + /// + + /// Http listener resource of the application gateway. + /// + + /// URL path map resource of the application gateway. + /// + + /// Rewrite Rule Set resource in Basic rule of the application gateway. + /// + + /// Redirect configuration resource of the application gateway. + /// + + /// Load Distribution Policy resource of the application gateway. + /// + public ApplicationGatewayRequestRoutingRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string ruleType = default(string), int? priority = default(int?), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource httpListener = default(SubResource), SubResource urlPathMap = default(SubResource), SubResource rewriteRuleSet = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource loadDistributionPolicy = default(SubResource)) + + : base(id) { - RuleType = ruleType; - Priority = priority; - BackendAddressPool = backendAddressPool; - BackendHttpSettings = backendHttpSettings; - HttpListener = httpListener; - UrlPathMap = urlPathMap; - RewriteRuleSet = rewriteRuleSet; - RedirectConfiguration = redirectConfiguration; - LoadDistributionPolicy = loadDistributionPolicy; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.RuleType = ruleType; + this.Priority = priority; + this.BackendAddressPool = backendAddressPool; + this.BackendHttpSettings = backendHttpSettings; + this.HttpListener = httpListener; + this.UrlPathMap = urlPathMap; + this.RewriteRuleSet = rewriteRuleSet; + this.RedirectConfiguration = redirectConfiguration; + this.LoadDistributionPolicy = loadDistributionPolicy; CustomInit(); } @@ -85,113 +92,118 @@ public ApplicationGatewayRequestRoutingRule() /// partial void CustomInit(); + /// - /// Gets or sets rule type. Possible values include: 'Basic', - /// 'PathBasedRouting' + /// Gets or sets name of the request routing rule that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.ruleType")] - public string RuleType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets priority of the request routing rule. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets backend address pool resource of the application - /// gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets backend http settings resource of the application - /// gateway. + /// Gets the provisioning state of the request routing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.backendHttpSettings")] - public SubResource BackendHttpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets http listener resource of the application gateway. + /// Gets or sets rule type. Possible values include: 'Basic', 'PathBasedRouting' /// - [JsonProperty(PropertyName = "properties.httpListener")] - public SubResource HttpListener { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleType")] + public string RuleType {get; set; } /// - /// Gets or sets URL path map resource of the application gateway. + /// Gets or sets priority of the request routing rule. /// - [JsonProperty(PropertyName = "properties.urlPathMap")] - public SubResource UrlPathMap { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets rewrite Rule Set resource in Basic rule of the - /// application gateway. + /// Gets or sets backend address pool resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.rewriteRuleSet")] - public SubResource RewriteRuleSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// - /// Gets or sets redirect configuration resource of the application - /// gateway. + /// Gets or sets backend http settings resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.redirectConfiguration")] - public SubResource RedirectConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettings")] + public SubResource BackendHttpSettings {get; set; } /// - /// Gets or sets load Distribution Policy resource of the application - /// gateway. + /// Gets or sets http listener resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.loadDistributionPolicy")] - public SubResource LoadDistributionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListener")] + public SubResource HttpListener {get; set; } /// - /// Gets the provisioning state of the request routing rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets uRL path map resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMap")] + public SubResource UrlPathMap {get; set; } /// - /// Gets or sets name of the request routing rule that is unique within - /// an Application Gateway. + /// Gets or sets rewrite Rule Set resource in Basic rule of the application + /// gateway. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rewriteRuleSet")] + public SubResource RewriteRuleSet {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets redirect configuration resource of the application gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.redirectConfiguration")] + public SubResource RedirectConfiguration {get; set; } /// - /// Gets type of the resource. + /// Gets or sets load Distribution Policy resource of the application gateway. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistributionPolicy")] + public SubResource LoadDistributionPolicy {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority != null) + + + + + + if (this.Priority != null) { - if (Priority > 20000) + if (this.Priority > 20000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 20000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 20000); } - if (Priority < 1) + if (this.Priority < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); } } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRulePropertiesFormat.cs new file mode 100644 index 000000000000..1188ea1768ae --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRulePropertiesFormat.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of request routing rule of the application gateway. + /// + public partial class ApplicationGatewayRequestRoutingRulePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayRequestRoutingRulePropertiesFormat class. + /// + public ApplicationGatewayRequestRoutingRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayRequestRoutingRulePropertiesFormat class. + /// + + /// Rule type. + /// Possible values include: 'Basic', 'PathBasedRouting' + + /// Priority of the request routing rule. + /// + + /// Backend address pool resource of the application gateway. + /// + + /// Backend http settings resource of the application gateway. + /// + + /// Http listener resource of the application gateway. + /// + + /// URL path map resource of the application gateway. + /// + + /// Rewrite Rule Set resource in Basic rule of the application gateway. + /// + + /// Redirect configuration resource of the application gateway. + /// + + /// Load Distribution Policy resource of the application gateway. + /// + + /// The provisioning state of the request routing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayRequestRoutingRulePropertiesFormat(string ruleType = default(string), int? priority = default(int?), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource httpListener = default(SubResource), SubResource urlPathMap = default(SubResource), SubResource rewriteRuleSet = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource loadDistributionPolicy = default(SubResource), string provisioningState = default(string)) + + { + this.RuleType = ruleType; + this.Priority = priority; + this.BackendAddressPool = backendAddressPool; + this.BackendHttpSettings = backendHttpSettings; + this.HttpListener = httpListener; + this.UrlPathMap = urlPathMap; + this.RewriteRuleSet = rewriteRuleSet; + this.RedirectConfiguration = redirectConfiguration; + this.LoadDistributionPolicy = loadDistributionPolicy; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets rule type. Possible values include: 'Basic', 'PathBasedRouting' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleType")] + public string RuleType {get; set; } + + /// + /// Gets or sets priority of the request routing rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } + + /// + /// Gets or sets backend address pool resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + + /// + /// Gets or sets backend http settings resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettings")] + public SubResource BackendHttpSettings {get; set; } + + /// + /// Gets or sets http listener resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "httpListener")] + public SubResource HttpListener {get; set; } + + /// + /// Gets or sets uRL path map resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "urlPathMap")] + public SubResource UrlPathMap {get; set; } + + /// + /// Gets or sets rewrite Rule Set resource in Basic rule of the application + /// gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rewriteRuleSet")] + public SubResource RewriteRuleSet {get; set; } + + /// + /// Gets or sets redirect configuration resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "redirectConfiguration")] + public SubResource RedirectConfiguration {get; set; } + + /// + /// Gets or sets load Distribution Policy resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadDistributionPolicy")] + public SubResource LoadDistributionPolicy {get; set; } + + /// + /// Gets the provisioning state of the request routing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.Priority != null) + { + if (this.Priority > 20000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 20000); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs index e3905f82c3ef..15c8b53a4869 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayRequestRoutingRuleType. /// + + public static class ApplicationGatewayRequestRoutingRuleType { public const string Basic = "Basic"; public const string PathBasedRouting = "PathBasedRouting"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRule.cs index 25ea1a2608b7..60ce21592d39 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayRewriteRule { /// - /// Initializes a new instance of the ApplicationGatewayRewriteRule - /// class. + /// Initializes a new instance of the ApplicationGatewayRewriteRule class. /// public ApplicationGatewayRewriteRule() { @@ -30,24 +21,28 @@ public ApplicationGatewayRewriteRule() } /// - /// Initializes a new instance of the ApplicationGatewayRewriteRule - /// class. + /// Initializes a new instance of the ApplicationGatewayRewriteRule class. /// - /// Name of the rewrite rule that is unique within - /// an Application Gateway. - /// Rule Sequence of the rewrite rule that - /// determines the order of execution of a particular rule in a - /// RewriteRuleSet. - /// Conditions based on which the action set - /// execution will be evaluated. - /// Set of actions to be done as part of the - /// rewrite Rule. - public ApplicationGatewayRewriteRule(string name = default(string), int? ruleSequence = default(int?), IList conditions = default(IList), ApplicationGatewayRewriteRuleActionSet actionSet = default(ApplicationGatewayRewriteRuleActionSet)) + + /// Name of the rewrite rule that is unique within an Application Gateway. + /// + + /// Rule Sequence of the rewrite rule that determines the order of execution of + /// a particular rule in a RewriteRuleSet. + /// + + /// Conditions based on which the action set execution will be evaluated. + /// + + /// Set of actions to be done as part of the rewrite Rule. + /// + public ApplicationGatewayRewriteRule(string name = default(string), int? ruleSequence = default(int?), System.Collections.Generic.IList conditions = default(System.Collections.Generic.IList), ApplicationGatewayRewriteRuleActionSet actionSet = default(ApplicationGatewayRewriteRuleActionSet)) + { - Name = name; - RuleSequence = ruleSequence; - Conditions = conditions; - ActionSet = actionSet; + this.Name = name; + this.RuleSequence = ruleSequence; + this.Conditions = conditions; + this.ActionSet = actionSet; CustomInit(); } @@ -56,32 +51,32 @@ public ApplicationGatewayRewriteRule() /// partial void CustomInit(); + /// - /// Gets or sets name of the rewrite rule that is unique within an - /// Application Gateway. + /// Gets or sets name of the rewrite rule that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets rule Sequence of the rewrite rule that determines the - /// order of execution of a particular rule in a RewriteRuleSet. + /// Gets or sets rule Sequence of the rewrite rule that determines the order of + /// execution of a particular rule in a RewriteRuleSet. /// - [JsonProperty(PropertyName = "ruleSequence")] - public int? RuleSequence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSequence")] + public int? RuleSequence {get; set; } /// - /// Gets or sets conditions based on which the action set execution - /// will be evaluated. + /// Gets or sets conditions based on which the action set execution will be + /// evaluated. /// - [JsonProperty(PropertyName = "conditions")] - public IList Conditions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "conditions")] + public System.Collections.Generic.IList Conditions {get; set; } /// /// Gets or sets set of actions to be done as part of the rewrite Rule. /// - [JsonProperty(PropertyName = "actionSet")] - public ApplicationGatewayRewriteRuleActionSet ActionSet { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actionSet")] + public ApplicationGatewayRewriteRuleActionSet ActionSet {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleActionSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleActionSet.cs index f06fa95e1c89..51c9b51b4574 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleActionSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleActionSet.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayRewriteRuleActionSet { /// - /// Initializes a new instance of the - /// ApplicationGatewayRewriteRuleActionSet class. + /// Initializes a new instance of the ApplicationGatewayRewriteRuleActionSet class. /// public ApplicationGatewayRewriteRuleActionSet() { @@ -30,20 +21,23 @@ public ApplicationGatewayRewriteRuleActionSet() } /// - /// Initializes a new instance of the - /// ApplicationGatewayRewriteRuleActionSet class. + /// Initializes a new instance of the ApplicationGatewayRewriteRuleActionSet class. /// - /// Request Header Actions in - /// the Action Set. - /// Response Header Actions - /// in the Action Set. - /// Url Configuration Action in the - /// Action Set. - public ApplicationGatewayRewriteRuleActionSet(IList requestHeaderConfigurations = default(IList), IList responseHeaderConfigurations = default(IList), ApplicationGatewayUrlConfiguration urlConfiguration = default(ApplicationGatewayUrlConfiguration)) + + /// Request Header Actions in the Action Set. + /// + + /// Response Header Actions in the Action Set. + /// + + /// Url Configuration Action in the Action Set. + /// + public ApplicationGatewayRewriteRuleActionSet(System.Collections.Generic.IList requestHeaderConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList responseHeaderConfigurations = default(System.Collections.Generic.IList), ApplicationGatewayUrlConfiguration urlConfiguration = default(ApplicationGatewayUrlConfiguration)) + { - RequestHeaderConfigurations = requestHeaderConfigurations; - ResponseHeaderConfigurations = responseHeaderConfigurations; - UrlConfiguration = urlConfiguration; + this.RequestHeaderConfigurations = requestHeaderConfigurations; + this.ResponseHeaderConfigurations = responseHeaderConfigurations; + this.UrlConfiguration = urlConfiguration; CustomInit(); } @@ -52,23 +46,23 @@ public ApplicationGatewayRewriteRuleActionSet() /// partial void CustomInit(); + /// /// Gets or sets request Header Actions in the Action Set. /// - [JsonProperty(PropertyName = "requestHeaderConfigurations")] - public IList RequestHeaderConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestHeaderConfigurations")] + public System.Collections.Generic.IList RequestHeaderConfigurations {get; set; } /// /// Gets or sets response Header Actions in the Action Set. /// - [JsonProperty(PropertyName = "responseHeaderConfigurations")] - public IList ResponseHeaderConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "responseHeaderConfigurations")] + public System.Collections.Generic.IList ResponseHeaderConfigurations {get; set; } /// /// Gets or sets url Configuration Action in the Action Set. /// - [JsonProperty(PropertyName = "urlConfiguration")] - public ApplicationGatewayUrlConfiguration UrlConfiguration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "urlConfiguration")] + public ApplicationGatewayUrlConfiguration UrlConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleCondition.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleCondition.cs index 1813a7225874..02f9ff1a9427 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleCondition.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleCondition.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayRewriteRuleCondition { /// - /// Initializes a new instance of the - /// ApplicationGatewayRewriteRuleCondition class. + /// Initializes a new instance of the ApplicationGatewayRewriteRuleCondition class. /// public ApplicationGatewayRewriteRuleCondition() { @@ -28,24 +21,30 @@ public ApplicationGatewayRewriteRuleCondition() } /// - /// Initializes a new instance of the - /// ApplicationGatewayRewriteRuleCondition class. + /// Initializes a new instance of the ApplicationGatewayRewriteRuleCondition class. /// - /// The condition parameter of the - /// RewriteRuleCondition. - /// The pattern, either fixed string or regular - /// expression, that evaluates the truthfulness of the - /// condition. - /// Setting this parameter to truth value with - /// force the pattern to do a case in-sensitive comparison. - /// Setting this value as truth will force to - /// check the negation of the condition given by the user. + + /// The condition parameter of the RewriteRuleCondition. + /// + + /// The pattern, either fixed string or regular expression, that evaluates the + /// truthfulness of the condition. + /// + + /// Setting this parameter to truth value with force the pattern to do a case + /// in-sensitive comparison. + /// + + /// Setting this value as truth will force to check the negation of the + /// condition given by the user. + /// public ApplicationGatewayRewriteRuleCondition(string variable = default(string), string pattern = default(string), bool? ignoreCase = default(bool?), bool? negate = default(bool?)) + { - Variable = variable; - Pattern = pattern; - IgnoreCase = ignoreCase; - Negate = negate; + this.Variable = variable; + this.Pattern = pattern; + this.IgnoreCase = ignoreCase; + this.Negate = negate; CustomInit(); } @@ -54,32 +53,32 @@ public ApplicationGatewayRewriteRuleCondition() /// partial void CustomInit(); + /// /// Gets or sets the condition parameter of the RewriteRuleCondition. /// - [JsonProperty(PropertyName = "variable")] - public string Variable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "variable")] + public string Variable {get; set; } /// - /// Gets or sets the pattern, either fixed string or regular - /// expression, that evaluates the truthfulness of the condition. + /// Gets or sets the pattern, either fixed string or regular expression, that + /// evaluates the truthfulness of the condition. /// - [JsonProperty(PropertyName = "pattern")] - public string Pattern { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pattern")] + public string Pattern {get; set; } /// - /// Gets or sets setting this parameter to truth value with force the - /// pattern to do a case in-sensitive comparison. + /// Gets or sets setting this parameter to truth value with force the pattern + /// to do a case in-sensitive comparison. /// - [JsonProperty(PropertyName = "ignoreCase")] - public bool? IgnoreCase { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ignoreCase")] + public bool? IgnoreCase {get; set; } /// - /// Gets or sets setting this value as truth will force to check the - /// negation of the condition given by the user. + /// Gets or sets setting this value as truth will force to check the negation + /// of the condition given by the user. /// - [JsonProperty(PropertyName = "negate")] - public bool? Negate { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "negate")] + public bool? Negate {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSet.cs index 09af59dbb69e..0b07300ad850 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSet.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Rewrite rule set of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayRewriteRuleSet : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayRewriteRuleSet - /// class. + /// Initializes a new instance of the ApplicationGatewayRewriteRuleSet class. /// public ApplicationGatewayRewriteRuleSet() { @@ -33,26 +22,31 @@ public ApplicationGatewayRewriteRuleSet() } /// - /// Initializes a new instance of the ApplicationGatewayRewriteRuleSet - /// class. + /// Initializes a new instance of the ApplicationGatewayRewriteRuleSet class. /// - /// Resource ID. - /// Rewrite rules in the rewrite rule - /// set. - /// The provisioning state of the - /// rewrite rule set resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the rewrite rule set that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ApplicationGatewayRewriteRuleSet(string id = default(string), IList rewriteRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the rewrite rule set that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the rewrite rule set resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Rewrite rules in the rewrite rule set. + /// + public ApplicationGatewayRewriteRuleSet(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList rewriteRules = default(System.Collections.Generic.IList)) + + : base(id) { - RewriteRules = rewriteRules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.RewriteRules = rewriteRules; CustomInit(); } @@ -61,33 +55,31 @@ public ApplicationGatewayRewriteRuleSet() /// partial void CustomInit(); + /// - /// Gets or sets rewrite rules in the rewrite rule set. + /// Gets or sets name of the rewrite rule set that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.rewriteRules")] - public IList RewriteRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the rewrite rule set resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of the rewrite rule set that is unique within an - /// Application Gateway. + /// Gets the provisioning state of the rewrite rule set resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets rewrite rules in the rewrite rule set. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rewriteRules")] + public System.Collections.Generic.IList RewriteRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSetPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSetPropertiesFormat.cs new file mode 100644 index 000000000000..45796ce8cedc --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRewriteRuleSetPropertiesFormat.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of rewrite rule set of the application gateway. + /// + public partial class ApplicationGatewayRewriteRuleSetPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayRewriteRuleSetPropertiesFormat class. + /// + public ApplicationGatewayRewriteRuleSetPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayRewriteRuleSetPropertiesFormat class. + /// + + /// Rewrite rules in the rewrite rule set. + /// + + /// The provisioning state of the rewrite rule set resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayRewriteRuleSetPropertiesFormat(System.Collections.Generic.IList rewriteRules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.RewriteRules = rewriteRules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets rewrite rules in the rewrite rule set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rewriteRules")] + public System.Collections.Generic.IList RewriteRules {get; set; } + + /// + /// Gets the provisioning state of the rewrite rule set resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRule.cs index 0ee6961dd24a..744641949336 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRule.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Routing rule of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayRoutingRule : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayRoutingRule - /// class. + /// Initializes a new instance of the ApplicationGatewayRoutingRule class. /// public ApplicationGatewayRoutingRule() { @@ -31,39 +22,51 @@ public ApplicationGatewayRoutingRule() } /// - /// Initializes a new instance of the ApplicationGatewayRoutingRule - /// class. + /// Initializes a new instance of the ApplicationGatewayRoutingRule class. /// - /// Priority of the routing rule. - /// Resource ID. - /// Rule type. Possible values include: 'Basic', - /// 'PathBasedRouting' - /// Backend address pool resource of - /// the application gateway. - /// Backend settings resource of the - /// application gateway. - /// Listener resource of the application - /// gateway. - /// The provisioning state of the - /// request routing rule resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the routing rule that is unique within - /// an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayRoutingRule(int priority, string id = default(string), string ruleType = default(string), SubResource backendAddressPool = default(SubResource), SubResource backendSettings = default(SubResource), SubResource listener = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the routing rule that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the request routing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Rule type. + /// Possible values include: 'Basic', 'PathBasedRouting' + + /// Priority of the routing rule. + /// + + /// Backend address pool resource of the application gateway. + /// + + /// Backend settings resource of the application gateway. + /// + + /// Listener resource of the application gateway. + /// + public ApplicationGatewayRoutingRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string ruleType = default(string), int? priority = default(int?), SubResource backendAddressPool = default(SubResource), SubResource backendSettings = default(SubResource), SubResource listener = default(SubResource)) + + : base(id) { - RuleType = ruleType; - Priority = priority; - BackendAddressPool = backendAddressPool; - BackendSettings = backendSettings; - Listener = listener; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.RuleType = ruleType; + this.Priority = priority; + this.BackendAddressPool = backendAddressPool; + this.BackendSettings = backendSettings; + this.Listener = listener; CustomInit(); } @@ -72,82 +75,89 @@ public ApplicationGatewayRoutingRule() /// partial void CustomInit(); + /// - /// Gets or sets rule type. Possible values include: 'Basic', - /// 'PathBasedRouting' + /// Gets or sets name of the routing rule that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.ruleType")] - public string RuleType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets priority of the routing rule. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets backend address pool resource of the application - /// gateway. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets backend settings resource of the application gateway. + /// Gets the provisioning state of the request routing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.backendSettings")] - public SubResource BackendSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets listener resource of the application gateway. + /// Gets or sets rule type. Possible values include: 'Basic', 'PathBasedRouting' /// - [JsonProperty(PropertyName = "properties.listener")] - public SubResource Listener { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleType")] + public string RuleType {get; set; } /// - /// Gets the provisioning state of the request routing rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets priority of the routing rule. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets name of the routing rule that is unique within an - /// Application Gateway. + /// Gets or sets backend address pool resource of the application gateway. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets backend settings resource of the application gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendSettings")] + public SubResource BackendSettings {get; set; } /// - /// Gets type of the resource. + /// Gets or sets listener resource of the application gateway. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.listener")] + public SubResource Listener {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority > 20000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 20000); - } - if (Priority < 1) + + + + + + if (this.Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + if (this.Priority > 20000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 20000); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRulePropertiesFormat.cs new file mode 100644 index 000000000000..c1dcbeeb735a --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRoutingRulePropertiesFormat.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of routing rule of the application gateway. + /// + public partial class ApplicationGatewayRoutingRulePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayRoutingRulePropertiesFormat class. + /// + public ApplicationGatewayRoutingRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayRoutingRulePropertiesFormat class. + /// + + /// Rule type. + /// Possible values include: 'Basic', 'PathBasedRouting' + + /// Priority of the routing rule. + /// + + /// Backend address pool resource of the application gateway. + /// + + /// Backend settings resource of the application gateway. + /// + + /// Listener resource of the application gateway. + /// + + /// The provisioning state of the request routing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayRoutingRulePropertiesFormat(int priority, string ruleType = default(string), SubResource backendAddressPool = default(SubResource), SubResource backendSettings = default(SubResource), SubResource listener = default(SubResource), string provisioningState = default(string)) + + { + this.RuleType = ruleType; + this.Priority = priority; + this.BackendAddressPool = backendAddressPool; + this.BackendSettings = backendSettings; + this.Listener = listener; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets rule type. Possible values include: 'Basic', 'PathBasedRouting' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleType")] + public string RuleType {get; set; } + + /// + /// Gets or sets priority of the routing rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int Priority {get; set; } + + /// + /// Gets or sets backend address pool resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + + /// + /// Gets or sets backend settings resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendSettings")] + public SubResource BackendSettings {get; set; } + + /// + /// Gets or sets listener resource of the application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "listener")] + public SubResource Listener {get; set; } + + /// + /// Gets the provisioning state of the request routing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.Priority > 20000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 20000); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRuleSetStatusOptions.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRuleSetStatusOptions.cs index d1ce92416891..d4043e30ed0b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRuleSetStatusOptions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayRuleSetStatusOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayRuleSetStatusOptions. /// + + public static class ApplicationGatewayRuleSetStatusOptions { public const string Preview = "Preview"; @@ -21,4 +18,4 @@ public static class ApplicationGatewayRuleSetStatusOptions public const string Supported = "Supported"; public const string Deprecated = "Deprecated"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySku.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySku.cs index ba5bf2f7bd44..d73a923ef4ce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,24 @@ public ApplicationGatewaySku() /// /// Initializes a new instance of the ApplicationGatewaySku class. /// - /// Name of an application gateway SKU. Possible - /// values include: 'Standard_Small', 'Standard_Medium', - /// 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', - /// 'WAF_v2', 'Basic' - /// Tier of an application gateway. Possible values - /// include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2', - /// 'Basic' - /// Capacity (instance count) of an application - /// gateway. + + /// Name of an application gateway SKU. + /// Possible values include: 'Standard_Small', 'Standard_Medium', + /// 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2', + /// 'Basic' + + /// Tier of an application gateway. + /// Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2', + /// 'Basic' + + /// Capacity (instance count) of an application gateway. + /// public ApplicationGatewaySku(string name = default(string), string tier = default(string), int? capacity = default(int?)) + { - Name = name; - Tier = tier; - Capacity = capacity; + this.Name = name; + this.Tier = tier; + this.Capacity = capacity; CustomInit(); } @@ -51,26 +49,23 @@ public ApplicationGatewaySku() /// partial void CustomInit(); + /// - /// Gets or sets name of an application gateway SKU. Possible values - /// include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - /// 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2', 'Basic' + /// Gets or sets name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2', 'Basic' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets tier of an application gateway. Possible values - /// include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2', 'Basic' + /// Gets or sets tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2', 'Basic' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } /// /// Gets or sets capacity (instance count) of an application gateway. /// - [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public int? Capacity {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySkuName.cs index ad969b426d97..83542c3ef2e7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewaySkuName. /// + + public static class ApplicationGatewaySkuName { public const string StandardSmall = "Standard_Small"; @@ -25,4 +22,4 @@ public static class ApplicationGatewaySkuName public const string WAFV2 = "WAF_v2"; public const string Basic = "Basic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificate.cs index c0f5ee27bd9d..8dd88a379705 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// SSL certificates of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewaySslCertificate : SubResource { /// - /// Initializes a new instance of the ApplicationGatewaySslCertificate - /// class. + /// Initializes a new instance of the ApplicationGatewaySslCertificate class. /// public ApplicationGatewaySslCertificate() { @@ -31,39 +22,50 @@ public ApplicationGatewaySslCertificate() } /// - /// Initializes a new instance of the ApplicationGatewaySslCertificate - /// class. + /// Initializes a new instance of the ApplicationGatewaySslCertificate class. /// - /// Resource ID. - /// Base-64 encoded pfx certificate. Only applicable - /// in PUT Request. - /// Password for the pfx file specified in data. - /// Only applicable in PUT request. - /// Base-64 encoded Public cert data - /// corresponding to pfx specified in data. Only applicable in GET - /// request. - /// Secret Id of (base-64 encoded - /// unencrypted pfx) 'Secret' or 'Certificate' object stored in - /// KeyVault. - /// The provisioning state of the SSL - /// certificate resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the SSL certificate that is unique - /// within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewaySslCertificate(string id = default(string), string data = default(string), string password = default(string), string publicCertData = default(string), string keyVaultSecretId = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the SSL certificate that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the SSL certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Base-64 encoded pfx certificate. Only applicable in PUT Request. + /// + + /// Password for the pfx file specified in data. Only applicable in PUT + /// request. + /// + + /// Base-64 encoded Public cert data corresponding to pfx specified in data. + /// Only applicable in GET request. + /// + + /// Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + /// object stored in KeyVault. + /// + public ApplicationGatewaySslCertificate(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string data = default(string), string password = default(string), string publicCertData = default(string), string keyVaultSecretId = default(string)) + + : base(id) { - Data = data; - Password = password; - PublicCertData = publicCertData; - KeyVaultSecretId = keyVaultSecretId; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Data = data; + this.Password = password; + this.PublicCertData = publicCertData; + this.KeyVaultSecretId = keyVaultSecretId; CustomInit(); } @@ -72,61 +74,59 @@ public ApplicationGatewaySslCertificate() /// partial void CustomInit(); + /// - /// Gets or sets base-64 encoded pfx certificate. Only applicable in - /// PUT Request. + /// Gets or sets name of the SSL certificate that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.data")] - public string Data { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets password for the pfx file specified in data. Only - /// applicable in PUT request. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets base-64 encoded Public cert data corresponding to pfx - /// specified in data. Only applicable in GET request. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.publicCertData")] - public string PublicCertData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) - /// 'Secret' or 'Certificate' object stored in KeyVault. + /// Gets the provisioning state of the SSL certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.keyVaultSecretId")] - public string KeyVaultSecretId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the SSL certificate resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets base-64 encoded pfx certificate. Only applicable in PUT + /// Request. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] + public string Data {get; set; } /// - /// Gets or sets name of the SSL certificate that is unique within an - /// Application Gateway. + /// Gets or sets password for the pfx file specified in data. Only applicable + /// in PUT request. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.password")] + public string Password {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets base-64 encoded Public cert data corresponding to pfx specified in + /// data. Only applicable in GET request. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicCertData")] + public string PublicCertData {get; private set; } /// - /// Gets type of the resource. + /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + /// 'Certificate' object stored in KeyVault. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultSecretId")] + public string KeyVaultSecretId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificatePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificatePropertiesFormat.cs new file mode 100644 index 000000000000..f033b75bf25b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCertificatePropertiesFormat.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of SSL certificates of an application gateway. + /// + public partial class ApplicationGatewaySslCertificatePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewaySslCertificatePropertiesFormat class. + /// + public ApplicationGatewaySslCertificatePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewaySslCertificatePropertiesFormat class. + /// + + /// Base-64 encoded pfx certificate. Only applicable in PUT Request. + /// + + /// Password for the pfx file specified in data. Only applicable in PUT + /// request. + /// + + /// Base-64 encoded Public cert data corresponding to pfx specified in data. + /// Only applicable in GET request. + /// + + /// Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + /// object stored in KeyVault. + /// + + /// The provisioning state of the SSL certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewaySslCertificatePropertiesFormat(string data = default(string), string password = default(string), string publicCertData = default(string), string keyVaultSecretId = default(string), string provisioningState = default(string)) + + { + this.Data = data; + this.Password = password; + this.PublicCertData = publicCertData; + this.KeyVaultSecretId = keyVaultSecretId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets base-64 encoded pfx certificate. Only applicable in PUT + /// Request. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public string Data {get; set; } + + /// + /// Gets or sets password for the pfx file specified in data. Only applicable + /// in PUT request. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + public string Password {get; set; } + + /// + /// Gets base-64 encoded Public cert data corresponding to pfx specified in + /// data. Only applicable in GET request. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicCertData")] + public string PublicCertData {get; private set; } + + /// + /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + /// 'Certificate' object stored in KeyVault. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultSecretId")] + public string KeyVaultSecretId {get; set; } + + /// + /// Gets the provisioning state of the SSL certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCipherSuite.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCipherSuite.cs index ad5f17e82f61..fab3d5f7fe3b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCipherSuite.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslCipherSuite.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,35 +9,37 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewaySslCipherSuite. /// + + public static class ApplicationGatewaySslCipherSuite { - public const string TLSECDHERSAWITHAES256CBCSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"; - public const string TLSECDHERSAWITHAES128CBCSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"; - public const string TLSECDHERSAWITHAES256CBCSHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"; - public const string TLSECDHERSAWITHAES128CBCSHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"; - public const string TLSDHERSAWITHAES256GCMSHA384 = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"; - public const string TLSDHERSAWITHAES128GCMSHA256 = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"; - public const string TLSDHERSAWITHAES256CBCSHA = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"; - public const string TLSDHERSAWITHAES128CBCSHA = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"; - public const string TLSRSAWITHAES256GCMSHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384"; - public const string TLSRSAWITHAES128GCMSHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256"; - public const string TLSRSAWITHAES256CBCSHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256"; - public const string TLSRSAWITHAES128CBCSHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256"; - public const string TLSRSAWITHAES256CBCSHA = "TLS_RSA_WITH_AES_256_CBC_SHA"; - public const string TLSRSAWITHAES128CBCSHA = "TLS_RSA_WITH_AES_128_CBC_SHA"; - public const string TLSECDHEECDSAWITHAES256GCMSHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"; - public const string TLSECDHEECDSAWITHAES128GCMSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"; - public const string TLSECDHEECDSAWITHAES256CBCSHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"; - public const string TLSECDHEECDSAWITHAES128CBCSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"; - public const string TLSECDHEECDSAWITHAES256CBCSHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"; - public const string TLSECDHEECDSAWITHAES128CBCSHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"; - public const string TLSDHEDSSWITHAES256CBCSHA256 = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"; - public const string TLSDHEDSSWITHAES128CBCSHA256 = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"; - public const string TLSDHEDSSWITHAES256CBCSHA = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"; - public const string TLSDHEDSSWITHAES128CBCSHA = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"; - public const string TLSRSAWITH3DESEDECBCSHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA"; - public const string TLSDHEDSSWITH3DESEDECBCSHA = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"; - public const string TLSECDHERSAWITHAES128GCMSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"; - public const string TLSECDHERSAWITHAES256GCMSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"; + public const string TLSEcdheRSAWithAES256CBCSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"; + public const string TLSEcdheRSAWithAES128CBCSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"; + public const string TLSEcdheRSAWithAES256CBCSHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"; + public const string TLSEcdheRSAWithAES128CBCSHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"; + public const string TLSDHERSAWithAES256GCMSHA384 = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"; + public const string TLSDHERSAWithAES128GCMSHA256 = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"; + public const string TLSDHERSAWithAES256CBCSHA = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"; + public const string TLSDHERSAWithAES128CBCSHA = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"; + public const string TLSRSAWithAES256GCMSHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384"; + public const string TLSRSAWithAES128GCMSHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256"; + public const string TLSRSAWithAES256CBCSHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256"; + public const string TLSRSAWithAES128CBCSHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256"; + public const string TLSRSAWithAES256CBCSHA = "TLS_RSA_WITH_AES_256_CBC_SHA"; + public const string TLSRSAWithAES128CBCSHA = "TLS_RSA_WITH_AES_128_CBC_SHA"; + public const string TLSEcdheEcdsaWithAES256GCMSHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"; + public const string TLSEcdheEcdsaWithAES128GCMSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"; + public const string TLSEcdheEcdsaWithAES256CBCSHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"; + public const string TLSEcdheEcdsaWithAES128CBCSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"; + public const string TLSEcdheEcdsaWithAES256CBCSHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"; + public const string TLSEcdheEcdsaWithAES128CBCSHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"; + public const string TLSDHEDSSWithAES256CBCSHA256 = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"; + public const string TLSDHEDSSWithAES128CBCSHA256 = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"; + public const string TLSDHEDSSWithAES256CBCSHA = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"; + public const string TLSDHEDSSWithAES128CBCSHA = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"; + public const string TLSRSAWith3DESEDECBCSHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA"; + public const string TLSDHEDSSWith3DESEDECBCSHA = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"; + public const string TLSEcdheRSAWithAES128GCMSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"; + public const string TLSEcdheRSAWithAES256GCMSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicy.cs index 0147cb07632f..6618e4fb5eee 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicy.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewaySslPolicy { /// - /// Initializes a new instance of the ApplicationGatewaySslPolicy - /// class. + /// Initializes a new instance of the ApplicationGatewaySslPolicy class. /// public ApplicationGatewaySslPolicy() { @@ -30,29 +21,34 @@ public ApplicationGatewaySslPolicy() } /// - /// Initializes a new instance of the ApplicationGatewaySslPolicy - /// class. + /// Initializes a new instance of the ApplicationGatewaySslPolicy class. /// - /// Ssl protocols to be disabled on - /// application gateway. - /// Type of Ssl Policy. Possible values - /// include: 'Predefined', 'Custom', 'CustomV2' - /// Name of Ssl predefined policy. Possible - /// values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', - /// 'AppGwSslPolicy20220101S' - /// Ssl cipher suites to be enabled in the - /// specified order to application gateway. - /// Minimum version of Ssl protocol to - /// be supported on application gateway. Possible values include: - /// 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' - public ApplicationGatewaySslPolicy(IList disabledSslProtocols = default(IList), string policyType = default(string), string policyName = default(string), IList cipherSuites = default(IList), string minProtocolVersion = default(string)) + + /// Ssl protocols to be disabled on application gateway. + /// + + /// Type of Ssl Policy. + /// Possible values include: 'Predefined', 'Custom', 'CustomV2' + + /// Name of Ssl predefined policy. + /// Possible values include: 'AppGwSslPolicy20150501', + /// 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', + /// 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + + /// Ssl cipher suites to be enabled in the specified order to application + /// gateway. + /// + + /// Minimum version of Ssl protocol to be supported on application gateway. + /// Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' + public ApplicationGatewaySslPolicy(System.Collections.Generic.IList disabledSslProtocols = default(System.Collections.Generic.IList), string policyType = default(string), string policyName = default(string), System.Collections.Generic.IList cipherSuites = default(System.Collections.Generic.IList), string minProtocolVersion = default(string)) + { - DisabledSslProtocols = disabledSslProtocols; - PolicyType = policyType; - PolicyName = policyName; - CipherSuites = cipherSuites; - MinProtocolVersion = minProtocolVersion; + this.DisabledSslProtocols = disabledSslProtocols; + this.PolicyType = policyType; + this.PolicyName = policyName; + this.CipherSuites = cipherSuites; + this.MinProtocolVersion = minProtocolVersion; CustomInit(); } @@ -61,42 +57,37 @@ public ApplicationGatewaySslPolicy() /// partial void CustomInit(); + /// /// Gets or sets ssl protocols to be disabled on application gateway. /// - [JsonProperty(PropertyName = "disabledSslProtocols")] - public IList DisabledSslProtocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disabledSslProtocols")] + public System.Collections.Generic.IList DisabledSslProtocols {get; set; } /// - /// Gets or sets type of Ssl Policy. Possible values include: - /// 'Predefined', 'Custom', 'CustomV2' + /// Gets or sets type of Ssl Policy. Possible values include: 'Predefined', 'Custom', 'CustomV2' /// - [JsonProperty(PropertyName = "policyType")] - public string PolicyType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "policyType")] + public string PolicyType {get; set; } /// - /// Gets or sets name of Ssl predefined policy. Possible values - /// include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', - /// 'AppGwSslPolicy20220101S' + /// Gets or sets name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' /// - [JsonProperty(PropertyName = "policyName")] - public string PolicyName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "policyName")] + public string PolicyName {get; set; } /// - /// Gets or sets ssl cipher suites to be enabled in the specified order - /// to application gateway. + /// Gets or sets ssl cipher suites to be enabled in the specified order to + /// application gateway. /// - [JsonProperty(PropertyName = "cipherSuites")] - public IList CipherSuites { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cipherSuites")] + public System.Collections.Generic.IList CipherSuites {get; set; } /// - /// Gets or sets minimum version of Ssl protocol to be supported on - /// application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', - /// 'TLSv1_2', 'TLSv1_3' + /// Gets or sets minimum version of Ssl protocol to be supported on application + /// gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' /// - [JsonProperty(PropertyName = "minProtocolVersion")] - public string MinProtocolVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "minProtocolVersion")] + public string MinProtocolVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyName.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyName.cs index cba0b6d10d5c..5c52282b510d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewaySslPolicyName. /// + + public static class ApplicationGatewaySslPolicyName { public const string AppGwSslPolicy20150501 = "AppGwSslPolicy20150501"; @@ -22,4 +19,4 @@ public static class ApplicationGatewaySslPolicyName public const string AppGwSslPolicy20220101 = "AppGwSslPolicy20220101"; public const string AppGwSslPolicy20220101S = "AppGwSslPolicy20220101S"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyType.cs index 8bca23948a68..d60655050663 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPolicyType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewaySslPolicyType. /// + + public static class ApplicationGatewaySslPolicyType { public const string Predefined = "Predefined"; public const string Custom = "Custom"; public const string CustomV2 = "CustomV2"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs index 049f477b2048..1800f382a3e1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// An Ssl predefined policy. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewaySslPredefinedPolicy : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewaySslPredefinedPolicy class. + /// Initializes a new instance of the ApplicationGatewaySslPredefinedPolicy class. /// public ApplicationGatewaySslPredefinedPolicy() { @@ -33,22 +22,28 @@ public ApplicationGatewaySslPredefinedPolicy() } /// - /// Initializes a new instance of the - /// ApplicationGatewaySslPredefinedPolicy class. + /// Initializes a new instance of the ApplicationGatewaySslPredefinedPolicy class. /// - /// Resource ID. - /// Name of the Ssl predefined policy. - /// Ssl cipher suites to be enabled in the - /// specified order for application gateway. - /// Minimum version of Ssl protocol to - /// be supported on application gateway. Possible values include: - /// 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' - public ApplicationGatewaySslPredefinedPolicy(string id = default(string), string name = default(string), IList cipherSuites = default(IList), string minProtocolVersion = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the Ssl predefined policy. + /// + + /// Ssl cipher suites to be enabled in the specified order for application + /// gateway. + /// + + /// Minimum version of Ssl protocol to be supported on application gateway. + /// Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' + public ApplicationGatewaySslPredefinedPolicy(string id = default(string), string name = default(string), System.Collections.Generic.IList cipherSuites = default(System.Collections.Generic.IList), string minProtocolVersion = default(string)) + + : base(id) { - Name = name; - CipherSuites = cipherSuites; - MinProtocolVersion = minProtocolVersion; + this.Name = name; + this.CipherSuites = cipherSuites; + this.MinProtocolVersion = minProtocolVersion; CustomInit(); } @@ -57,26 +52,25 @@ public ApplicationGatewaySslPredefinedPolicy() /// partial void CustomInit(); + /// /// Gets or sets name of the Ssl predefined policy. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets ssl cipher suites to be enabled in the specified order - /// for application gateway. + /// Gets or sets ssl cipher suites to be enabled in the specified order for + /// application gateway. /// - [JsonProperty(PropertyName = "properties.cipherSuites")] - public IList CipherSuites { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cipherSuites")] + public System.Collections.Generic.IList CipherSuites {get; set; } /// - /// Gets or sets minimum version of Ssl protocol to be supported on - /// application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', - /// 'TLSv1_2', 'TLSv1_3' + /// Gets or sets minimum version of Ssl protocol to be supported on application + /// gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' /// - [JsonProperty(PropertyName = "properties.minProtocolVersion")] - public string MinProtocolVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minProtocolVersion")] + public string MinProtocolVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.cs new file mode 100644 index 000000000000..0d8595cfcce9 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ApplicationGatewaySslPredefinedPolicy. + /// + public partial class ApplicationGatewaySslPredefinedPolicyPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewaySslPredefinedPolicyPropertiesFormat class. + /// + public ApplicationGatewaySslPredefinedPolicyPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewaySslPredefinedPolicyPropertiesFormat class. + /// + + /// Ssl cipher suites to be enabled in the specified order for application + /// gateway. + /// + + /// Minimum version of Ssl protocol to be supported on application gateway. + /// Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' + public ApplicationGatewaySslPredefinedPolicyPropertiesFormat(System.Collections.Generic.IList cipherSuites = default(System.Collections.Generic.IList), string minProtocolVersion = default(string)) + + { + this.CipherSuites = cipherSuites; + this.MinProtocolVersion = minProtocolVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets ssl cipher suites to be enabled in the specified order for + /// application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cipherSuites")] + public System.Collections.Generic.IList CipherSuites {get; set; } + + /// + /// Gets or sets minimum version of Ssl protocol to be supported on application + /// gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minProtocolVersion")] + public string MinProtocolVersion {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfile.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfile.cs index 852340d44401..48c9753ba52f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfile.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfile.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// SSL profile of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewaySslProfile : SubResource { /// - /// Initializes a new instance of the ApplicationGatewaySslProfile - /// class. + /// Initializes a new instance of the ApplicationGatewaySslProfile class. /// public ApplicationGatewaySslProfile() { @@ -33,34 +22,43 @@ public ApplicationGatewaySslProfile() } /// - /// Initializes a new instance of the ApplicationGatewaySslProfile - /// class. + /// Initializes a new instance of the ApplicationGatewaySslProfile class. /// - /// Resource ID. - /// Array of references to - /// application gateway trusted client certificates. - /// SSL policy of the application gateway - /// resource. - /// Client authentication - /// configuration of the application gateway resource. - /// The provisioning state of the HTTP - /// listener resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the SSL profile that is unique within an - /// Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewaySslProfile(string id = default(string), IList trustedClientCertificates = default(IList), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), ApplicationGatewayClientAuthConfiguration clientAuthConfiguration = default(ApplicationGatewayClientAuthConfiguration), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the SSL profile that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the HTTP listener resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Array of references to application gateway trusted client certificates. + /// + + /// SSL policy of the application gateway resource. + /// + + /// Client authentication configuration of the application gateway resource. + /// + public ApplicationGatewaySslProfile(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList trustedClientCertificates = default(System.Collections.Generic.IList), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), ApplicationGatewayClientAuthConfiguration clientAuthConfiguration = default(ApplicationGatewayClientAuthConfiguration)) + + : base(id) { - TrustedClientCertificates = trustedClientCertificates; - SslPolicy = sslPolicy; - ClientAuthConfiguration = clientAuthConfiguration; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.TrustedClientCertificates = trustedClientCertificates; + this.SslPolicy = sslPolicy; + this.ClientAuthConfiguration = clientAuthConfiguration; CustomInit(); } @@ -69,52 +67,51 @@ public ApplicationGatewaySslProfile() /// partial void CustomInit(); + /// - /// Gets or sets array of references to application gateway trusted - /// client certificates. + /// Gets or sets name of the SSL profile that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.trustedClientCertificates")] - public IList TrustedClientCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets SSL policy of the application gateway resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.sslPolicy")] - public ApplicationGatewaySslPolicy SslPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets client authentication configuration of the application - /// gateway resource. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.clientAuthConfiguration")] - public ApplicationGatewayClientAuthConfiguration ClientAuthConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the HTTP listener resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets name of the SSL profile that is unique within an - /// Application Gateway. + /// Gets or sets array of references to application gateway trusted client + /// certificates. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trustedClientCertificates")] + public System.Collections.Generic.IList TrustedClientCertificates {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets sSL policy of the application gateway resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslPolicy")] + public ApplicationGatewaySslPolicy SslPolicy {get; set; } /// - /// Gets type of the resource. + /// Gets or sets client authentication configuration of the application gateway + /// resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.clientAuthConfiguration")] + public ApplicationGatewayClientAuthConfiguration ClientAuthConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfilePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfilePropertiesFormat.cs new file mode 100644 index 000000000000..5b35a678c02e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProfilePropertiesFormat.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of SSL profile of an application gateway. + /// + public partial class ApplicationGatewaySslProfilePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewaySslProfilePropertiesFormat class. + /// + public ApplicationGatewaySslProfilePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewaySslProfilePropertiesFormat class. + /// + + /// Array of references to application gateway trusted client certificates. + /// + + /// SSL policy of the application gateway resource. + /// + + /// Client authentication configuration of the application gateway resource. + /// + + /// The provisioning state of the HTTP listener resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewaySslProfilePropertiesFormat(System.Collections.Generic.IList trustedClientCertificates = default(System.Collections.Generic.IList), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), ApplicationGatewayClientAuthConfiguration clientAuthConfiguration = default(ApplicationGatewayClientAuthConfiguration), string provisioningState = default(string)) + + { + this.TrustedClientCertificates = trustedClientCertificates; + this.SslPolicy = sslPolicy; + this.ClientAuthConfiguration = clientAuthConfiguration; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets array of references to application gateway trusted client + /// certificates. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trustedClientCertificates")] + public System.Collections.Generic.IList TrustedClientCertificates {get; set; } + + /// + /// Gets or sets sSL policy of the application gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sslPolicy")] + public ApplicationGatewaySslPolicy SslPolicy {get; set; } + + /// + /// Gets or sets client authentication configuration of the application gateway + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clientAuthConfiguration")] + public ApplicationGatewayClientAuthConfiguration ClientAuthConfiguration {get; set; } + + /// + /// Gets the provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProtocol.cs index 5e4413db8fdc..0b369fc4e13d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewaySslProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewaySslProtocol. /// + + public static class ApplicationGatewaySslProtocol { public const string TLSv10 = "TLSv1_0"; @@ -21,4 +18,4 @@ public static class ApplicationGatewaySslProtocol public const string TLSv12 = "TLSv1_2"; public const string TLSv13 = "TLSv1_3"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTier.cs index 990ee1fcee2d..ef88fbae5a2b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayTier. /// + + public static class ApplicationGatewayTier { public const string Standard = "Standard"; @@ -22,4 +19,4 @@ public static class ApplicationGatewayTier public const string WAFV2 = "WAF_v2"; public const string Basic = "Basic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTierTypes.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTierTypes.cs index 52410a1393a9..3116dccd8db9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTierTypes.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTierTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayTierTypes. /// + + public static class ApplicationGatewayTierTypes { public const string Standard = "Standard"; @@ -21,4 +18,4 @@ public static class ApplicationGatewayTierTypes public const string StandardV2 = "Standard_v2"; public const string WAFV2 = "WAF_v2"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs index 96ca38c8ca16..8bb9bea47c32 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Trusted client certificates of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayTrustedClientCertificate : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayTrustedClientCertificate class. + /// Initializes a new instance of the ApplicationGatewayTrustedClientCertificate class. /// public ApplicationGatewayTrustedClientCertificate() { @@ -31,32 +22,44 @@ public ApplicationGatewayTrustedClientCertificate() } /// - /// Initializes a new instance of the - /// ApplicationGatewayTrustedClientCertificate class. + /// Initializes a new instance of the ApplicationGatewayTrustedClientCertificate class. /// - /// Resource ID. - /// Certificate public data. - /// Validated certificate data. - /// Distinguished name of client - /// certificate issuer. - /// The provisioning state of the - /// trusted client certificate resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the trusted client certificate that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayTrustedClientCertificate(string id = default(string), string data = default(string), string validatedCertData = default(string), string clientCertIssuerDN = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the trusted client certificate that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the trusted client certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Certificate public data. + /// + + /// Validated certificate data. + /// + + /// Distinguished name of client certificate issuer. + /// + public ApplicationGatewayTrustedClientCertificate(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string data = default(string), string validatedCertData = default(string), string clientCertIssuerDn = default(string)) + + : base(id) { - Data = data; - ValidatedCertData = validatedCertData; - ClientCertIssuerDN = clientCertIssuerDN; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Data = data; + this.ValidatedCertData = validatedCertData; + this.ClientCertIssuerDn = clientCertIssuerDn; CustomInit(); } @@ -65,51 +68,49 @@ public ApplicationGatewayTrustedClientCertificate() /// partial void CustomInit(); + /// - /// Gets or sets certificate public data. + /// Gets or sets name of the trusted client certificate that is unique within + /// an Application Gateway. /// - [JsonProperty(PropertyName = "properties.data")] - public string Data { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets validated certificate data. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.validatedCertData")] - public string ValidatedCertData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets distinguished name of client certificate issuer. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.clientCertIssuerDN")] - public string ClientCertIssuerDN { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the trusted client certificate - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the trusted client certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets name of the trusted client certificate that is unique - /// within an Application Gateway. + /// Gets or sets certificate public data. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] + public string Data {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets validated certificate data. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.validatedCertData")] + public string ValidatedCertData {get; private set; } /// - /// Gets type of the resource. + /// Gets distinguished name of client certificate issuer. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.clientCertIssuerDN")] + public string ClientCertIssuerDn {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.cs new file mode 100644 index 000000000000..8a2a0e0436fd --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Trusted client certificates properties of an application gateway. + /// + public partial class ApplicationGatewayTrustedClientCertificatePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayTrustedClientCertificatePropertiesFormat class. + /// + public ApplicationGatewayTrustedClientCertificatePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayTrustedClientCertificatePropertiesFormat class. + /// + + /// Certificate public data. + /// + + /// Validated certificate data. + /// + + /// Distinguished name of client certificate issuer. + /// + + /// The provisioning state of the trusted client certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayTrustedClientCertificatePropertiesFormat(string data = default(string), string validatedCertData = default(string), string clientCertIssuerDn = default(string), string provisioningState = default(string)) + + { + this.Data = data; + this.ValidatedCertData = validatedCertData; + this.ClientCertIssuerDn = clientCertIssuerDn; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets certificate public data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public string Data {get; set; } + + /// + /// Gets validated certificate data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "validatedCertData")] + public string ValidatedCertData {get; private set; } + + /// + /// Gets distinguished name of client certificate issuer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clientCertIssuerDN")] + public string ClientCertIssuerDn {get; private set; } + + /// + /// Gets the provisioning state of the trusted client certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs index ccaa2bc269b6..941da350aed4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Trusted Root certificates of an application gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayTrustedRootCertificate : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayTrustedRootCertificate class. + /// Initializes a new instance of the ApplicationGatewayTrustedRootCertificate class. /// public ApplicationGatewayTrustedRootCertificate() { @@ -31,31 +22,41 @@ public ApplicationGatewayTrustedRootCertificate() } /// - /// Initializes a new instance of the - /// ApplicationGatewayTrustedRootCertificate class. + /// Initializes a new instance of the ApplicationGatewayTrustedRootCertificate class. /// - /// Resource ID. - /// Certificate public data. - /// Secret Id of (base-64 encoded - /// unencrypted pfx) 'Secret' or 'Certificate' object stored in - /// KeyVault. - /// The provisioning state of the - /// trusted root certificate resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the trusted root certificate that is - /// unique within an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayTrustedRootCertificate(string id = default(string), string data = default(string), string keyVaultSecretId = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the trusted root certificate that is unique within an Application + /// Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the trusted root certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Certificate public data. + /// + + /// Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + /// object stored in KeyVault. + /// + public ApplicationGatewayTrustedRootCertificate(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string data = default(string), string keyVaultSecretId = default(string)) + + : base(id) { - Data = data; - KeyVaultSecretId = keyVaultSecretId; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Data = data; + this.KeyVaultSecretId = keyVaultSecretId; CustomInit(); } @@ -64,46 +65,44 @@ public ApplicationGatewayTrustedRootCertificate() /// partial void CustomInit(); + /// - /// Gets or sets certificate public data. + /// Gets or sets name of the trusted root certificate that is unique within an + /// Application Gateway. /// - [JsonProperty(PropertyName = "properties.data")] - public string Data { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) - /// 'Secret' or 'Certificate' object stored in KeyVault. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.keyVaultSecretId")] - public string KeyVaultSecretId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the trusted root certificate - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the trusted root certificate that is unique - /// within an Application Gateway. + /// Gets the provisioning state of the trusted root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets certificate public data. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] + public string Data {get; set; } /// - /// Gets type of the resource. + /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + /// 'Certificate' object stored in KeyVault. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultSecretId")] + public string KeyVaultSecretId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.cs new file mode 100644 index 000000000000..7cb7eaa57266 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Trusted Root certificates properties of an application gateway. + /// + public partial class ApplicationGatewayTrustedRootCertificatePropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayTrustedRootCertificatePropertiesFormat class. + /// + public ApplicationGatewayTrustedRootCertificatePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayTrustedRootCertificatePropertiesFormat class. + /// + + /// Certificate public data. + /// + + /// Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + /// object stored in KeyVault. + /// + + /// The provisioning state of the trusted root certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayTrustedRootCertificatePropertiesFormat(string data = default(string), string keyVaultSecretId = default(string), string provisioningState = default(string)) + + { + this.Data = data; + this.KeyVaultSecretId = keyVaultSecretId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets certificate public data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public string Data {get; set; } + + /// + /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + /// 'Certificate' object stored in KeyVault. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultSecretId")] + public string KeyVaultSecretId {get; set; } + + /// + /// Gets the provisioning state of the trusted root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlConfiguration.cs index 0ec0b38fd3c0..6dc6260211dc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayUrlConfiguration { /// - /// Initializes a new instance of the - /// ApplicationGatewayUrlConfiguration class. + /// Initializes a new instance of the ApplicationGatewayUrlConfiguration class. /// public ApplicationGatewayUrlConfiguration() { @@ -28,23 +21,26 @@ public ApplicationGatewayUrlConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayUrlConfiguration class. + /// Initializes a new instance of the ApplicationGatewayUrlConfiguration class. /// - /// Url path which user has provided for url - /// rewrite. Null means no path will be updated. Default value is - /// null. - /// Query string which user has - /// provided for url rewrite. Null means no query string will be - /// updated. Default value is null. - /// If set as true, it will re-evaluate the url - /// path map provided in path based request routing rules using - /// modified path. Default value is false. + + /// Url path which user has provided for url rewrite. Null means no path will + /// be updated. Default value is null. + /// + + /// Query string which user has provided for url rewrite. Null means no query + /// string will be updated. Default value is null. + /// + + /// If set as true, it will re-evaluate the url path map provided in path based + /// request routing rules using modified path. Default value is false. + /// public ApplicationGatewayUrlConfiguration(string modifiedPath = default(string), string modifiedQueryString = default(string), bool? reroute = default(bool?)) + { - ModifiedPath = modifiedPath; - ModifiedQueryString = modifiedQueryString; - Reroute = reroute; + this.ModifiedPath = modifiedPath; + this.ModifiedQueryString = modifiedQueryString; + this.Reroute = reroute; CustomInit(); } @@ -53,27 +49,27 @@ public ApplicationGatewayUrlConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets url path which user has provided for url rewrite. Null - /// means no path will be updated. Default value is null. + /// Gets or sets url path which user has provided for url rewrite. Null means + /// no path will be updated. Default value is null. /// - [JsonProperty(PropertyName = "modifiedPath")] - public string ModifiedPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedPath")] + public string ModifiedPath {get; set; } /// - /// Gets or sets query string which user has provided for url rewrite. - /// Null means no query string will be updated. Default value is null. + /// Gets or sets query string which user has provided for url rewrite. Null + /// means no query string will be updated. Default value is null. /// - [JsonProperty(PropertyName = "modifiedQueryString")] - public string ModifiedQueryString { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedQueryString")] + public string ModifiedQueryString {get; set; } /// - /// Gets or sets if set as true, it will re-evaluate the url path map - /// provided in path based request routing rules using modified path. - /// Default value is false. + /// Gets or sets if set as true, it will re-evaluate the url path map provided + /// in path based request routing rules using modified path. Default value is + /// false. /// - [JsonProperty(PropertyName = "reroute")] - public bool? Reroute { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "reroute")] + public bool? Reroute {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMap.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMap.cs index fb55237c56e6..003afcbee0a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMap.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMap.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// UrlPathMaps give a url path to the backend mapping information for /// PathBasedRouting. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayUrlPathMap : SubResource { /// - /// Initializes a new instance of the ApplicationGatewayUrlPathMap - /// class. + /// Initializes a new instance of the ApplicationGatewayUrlPathMap class. /// public ApplicationGatewayUrlPathMap() { @@ -34,42 +23,55 @@ public ApplicationGatewayUrlPathMap() } /// - /// Initializes a new instance of the ApplicationGatewayUrlPathMap - /// class. + /// Initializes a new instance of the ApplicationGatewayUrlPathMap class. /// - /// Resource ID. - /// Default backend address - /// pool resource of URL path map. - /// Default backend http - /// settings resource of URL path map. - /// Default Rewrite rule set - /// resource of URL path map. - /// Default redirect - /// configuration resource of URL path map. - /// Default Load - /// Distribution Policy resource of URL path map. - /// Path rule of URL path map resource. - /// The provisioning state of the URL - /// path map resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the URL path map that is unique within - /// an Application Gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ApplicationGatewayUrlPathMap(string id = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), SubResource defaultRewriteRuleSet = default(SubResource), SubResource defaultRedirectConfiguration = default(SubResource), SubResource defaultLoadDistributionPolicy = default(SubResource), IList pathRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the URL path map that is unique within an Application Gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the URL path map resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Default backend address pool resource of URL path map. + /// + + /// Default backend http settings resource of URL path map. + /// + + /// Default Rewrite rule set resource of URL path map. + /// + + /// Default redirect configuration resource of URL path map. + /// + + /// Default Load Distribution Policy resource of URL path map. + /// + + /// Path rule of URL path map resource. + /// + public ApplicationGatewayUrlPathMap(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), SubResource defaultRewriteRuleSet = default(SubResource), SubResource defaultRedirectConfiguration = default(SubResource), SubResource defaultLoadDistributionPolicy = default(SubResource), System.Collections.Generic.IList pathRules = default(System.Collections.Generic.IList)) + + : base(id) { - DefaultBackendAddressPool = defaultBackendAddressPool; - DefaultBackendHttpSettings = defaultBackendHttpSettings; - DefaultRewriteRuleSet = defaultRewriteRuleSet; - DefaultRedirectConfiguration = defaultRedirectConfiguration; - DefaultLoadDistributionPolicy = defaultLoadDistributionPolicy; - PathRules = pathRules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.DefaultBackendAddressPool = defaultBackendAddressPool; + this.DefaultBackendHttpSettings = defaultBackendHttpSettings; + this.DefaultRewriteRuleSet = defaultRewriteRuleSet; + this.DefaultRedirectConfiguration = defaultRedirectConfiguration; + this.DefaultLoadDistributionPolicy = defaultLoadDistributionPolicy; + this.PathRules = pathRules; CustomInit(); } @@ -78,71 +80,67 @@ public ApplicationGatewayUrlPathMap() /// partial void CustomInit(); + /// - /// Gets or sets default backend address pool resource of URL path map. + /// Gets or sets name of the URL path map that is unique within an Application + /// Gateway. /// - [JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] - public SubResource DefaultBackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets default backend http settings resource of URL path - /// map. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] - public SubResource DefaultBackendHttpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets default Rewrite rule set resource of URL path map. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.defaultRewriteRuleSet")] - public SubResource DefaultRewriteRuleSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets default redirect configuration resource of URL path - /// map. + /// Gets the provisioning state of the URL path map resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.defaultRedirectConfiguration")] - public SubResource DefaultRedirectConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets default Load Distribution Policy resource of URL path - /// map. + /// Gets or sets default backend address pool resource of URL path map. /// - [JsonProperty(PropertyName = "properties.defaultLoadDistributionPolicy")] - public SubResource DefaultLoadDistributionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] + public SubResource DefaultBackendAddressPool {get; set; } /// - /// Gets or sets path rule of URL path map resource. + /// Gets or sets default backend http settings resource of URL path map. /// - [JsonProperty(PropertyName = "properties.pathRules")] - public IList PathRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] + public SubResource DefaultBackendHttpSettings {get; set; } /// - /// Gets the provisioning state of the URL path map resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets default Rewrite rule set resource of URL path map. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultRewriteRuleSet")] + public SubResource DefaultRewriteRuleSet {get; set; } /// - /// Gets or sets name of the URL path map that is unique within an - /// Application Gateway. + /// Gets or sets default redirect configuration resource of URL path map. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultRedirectConfiguration")] + public SubResource DefaultRedirectConfiguration {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets default Load Distribution Policy resource of URL path map. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultLoadDistributionPolicy")] + public SubResource DefaultLoadDistributionPolicy {get; set; } /// - /// Gets type of the resource. + /// Gets or sets path rule of URL path map resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pathRules")] + public System.Collections.Generic.IList PathRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMapPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMapPropertiesFormat.cs new file mode 100644 index 000000000000..f73d869ab32b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayUrlPathMapPropertiesFormat.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of UrlPathMap of the application gateway. + /// + public partial class ApplicationGatewayUrlPathMapPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationGatewayUrlPathMapPropertiesFormat class. + /// + public ApplicationGatewayUrlPathMapPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayUrlPathMapPropertiesFormat class. + /// + + /// Default backend address pool resource of URL path map. + /// + + /// Default backend http settings resource of URL path map. + /// + + /// Default Rewrite rule set resource of URL path map. + /// + + /// Default redirect configuration resource of URL path map. + /// + + /// Default Load Distribution Policy resource of URL path map. + /// + + /// Path rule of URL path map resource. + /// + + /// The provisioning state of the URL path map resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationGatewayUrlPathMapPropertiesFormat(SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), SubResource defaultRewriteRuleSet = default(SubResource), SubResource defaultRedirectConfiguration = default(SubResource), SubResource defaultLoadDistributionPolicy = default(SubResource), System.Collections.Generic.IList pathRules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.DefaultBackendAddressPool = defaultBackendAddressPool; + this.DefaultBackendHttpSettings = defaultBackendHttpSettings; + this.DefaultRewriteRuleSet = defaultRewriteRuleSet; + this.DefaultRedirectConfiguration = defaultRedirectConfiguration; + this.DefaultLoadDistributionPolicy = defaultLoadDistributionPolicy; + this.PathRules = pathRules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets default backend address pool resource of URL path map. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultBackendAddressPool")] + public SubResource DefaultBackendAddressPool {get; set; } + + /// + /// Gets or sets default backend http settings resource of URL path map. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultBackendHttpSettings")] + public SubResource DefaultBackendHttpSettings {get; set; } + + /// + /// Gets or sets default Rewrite rule set resource of URL path map. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultRewriteRuleSet")] + public SubResource DefaultRewriteRuleSet {get; set; } + + /// + /// Gets or sets default redirect configuration resource of URL path map. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultRedirectConfiguration")] + public SubResource DefaultRedirectConfiguration {get; set; } + + /// + /// Gets or sets default Load Distribution Policy resource of URL path map. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultLoadDistributionPolicy")] + public SubResource DefaultLoadDistributionPolicy {get; set; } + + /// + /// Gets or sets path rule of URL path map resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pathRules")] + public System.Collections.Generic.IList PathRules {get; set; } + + /// + /// Gets the provisioning state of the URL path map resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestPropertiesResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestPropertiesResult.cs new file mode 100644 index 000000000000..f1de35b75e67 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestPropertiesResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ApplicationGatewayWafDynamicManifest. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ApplicationGatewayWafDynamicManifestPropertiesResult + { + /// + /// Initializes a new instance of the ApplicationGatewayWafDynamicManifestPropertiesResult class. + /// + public ApplicationGatewayWafDynamicManifestPropertiesResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationGatewayWafDynamicManifestPropertiesResult class. + /// + + /// The available rulesets. + /// + + /// The type of the web application firewall rule set. + /// + + /// The version of the web application firewall rule set type. + /// + public ApplicationGatewayWafDynamicManifestPropertiesResult(System.Collections.Generic.IList availableRuleSets = default(System.Collections.Generic.IList), string ruleSetType = default(string), string ruleSetVersion = default(string)) + + { + this.AvailableRuleSets = availableRuleSets; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the available rulesets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availableRuleSets")] + public System.Collections.Generic.IList AvailableRuleSets {get; set; } + + /// + /// Gets or sets the type of the web application firewall rule set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultRuleSet.ruleSetType")] + public string RuleSetType {get; set; } + + /// + /// Gets or sets the version of the web application firewall rule set type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultRuleSet.ruleSetVersion")] + public string RuleSetVersion {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestResult.cs index e0c4bfab0c45..fda811289ec0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafDynamicManifestResult.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Response for ApplicationGatewayWafDynamicManifest API service call. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayWafDynamicManifestResult { /// - /// Initializes a new instance of the - /// ApplicationGatewayWafDynamicManifestResult class. + /// Initializes a new instance of the ApplicationGatewayWafDynamicManifestResult class. /// public ApplicationGatewayWafDynamicManifestResult() { @@ -33,25 +22,35 @@ public ApplicationGatewayWafDynamicManifestResult() } /// - /// Initializes a new instance of the - /// ApplicationGatewayWafDynamicManifestResult class. + /// Initializes a new instance of the ApplicationGatewayWafDynamicManifestResult class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// The type of the web application firewall - /// rule set. - /// The version of the web application - /// firewall rule set type. - /// The available rulesets. - public ApplicationGatewayWafDynamicManifestResult(string id = default(string), string name = default(string), string type = default(string), string ruleSetType = default(string), string ruleSetVersion = default(string), IList availableRuleSets = default(IList)) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// The available rulesets. + /// + + /// The type of the web application firewall rule set. + /// + + /// The version of the web application firewall rule set type. + /// + public ApplicationGatewayWafDynamicManifestResult(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IList availableRuleSets = default(System.Collections.Generic.IList), string ruleSetType = default(string), string ruleSetVersion = default(string)) + { - Id = id; - Name = name; - Type = type; - RuleSetType = ruleSetType; - RuleSetVersion = ruleSetVersion; - AvailableRuleSets = availableRuleSets; + this.Id = id; + this.Name = name; + this.Type = type; + this.AvailableRuleSets = availableRuleSets; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; CustomInit(); } @@ -60,42 +59,41 @@ public ApplicationGatewayWafDynamicManifestResult() /// partial void CustomInit(); + /// /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the type of the web application firewall rule set. + /// Gets or sets the available rulesets. /// - [JsonProperty(PropertyName = "properties.defaultRuleSet.ruleSetType")] - public string RuleSetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availableRuleSets")] + public System.Collections.Generic.IList AvailableRuleSets {get; set; } /// - /// Gets or sets the version of the web application firewall rule set - /// type. + /// Gets or sets the type of the web application firewall rule set. /// - [JsonProperty(PropertyName = "properties.defaultRuleSet.ruleSetVersion")] - public string RuleSetVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultRuleSet.ruleSetType")] + public string RuleSetType {get; set; } /// - /// Gets or sets the available rulesets. + /// Gets or sets the version of the web application firewall rule set type. /// - [JsonProperty(PropertyName = "properties.availableRuleSets")] - public IList AvailableRuleSets { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultRuleSet.ruleSetVersion")] + public string RuleSetVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleActionTypes.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleActionTypes.cs index bb5319edceeb..5aa01154c609 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleActionTypes.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleActionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayWafRuleActionTypes. /// + + public static class ApplicationGatewayWafRuleActionTypes { public const string None = "None"; @@ -22,4 +19,4 @@ public static class ApplicationGatewayWafRuleActionTypes public const string Block = "Block"; public const string Log = "Log"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleStateTypes.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleStateTypes.cs index 35ed067f7732..eaed5f2f0525 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleStateTypes.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWafRuleStateTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ApplicationGatewayWafRuleStateTypes. /// + + public static class ApplicationGatewayWafRuleStateTypes { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs index dad33866910e..bc6903ffb2c4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ApplicationGatewayWebApplicationFirewallConfiguration { /// - /// Initializes a new instance of the - /// ApplicationGatewayWebApplicationFirewallConfiguration class. + /// Initializes a new instance of the ApplicationGatewayWebApplicationFirewallConfiguration class. /// public ApplicationGatewayWebApplicationFirewallConfiguration() { @@ -31,39 +21,52 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() } /// - /// Initializes a new instance of the - /// ApplicationGatewayWebApplicationFirewallConfiguration class. + /// Initializes a new instance of the ApplicationGatewayWebApplicationFirewallConfiguration class. /// - /// Whether the web application firewall is - /// enabled or not. - /// Web application firewall mode. Possible - /// values include: 'Detection', 'Prevention' - /// The type of the web application firewall - /// rule set. Possible values are: 'OWASP'. - /// The version of the rule set - /// type. - /// The disabled rule groups. - /// Whether allow WAF to check request - /// Body. - /// Maximum request body size for - /// WAF. - /// Maximum request body size in - /// Kb for WAF. - /// Maximum file upload size in Mb - /// for WAF. - /// The exclusion list. - public ApplicationGatewayWebApplicationFirewallConfiguration(bool enabled, string firewallMode, string ruleSetType, string ruleSetVersion, IList disabledRuleGroups = default(IList), bool? requestBodyCheck = default(bool?), int? maxRequestBodySize = default(int?), int? maxRequestBodySizeInKb = default(int?), int? fileUploadLimitInMb = default(int?), IList exclusions = default(IList)) + + /// Whether the web application firewall is enabled or not. + /// + + /// Web application firewall mode. + /// Possible values include: 'Detection', 'Prevention' + + /// The type of the web application firewall rule set. Possible values are: + /// 'OWASP'. + /// + + /// The version of the rule set type. + /// + + /// The disabled rule groups. + /// + + /// Whether allow WAF to check request Body. + /// + + /// Maximum request body size for WAF. + /// + + /// Maximum request body size in Kb for WAF. + /// + + /// Maximum file upload size in Mb for WAF. + /// + + /// The exclusion list. + /// + public ApplicationGatewayWebApplicationFirewallConfiguration(bool enabled, string firewallMode, string ruleSetType, string ruleSetVersion, System.Collections.Generic.IList disabledRuleGroups = default(System.Collections.Generic.IList), bool? requestBodyCheck = default(bool?), int? maxRequestBodySize = default(int?), int? maxRequestBodySizeInKb = default(int?), int? fileUploadLimitInMb = default(int?), System.Collections.Generic.IList exclusions = default(System.Collections.Generic.IList)) + { - Enabled = enabled; - FirewallMode = firewallMode; - RuleSetType = ruleSetType; - RuleSetVersion = ruleSetVersion; - DisabledRuleGroups = disabledRuleGroups; - RequestBodyCheck = requestBodyCheck; - MaxRequestBodySize = maxRequestBodySize; - MaxRequestBodySizeInKb = maxRequestBodySizeInKb; - FileUploadLimitInMb = fileUploadLimitInMb; - Exclusions = exclusions; + this.Enabled = enabled; + this.FirewallMode = firewallMode; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + this.DisabledRuleGroups = disabledRuleGroups; + this.RequestBodyCheck = requestBodyCheck; + this.MaxRequestBodySize = maxRequestBodySize; + this.MaxRequestBodySizeInKb = maxRequestBodySizeInKb; + this.FileUploadLimitInMb = fileUploadLimitInMb; + this.Exclusions = exclusions; CustomInit(); } @@ -72,92 +75,93 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets whether the web application firewall is enabled or - /// not. + /// Gets or sets whether the web application firewall is enabled or not. /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled {get; set; } /// - /// Gets or sets web application firewall mode. Possible values - /// include: 'Detection', 'Prevention' + /// Gets or sets web application firewall mode. Possible values include: 'Detection', 'Prevention' /// - [JsonProperty(PropertyName = "firewallMode")] - public string FirewallMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallMode")] + public string FirewallMode {get; set; } /// - /// Gets or sets the type of the web application firewall rule set. - /// Possible values are: 'OWASP'. + /// Gets or sets the type of the web application firewall rule set. Possible + /// values are: 'OWASP'. /// - [JsonProperty(PropertyName = "ruleSetType")] - public string RuleSetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetType")] + public string RuleSetType {get; set; } /// /// Gets or sets the version of the rule set type. /// - [JsonProperty(PropertyName = "ruleSetVersion")] - public string RuleSetVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetVersion")] + public string RuleSetVersion {get; set; } /// /// Gets or sets the disabled rule groups. /// - [JsonProperty(PropertyName = "disabledRuleGroups")] - public IList DisabledRuleGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disabledRuleGroups")] + public System.Collections.Generic.IList DisabledRuleGroups {get; set; } /// /// Gets or sets whether allow WAF to check request Body. /// - [JsonProperty(PropertyName = "requestBodyCheck")] - public bool? RequestBodyCheck { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestBodyCheck")] + public bool? RequestBodyCheck {get; set; } /// /// Gets or sets maximum request body size for WAF. /// - [JsonProperty(PropertyName = "maxRequestBodySize")] - public int? MaxRequestBodySize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxRequestBodySize")] + public int? MaxRequestBodySize {get; set; } /// /// Gets or sets maximum request body size in Kb for WAF. /// - [JsonProperty(PropertyName = "maxRequestBodySizeInKb")] - public int? MaxRequestBodySizeInKb { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxRequestBodySizeInKb")] + public int? MaxRequestBodySizeInKb {get; set; } /// /// Gets or sets maximum file upload size in Mb for WAF. /// - [JsonProperty(PropertyName = "fileUploadLimitInMb")] - public int? FileUploadLimitInMb { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fileUploadLimitInMb")] + public int? FileUploadLimitInMb {get; set; } /// /// Gets or sets the exclusion list. /// - [JsonProperty(PropertyName = "exclusions")] - public IList Exclusions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "exclusions")] + public System.Collections.Generic.IList Exclusions {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (FirewallMode == null) + if (this.FirewallMode == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "FirewallMode"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FirewallMode"); } - if (RuleSetType == null) + if (this.RuleSetType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetType"); } - if (RuleSetVersion == null) + if (this.RuleSetVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetVersion"); } - if (DisabledRuleGroups != null) + + + + if (this.DisabledRuleGroups != null) { - foreach (var element in DisabledRuleGroups) + foreach (var element in this.DisabledRuleGroups) { if (element != null) { @@ -165,45 +169,45 @@ public virtual void Validate() } } } - if (MaxRequestBodySize != null) + if (this.MaxRequestBodySize != null) { - if (MaxRequestBodySize > 128) + if (this.MaxRequestBodySize > 128) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySize", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MaxRequestBodySize", 128); } - if (MaxRequestBodySize < 8) + if (this.MaxRequestBodySize < 8) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySize", 8); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxRequestBodySize", 8); } } - if (MaxRequestBodySizeInKb != null) + if (this.MaxRequestBodySizeInKb != null) { - if (MaxRequestBodySizeInKb > 128) + if (this.MaxRequestBodySizeInKb > 128) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); } - if (MaxRequestBodySizeInKb < 8) + if (this.MaxRequestBodySizeInKb < 8) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); } } - if (FileUploadLimitInMb != null) + if (this.FileUploadLimitInMb != null) { - if (FileUploadLimitInMb < 0) + if (this.FileUploadLimitInMb < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); } } - if (Exclusions != null) + if (this.Exclusions != null) { - foreach (var element1 in Exclusions) + foreach (var element in this.Exclusions) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationRule.cs index 8b07c46cb9e5..7614bbe911cf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,38 +24,56 @@ public ApplicationRule() /// /// Initializes a new instance of the ApplicationRule class. /// - /// Name of the rule. - /// Description of the rule. - /// List of source IP addresses for this - /// rule. - /// List of destination IP addresses - /// or Service Tags. - /// Array of Application Protocols. - /// List of FQDNs for this rule. - /// List of Urls for this rule - /// condition. - /// List of FQDN Tags for this rule. - /// List of source IpGroups for this - /// rule. - /// Terminate TLS connections for this - /// rule. - /// List of destination azure web - /// categories. - /// List of HTTP/S headers to - /// insert. - public ApplicationRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList protocols = default(IList), IList targetFqdns = default(IList), IList targetUrls = default(IList), IList fqdnTags = default(IList), IList sourceIpGroups = default(IList), bool? terminateTLS = default(bool?), IList webCategories = default(IList), IList httpHeadersToInsert = default(IList)) - : base(name, description) + + /// Name of the rule. + /// + + /// Description of the rule. + /// + + /// List of source IP addresses for this rule. + /// + + /// List of destination IP addresses or Service Tags. + /// + + /// Array of Application Protocols. + /// + + /// List of FQDNs for this rule. + /// + + /// List of Urls for this rule condition. + /// + + /// List of FQDN Tags for this rule. + /// + + /// List of source IpGroups for this rule. + /// + + /// Terminate TLS connections for this rule. + /// + + /// List of destination azure web categories. + /// + + /// List of HTTP/S headers to insert. + /// + public ApplicationRule(string name = default(string), string description = default(string), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList protocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList targetFqdns = default(System.Collections.Generic.IList), System.Collections.Generic.IList targetUrls = default(System.Collections.Generic.IList), System.Collections.Generic.IList fqdnTags = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList), bool? terminateTls = default(bool?), System.Collections.Generic.IList webCategories = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpHeadersToInsert = default(System.Collections.Generic.IList)) + + : base(name, description) { - SourceAddresses = sourceAddresses; - DestinationAddresses = destinationAddresses; - Protocols = protocols; - TargetFqdns = targetFqdns; - TargetUrls = targetUrls; - FqdnTags = fqdnTags; - SourceIpGroups = sourceIpGroups; - TerminateTLS = terminateTLS; - WebCategories = webCategories; - HttpHeadersToInsert = httpHeadersToInsert; + this.SourceAddresses = sourceAddresses; + this.DestinationAddresses = destinationAddresses; + this.Protocols = protocols; + this.TargetFqdns = targetFqdns; + this.TargetUrls = targetUrls; + this.FqdnTags = fqdnTags; + this.SourceIPGroups = sourceIPGroups; + this.TerminateTls = terminateTls; + this.WebCategories = webCategories; + this.HttpHeadersToInsert = httpHeadersToInsert; CustomInit(); } @@ -72,65 +82,65 @@ public ApplicationRule() /// partial void CustomInit(); + /// /// Gets or sets list of source IP addresses for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// /// Gets or sets list of destination IP addresses or Service Tags. /// - [JsonProperty(PropertyName = "destinationAddresses")] - public IList DestinationAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddresses")] + public System.Collections.Generic.IList DestinationAddresses {get; set; } /// /// Gets or sets array of Application Protocols. /// - [JsonProperty(PropertyName = "protocols")] - public IList Protocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocols")] + public System.Collections.Generic.IList Protocols {get; set; } /// /// Gets or sets list of FQDNs for this rule. /// - [JsonProperty(PropertyName = "targetFqdns")] - public IList TargetFqdns { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetFqdns")] + public System.Collections.Generic.IList TargetFqdns {get; set; } /// /// Gets or sets list of Urls for this rule condition. /// - [JsonProperty(PropertyName = "targetUrls")] - public IList TargetUrls { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetUrls")] + public System.Collections.Generic.IList TargetUrls {get; set; } /// /// Gets or sets list of FQDN Tags for this rule. /// - [JsonProperty(PropertyName = "fqdnTags")] - public IList FqdnTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdnTags")] + public System.Collections.Generic.IList FqdnTags {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } /// /// Gets or sets terminate TLS connections for this rule. /// - [JsonProperty(PropertyName = "terminateTLS")] - public bool? TerminateTLS { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "terminateTLS")] + public bool? TerminateTls {get; set; } /// /// Gets or sets list of destination azure web categories. /// - [JsonProperty(PropertyName = "webCategories")] - public IList WebCategories { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "webCategories")] + public System.Collections.Generic.IList WebCategories {get; set; } /// /// Gets or sets list of HTTP/S headers to insert. /// - [JsonProperty(PropertyName = "httpHeadersToInsert")] - public IList HttpHeadersToInsert { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "httpHeadersToInsert")] + public System.Collections.Generic.IList HttpHeadersToInsert {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroup.cs index b27baa5716a4..578843c76551 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroup.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// An application security group in a resource group. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationSecurityGroup : Resource { /// @@ -34,26 +24,39 @@ public ApplicationSecurityGroup() /// /// Initializes a new instance of the ApplicationSecurityGroup class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// 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. - /// The provisioning state of the - /// application security group resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public ApplicationSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the application security group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// 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. + /// + public ApplicationSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -62,29 +65,26 @@ public ApplicationSecurityGroup() /// partial void CustomInit(); + /// - /// Gets 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. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the application security group - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the application security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets 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. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroupPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroupPropertiesFormat.cs new file mode 100644 index 000000000000..a4e1fe376961 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ApplicationSecurityGroupPropertiesFormat.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Application security group properties. + /// + public partial class ApplicationSecurityGroupPropertiesFormat + { + /// + /// Initializes a new instance of the ApplicationSecurityGroupPropertiesFormat class. + /// + public ApplicationSecurityGroupPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationSecurityGroupPropertiesFormat class. + /// + + /// 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. + /// + + /// The provisioning state of the application security group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ApplicationSecurityGroupPropertiesFormat(string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the application security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AssociationType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AssociationType.cs index 33d80e439fb0..7b7f1a488530 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AssociationType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AssociationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AssociationType. /// + + public static class AssociationType { public const string Associated = "Associated"; public const string Contains = "Contains"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AuthenticationMethod.cs b/src/Network/Network.Management.Sdk/Generated/Models/AuthenticationMethod.cs index b8acfe12b69b..dc7c7e6fdb11 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AuthenticationMethod.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AuthenticationMethod.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AuthenticationMethod. /// + + public static class AuthenticationMethod { - public const string EAPTLS = "EAPTLS"; - public const string EAPMSCHAPv2 = "EAPMSCHAPv2"; + public const string Eaptls = "EAPTLS"; + public const string EapmschaPv2 = "EAPMSCHAPv2"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationPropertiesFormat.cs new file mode 100644 index 000000000000..7f191a2df940 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationPropertiesFormat.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ExpressRouteCircuitAuthorization. + /// + public partial class AuthorizationPropertiesFormat + { + /// + /// Initializes a new instance of the AuthorizationPropertiesFormat class. + /// + public AuthorizationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AuthorizationPropertiesFormat class. + /// + + /// The authorization key. + /// + + /// The authorization use status. + /// Possible values include: 'Available', 'InUse' + + /// The provisioning state of the authorization resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public AuthorizationPropertiesFormat(string authorizationKey = default(string), string authorizationUseStatus = default(string), string provisioningState = default(string)) + + { + this.AuthorizationKey = authorizationKey; + this.AuthorizationUseStatus = authorizationUseStatus; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the authorization key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; set; } + + /// + /// Gets or sets the authorization use status. Possible values include: 'Available', 'InUse' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationUseStatus")] + public string AuthorizationUseStatus {get; set; } + + /// + /// Gets the provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationUseStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationUseStatus.cs index 6b7f190f05d6..07678a734244 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationUseStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AuthorizationUseStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AuthorizationUseStatus. /// + + public static class AuthorizationUseStatus { public const string Available = "Available"; public const string InUse = "InUse"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AutoApprovedPrivateLinkService.cs b/src/Network/Network.Management.Sdk/Generated/Models/AutoApprovedPrivateLinkService.cs index 6b61f6161c02..f4130223d9ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AutoApprovedPrivateLinkService.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AutoApprovedPrivateLinkService.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AutoApprovedPrivateLinkService { /// - /// Initializes a new instance of the AutoApprovedPrivateLinkService - /// class. + /// Initializes a new instance of the AutoApprovedPrivateLinkService class. /// public AutoApprovedPrivateLinkService() { @@ -28,14 +21,15 @@ public AutoApprovedPrivateLinkService() } /// - /// Initializes a new instance of the AutoApprovedPrivateLinkService - /// class. + /// Initializes a new instance of the AutoApprovedPrivateLinkService class. /// - /// The id of the private link service - /// resource. + + /// The id of the private link service resource. + /// public AutoApprovedPrivateLinkService(string privateLinkService = default(string)) + { - PrivateLinkService = privateLinkService; + this.PrivateLinkService = privateLinkService; CustomInit(); } @@ -44,11 +38,11 @@ public AutoApprovedPrivateLinkService() /// partial void CustomInit(); + /// /// Gets or sets the id of the private link service resource. /// - [JsonProperty(PropertyName = "privateLinkService")] - public string PrivateLinkService { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkService")] + public string PrivateLinkService {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AutoLearnPrivateRangesMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/AutoLearnPrivateRangesMode.cs index a90d3ee80f99..7f177039756c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AutoLearnPrivateRangesMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AutoLearnPrivateRangesMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AutoLearnPrivateRangesMode. /// + + public static class AutoLearnPrivateRangesMode { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Availability.cs b/src/Network/Network.Management.Sdk/Generated/Models/Availability.cs index 95f89f82564f..56fa44826822 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Availability.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Availability.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public Availability() /// /// Initializes a new instance of the Availability class. /// - /// The time grain of the availability. - /// The retention of the availability. - /// Duration of the availability - /// blob. + + /// The time grain of the availability. + /// + + /// The retention of the availability. + /// + + /// Duration of the availability blob. + /// public Availability(string timeGrain = default(string), string retention = default(string), string blobDuration = default(string)) + { - TimeGrain = timeGrain; - Retention = retention; - BlobDuration = blobDuration; + this.TimeGrain = timeGrain; + this.Retention = retention; + this.BlobDuration = blobDuration; CustomInit(); } @@ -46,23 +46,23 @@ public Availability() /// partial void CustomInit(); + /// /// Gets or sets the time grain of the availability. /// - [JsonProperty(PropertyName = "timeGrain")] - public string TimeGrain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + public string TimeGrain {get; set; } /// /// Gets or sets the retention of the availability. /// - [JsonProperty(PropertyName = "retention")] - public string Retention { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "retention")] + public string Retention {get; set; } /// /// Gets or sets duration of the availability blob. /// - [JsonProperty(PropertyName = "blobDuration")] - public string BlobDuration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableDelegation.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableDelegation.cs index b8129a37a19f..8fc2341da1f9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableDelegation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableDelegation.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The serviceName of an AvailableDelegation indicates a possible - /// delegation for a subnet. + /// The serviceName of an AvailableDelegation indicates a possible delegation + /// for a subnet. /// public partial class AvailableDelegation { @@ -32,22 +24,29 @@ public AvailableDelegation() /// /// Initializes a new instance of the AvailableDelegation class. /// - /// The name of the AvailableDelegation - /// resource. - /// A unique identifier of the AvailableDelegation - /// resource. - /// Resource type. - /// The name of the service and - /// resource. - /// The actions permitted to the service upon - /// delegation. - public AvailableDelegation(string name = default(string), string id = default(string), string type = default(string), string serviceName = default(string), IList actions = default(IList)) + + /// The name of the AvailableDelegation resource. + /// + + /// A unique identifier of the AvailableDelegation resource. + /// + + /// Resource type. + /// + + /// The name of the service and resource. + /// + + /// The actions permitted to the service upon delegation. + /// + public AvailableDelegation(string name = default(string), string id = default(string), string type = default(string), string serviceName = default(string), System.Collections.Generic.IList actions = default(System.Collections.Generic.IList)) + { - Name = name; - Id = id; - Type = type; - ServiceName = serviceName; - Actions = actions; + this.Name = name; + this.Id = id; + this.Type = type; + this.ServiceName = serviceName; + this.Actions = actions; CustomInit(); } @@ -56,36 +55,35 @@ public AvailableDelegation() /// partial void CustomInit(); + /// /// Gets or sets the name of the AvailableDelegation resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets a unique identifier of the AvailableDelegation - /// resource. + /// Gets or sets a unique identifier of the AvailableDelegation resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the name of the service and resource. /// - [JsonProperty(PropertyName = "serviceName")] - public string ServiceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } /// /// Gets or sets the actions permitted to the service upon delegation. /// - [JsonProperty(PropertyName = "actions")] - public IList Actions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actions")] + public System.Collections.Generic.IList Actions {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailablePrivateEndpointType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailablePrivateEndpointType.cs index c56fcfc38b22..fd3517f6063d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailablePrivateEndpointType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailablePrivateEndpointType.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AvailablePrivateEndpointType { /// - /// Initializes a new instance of the AvailablePrivateEndpointType - /// class. + /// Initializes a new instance of the AvailablePrivateEndpointType class. /// public AvailablePrivateEndpointType() { @@ -28,23 +21,31 @@ public AvailablePrivateEndpointType() } /// - /// Initializes a new instance of the AvailablePrivateEndpointType - /// class. + /// Initializes a new instance of the AvailablePrivateEndpointType class. /// - /// The name of the service and resource. - /// A unique identifier of the - /// AvailablePrivateEndpoint Type resource. - /// Resource type. - /// The name of the service and - /// resource. - /// Display name of the resource. + + /// The name of the service and resource. + /// + + /// A unique identifier of the AvailablePrivateEndpoint Type resource. + /// + + /// Resource type. + /// + + /// The name of the service and resource. + /// + + /// Display name of the resource. + /// public AvailablePrivateEndpointType(string name = default(string), string id = default(string), string type = default(string), string resourceName = default(string), string displayName = default(string)) + { - Name = name; - Id = id; - Type = type; - ResourceName = resourceName; - DisplayName = displayName; + this.Name = name; + this.Id = id; + this.Type = type; + this.ResourceName = resourceName; + this.DisplayName = displayName; CustomInit(); } @@ -53,36 +54,36 @@ public AvailablePrivateEndpointType() /// partial void CustomInit(); + /// /// Gets or sets the name of the service and resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets a unique identifier of the AvailablePrivateEndpoint - /// Type resource. + /// Gets or sets a unique identifier of the AvailablePrivateEndpoint Type + /// resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the name of the service and resource. /// - [JsonProperty(PropertyName = "resourceName")] - public string ResourceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceName")] + public string ResourceName {get; set; } /// /// Gets or sets display name of the resource. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersList.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersList.cs index 3b8c72c21cee..8a9456325ff1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersList.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,10 +23,13 @@ public AvailableProvidersList() /// /// Initializes a new instance of the AvailableProvidersList class. /// - /// List of available countries. - public AvailableProvidersList(IList countries) + + /// List of available countries. + /// + public AvailableProvidersList(System.Collections.Generic.IList countries) + { - Countries = countries; + this.Countries = countries; CustomInit(); } @@ -44,24 +38,25 @@ public AvailableProvidersList(IList countries) /// partial void CustomInit(); + /// /// Gets or sets list of available countries. /// - [JsonProperty(PropertyName = "countries")] - public IList Countries { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "countries")] + public System.Collections.Generic.IList Countries {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Countries == null) + if (this.Countries == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Countries"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Countries"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCity.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCity.cs index 6ab28d4a7962..576d8d5f18ac 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public AvailableProvidersListCity() /// /// Initializes a new instance of the AvailableProvidersListCity class. /// - /// The city or town name. - /// A list of Internet service - /// providers. - public AvailableProvidersListCity(string cityName = default(string), IList providers = default(IList)) + + /// The city or town name. + /// + + /// A list of Internet service providers. + /// + public AvailableProvidersListCity(string cityName = default(string), System.Collections.Generic.IList providers = default(System.Collections.Generic.IList)) + { - CityName = cityName; - Providers = providers; + this.CityName = cityName; + this.Providers = providers; CustomInit(); } @@ -46,17 +42,17 @@ public AvailableProvidersListCity() /// partial void CustomInit(); + /// /// Gets or sets the city or town name. /// - [JsonProperty(PropertyName = "cityName")] - public string CityName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cityName")] + public string CityName {get; set; } /// /// Gets or sets a list of Internet service providers. /// - [JsonProperty(PropertyName = "providers")] - public IList Providers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "providers")] + public System.Collections.Generic.IList Providers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCountry.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCountry.cs index 5128aa37016c..1b9d84904d77 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCountry.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListCountry.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AvailableProvidersListCountry { /// - /// Initializes a new instance of the AvailableProvidersListCountry - /// class. + /// Initializes a new instance of the AvailableProvidersListCountry class. /// public AvailableProvidersListCountry() { @@ -30,19 +21,23 @@ public AvailableProvidersListCountry() } /// - /// Initializes a new instance of the AvailableProvidersListCountry - /// class. + /// Initializes a new instance of the AvailableProvidersListCountry class. /// - /// The country name. - /// A list of Internet service - /// providers. - /// List of available states in the - /// country. - public AvailableProvidersListCountry(string countryName = default(string), IList providers = default(IList), IList states = default(IList)) + + /// The country name. + /// + + /// A list of Internet service providers. + /// + + /// List of available states in the country. + /// + public AvailableProvidersListCountry(string countryName = default(string), System.Collections.Generic.IList providers = default(System.Collections.Generic.IList), System.Collections.Generic.IList states = default(System.Collections.Generic.IList)) + { - CountryName = countryName; - Providers = providers; - States = states; + this.CountryName = countryName; + this.Providers = providers; + this.States = states; CustomInit(); } @@ -51,23 +46,23 @@ public AvailableProvidersListCountry() /// partial void CustomInit(); + /// /// Gets or sets the country name. /// - [JsonProperty(PropertyName = "countryName")] - public string CountryName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "countryName")] + public string CountryName {get; set; } /// /// Gets or sets a list of Internet service providers. /// - [JsonProperty(PropertyName = "providers")] - public IList Providers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "providers")] + public System.Collections.Generic.IList Providers {get; set; } /// /// Gets or sets list of available states in the country. /// - [JsonProperty(PropertyName = "states")] - public IList States { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "states")] + public System.Collections.Generic.IList States {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListParameters.cs index e62c7e2d37ee..40457fc46a83 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListParameters.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AvailableProvidersListParameters { /// - /// Initializes a new instance of the AvailableProvidersListParameters - /// class. + /// Initializes a new instance of the AvailableProvidersListParameters class. /// public AvailableProvidersListParameters() { @@ -31,21 +22,27 @@ public AvailableProvidersListParameters() } /// - /// Initializes a new instance of the AvailableProvidersListParameters - /// class. + /// Initializes a new instance of the AvailableProvidersListParameters class. /// - /// A list of Azure regions. - /// The country for available providers - /// list. - /// The state for available providers list. - /// The city or town for available providers - /// list. - public AvailableProvidersListParameters(IList azureLocations = default(IList), string country = default(string), string state = default(string), string city = default(string)) + + /// A list of Azure regions. + /// + + /// The country for available providers list. + /// + + /// The state for available providers list. + /// + + /// The city or town for available providers list. + /// + public AvailableProvidersListParameters(System.Collections.Generic.IList azureLocations = default(System.Collections.Generic.IList), string country = default(string), string state = default(string), string city = default(string)) + { - AzureLocations = azureLocations; - Country = country; - State = state; - City = city; + this.AzureLocations = azureLocations; + this.Country = country; + this.State = state; + this.City = city; CustomInit(); } @@ -54,29 +51,29 @@ public AvailableProvidersListParameters() /// partial void CustomInit(); + /// /// Gets or sets a list of Azure regions. /// - [JsonProperty(PropertyName = "azureLocations")] - public IList AzureLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "azureLocations")] + public System.Collections.Generic.IList AzureLocations {get; set; } /// /// Gets or sets the country for available providers list. /// - [JsonProperty(PropertyName = "country")] - public string Country { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "country")] + public string Country {get; set; } /// /// Gets or sets the state for available providers list. /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// /// Gets or sets the city or town for available providers list. /// - [JsonProperty(PropertyName = "city")] - public string City { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "city")] + public string City {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListState.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListState.cs index 75f1d39d7c46..ae004651ad1c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableProvidersListState.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AvailableProvidersListState { /// - /// Initializes a new instance of the AvailableProvidersListState - /// class. + /// Initializes a new instance of the AvailableProvidersListState class. /// public AvailableProvidersListState() { @@ -30,19 +21,23 @@ public AvailableProvidersListState() } /// - /// Initializes a new instance of the AvailableProvidersListState - /// class. + /// Initializes a new instance of the AvailableProvidersListState class. /// - /// The state name. - /// A list of Internet service - /// providers. - /// List of available cities or towns in the - /// state. - public AvailableProvidersListState(string stateName = default(string), IList providers = default(IList), IList cities = default(IList)) + + /// The state name. + /// + + /// A list of Internet service providers. + /// + + /// List of available cities or towns in the state. + /// + public AvailableProvidersListState(string stateName = default(string), System.Collections.Generic.IList providers = default(System.Collections.Generic.IList), System.Collections.Generic.IList cities = default(System.Collections.Generic.IList)) + { - StateName = stateName; - Providers = providers; - Cities = cities; + this.StateName = stateName; + this.Providers = providers; + this.Cities = cities; CustomInit(); } @@ -51,23 +46,23 @@ public AvailableProvidersListState() /// partial void CustomInit(); + /// /// Gets or sets the state name. /// - [JsonProperty(PropertyName = "stateName")] - public string StateName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "stateName")] + public string StateName {get; set; } /// /// Gets or sets a list of Internet service providers. /// - [JsonProperty(PropertyName = "providers")] - public IList Providers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "providers")] + public System.Collections.Generic.IList Providers {get; set; } /// /// Gets or sets list of available cities or towns in the state. /// - [JsonProperty(PropertyName = "cities")] - public IList Cities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "cities")] + public System.Collections.Generic.IList Cities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AvailableServiceAlias.cs b/src/Network/Network.Management.Sdk/Generated/Models/AvailableServiceAlias.cs index 67cbbbaf940a..eeff26845b16 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AvailableServiceAlias.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AvailableServiceAlias.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,25 @@ public AvailableServiceAlias() /// /// Initializes a new instance of the AvailableServiceAlias class. /// - /// The name of the service alias. - /// The ID of the service alias. - /// The type of the resource. - /// The resource name of the service - /// alias. + + /// The name of the service alias. + /// + + /// The ID of the service alias. + /// + + /// The type of the resource. + /// + + /// The resource name of the service alias. + /// public AvailableServiceAlias(string name = default(string), string id = default(string), string type = default(string), string resourceName = default(string)) + { - Name = name; - Id = id; - Type = type; - ResourceName = resourceName; + this.Name = name; + this.Id = id; + this.Type = type; + this.ResourceName = resourceName; CustomInit(); } @@ -48,29 +50,29 @@ public AvailableServiceAlias() /// partial void CustomInit(); + /// /// Gets or sets the name of the service alias. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the ID of the service alias. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the type of the resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the resource name of the service alias. /// - [JsonProperty(PropertyName = "resourceName")] - public string ResourceName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceName")] + public string ResourceName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureAsyncOperationResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureAsyncOperationResult.cs index e676ad907692..1077b57f4b6b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureAsyncOperationResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureAsyncOperationResult.cs @@ -1,27 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// /// 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. + /// 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. /// public partial class AzureAsyncOperationResult { @@ -36,14 +30,17 @@ public AzureAsyncOperationResult() /// /// Initializes a new instance of the AzureAsyncOperationResult class. /// - /// Status of the Azure async operation. Possible - /// values include: 'InProgress', 'Succeeded', 'Failed' - /// Details of the error occurred during specified - /// asynchronous operation. + + /// Status of the Azure async operation. + /// Possible values include: 'InProgress', 'Succeeded', 'Failed' + + /// Details of the error occurred during specified asynchronous operation. + /// public AzureAsyncOperationResult(string status = default(string), Error error = default(Error)) + { - Status = status; - Error = error; + this.Status = status; + this.Error = error; CustomInit(); } @@ -52,19 +49,18 @@ public AzureAsyncOperationResult() /// partial void CustomInit(); + /// - /// Gets or sets status of the Azure async operation. Possible values - /// include: 'InProgress', 'Succeeded', 'Failed' + /// Gets or sets status of the Azure async operation. Possible values include: 'InProgress', 'Succeeded', 'Failed' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets details of the error occurred during specified - /// asynchronous operation. + /// Gets or sets details of the error occurred during specified asynchronous + /// operation. /// - [JsonProperty(PropertyName = "error")] - public Error Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public Error Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewall.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewall.cs index 3143ba926c89..78173ed407b8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewall.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewall.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Azure Firewall resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureFirewall : Resource { /// @@ -34,60 +24,86 @@ public AzureFirewall() /// /// Initializes a new instance of the AzureFirewall class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Collection of application - /// rule collections used by Azure Firewall. - /// Collection of NAT rule collections - /// used by Azure Firewall. - /// Collection of network rule - /// collections used by Azure Firewall. - /// IP configuration of the Azure - /// Firewall resource. - /// IP configuration of the - /// Azure Firewall used for management traffic. - /// The provisioning state of the Azure - /// firewall resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The operation mode for Threat - /// Intelligence. Possible values include: 'Alert', 'Deny', - /// 'Off' - /// The virtualHub to which the firewall - /// belongs. - /// The firewallPolicy associated with - /// this azure firewall. - /// IP addresses associated with - /// AzureFirewall. - /// IpGroups associated with - /// AzureFirewall. - /// The Azure Firewall Resource SKU. - /// The additional properties used - /// to further config this azure firewall. - /// A list of availability zones denoting where the - /// resource needs to come from. - /// A unique read-only string that changes whenever - /// the resource is updated. - public AzureFirewall(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList applicationRuleCollections = default(IList), IList natRuleCollections = default(IList), IList networkRuleCollections = default(IList), IList ipConfigurations = default(IList), AzureFirewallIPConfiguration managementIpConfiguration = default(AzureFirewallIPConfiguration), string provisioningState = default(string), string threatIntelMode = default(string), SubResource virtualHub = default(SubResource), SubResource firewallPolicy = default(SubResource), HubIPAddresses hubIPAddresses = default(HubIPAddresses), IList ipGroups = default(IList), AzureFirewallSku sku = default(AzureFirewallSku), IDictionary additionalProperties = default(IDictionary), IList zones = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A list of availability zones denoting where the resource needs to come + /// from. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the Azure firewall resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// IpGroups associated with AzureFirewall. + /// + + /// Collection of application rule collections used by Azure Firewall. + /// + + /// Collection of NAT rule collections used by Azure Firewall. + /// + + /// Collection of network rule collections used by Azure Firewall. + /// + + /// IP configuration of the Azure Firewall resource. + /// + + /// IP configuration of the Azure Firewall used for management traffic. + /// + + /// The operation mode for Threat Intelligence. + /// Possible values include: 'Alert', 'Deny', 'Off' + + /// The virtualHub to which the firewall belongs. + /// + + /// The firewallPolicy associated with this azure firewall. + /// + + /// IP addresses associated with AzureFirewall. + /// + + /// The Azure Firewall Resource SKU. + /// + + /// The additional properties used to further config this azure firewall. + /// + public AzureFirewall(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList ipGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationRuleCollections = default(System.Collections.Generic.IList), System.Collections.Generic.IList natRuleCollections = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkRuleCollections = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), AzureFirewallIPConfiguration managementIPConfiguration = default(AzureFirewallIPConfiguration), string threatIntelMode = default(string), SubResource virtualHub = default(SubResource), SubResource firewallPolicy = default(SubResource), HubIPAddresses hubIPAddresses = default(HubIPAddresses), AzureFirewallSku sku = default(AzureFirewallSku), System.Collections.Generic.IDictionary additionalProperties = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, location, tags) { - ApplicationRuleCollections = applicationRuleCollections; - NatRuleCollections = natRuleCollections; - NetworkRuleCollections = networkRuleCollections; - IpConfigurations = ipConfigurations; - ManagementIpConfiguration = managementIpConfiguration; - ProvisioningState = provisioningState; - ThreatIntelMode = threatIntelMode; - VirtualHub = virtualHub; - FirewallPolicy = firewallPolicy; - HubIPAddresses = hubIPAddresses; - IpGroups = ipGroups; - Sku = sku; - AdditionalProperties = additionalProperties; - Zones = zones; - Etag = etag; + this.Zones = zones; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.IPGroups = ipGroups; + this.ApplicationRuleCollections = applicationRuleCollections; + this.NatRuleCollections = natRuleCollections; + this.NetworkRuleCollections = networkRuleCollections; + this.IPConfigurations = ipConfigurations; + this.ManagementIPConfiguration = managementIPConfiguration; + this.ThreatIntelMode = threatIntelMode; + this.VirtualHub = virtualHub; + this.FirewallPolicy = firewallPolicy; + this.HubIPAddresses = hubIPAddresses; + this.Sku = sku; + this.AdditionalProperties = additionalProperties; CustomInit(); } @@ -96,106 +112,100 @@ public AzureFirewall() /// partial void CustomInit(); + /// - /// Gets or sets collection of application rule collections used by - /// Azure Firewall. + /// Gets or sets a list of availability zones denoting where the resource needs + /// to come from. /// - [JsonProperty(PropertyName = "properties.applicationRuleCollections")] - public IList ApplicationRuleCollections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets collection of NAT rule collections used by Azure - /// Firewall. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.natRuleCollections")] - public IList NatRuleCollections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets collection of network rule collections used by Azure - /// Firewall. + /// Gets the provisioning state of the Azure firewall resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.networkRuleCollections")] - public IList NetworkRuleCollections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets IP configuration of the Azure Firewall resource. + /// Gets ipGroups associated with AzureFirewall. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipGroups")] + public System.Collections.Generic.IList IPGroups {get; private set; } /// - /// Gets or sets IP configuration of the Azure Firewall used for - /// management traffic. + /// Gets or sets collection of application rule collections used by Azure + /// Firewall. /// - [JsonProperty(PropertyName = "properties.managementIpConfiguration")] - public AzureFirewallIPConfiguration ManagementIpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationRuleCollections")] + public System.Collections.Generic.IList ApplicationRuleCollections {get; set; } /// - /// Gets the provisioning state of the Azure firewall resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets collection of NAT rule collections used by Azure Firewall. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.natRuleCollections")] + public System.Collections.Generic.IList NatRuleCollections {get; set; } /// - /// Gets or sets the operation mode for Threat Intelligence. Possible - /// values include: 'Alert', 'Deny', 'Off' + /// Gets or sets collection of network rule collections used by Azure Firewall. /// - [JsonProperty(PropertyName = "properties.threatIntelMode")] - public string ThreatIntelMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkRuleCollections")] + public System.Collections.Generic.IList NetworkRuleCollections {get; set; } /// - /// Gets or sets the virtualHub to which the firewall belongs. + /// Gets or sets iP configuration of the Azure Firewall resource. /// - [JsonProperty(PropertyName = "properties.virtualHub")] - public SubResource VirtualHub { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// - /// Gets or sets the firewallPolicy associated with this azure - /// firewall. + /// Gets or sets iP configuration of the Azure Firewall used for management + /// traffic. /// - [JsonProperty(PropertyName = "properties.firewallPolicy")] - public SubResource FirewallPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.managementIpConfiguration")] + public AzureFirewallIPConfiguration ManagementIPConfiguration {get; set; } /// - /// Gets or sets IP addresses associated with AzureFirewall. + /// Gets or sets the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off' /// - [JsonProperty(PropertyName = "properties.hubIPAddresses")] - public HubIPAddresses HubIPAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.threatIntelMode")] + public string ThreatIntelMode {get; set; } /// - /// Gets ipGroups associated with AzureFirewall. + /// Gets or sets the virtualHub to which the firewall belongs. /// - [JsonProperty(PropertyName = "properties.ipGroups")] - public IList IpGroups { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHub")] + public SubResource VirtualHub {get; set; } /// - /// Gets or sets the Azure Firewall Resource SKU. + /// Gets or sets the firewallPolicy associated with this azure firewall. /// - [JsonProperty(PropertyName = "properties.sku")] - public AzureFirewallSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewallPolicy")] + public SubResource FirewallPolicy {get; set; } /// - /// Gets or sets the additional properties used to further config this - /// azure firewall. + /// Gets or sets iP addresses associated with AzureFirewall. /// - [JsonProperty(PropertyName = "properties.additionalProperties")] - public IDictionary AdditionalProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hubIPAddresses")] + public HubIPAddresses HubIPAddresses {get; set; } /// - /// Gets or sets a list of availability zones denoting where the - /// resource needs to come from. + /// Gets or sets the Azure Firewall Resource SKU. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public AzureFirewallSku Sku {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the additional properties used to further config this azure + /// firewall. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalProperties")] + public System.Collections.Generic.IDictionary AdditionalProperties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRule.cs index 1b18cbcb42da..8cd49a385e90 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureFirewallApplicationRule { /// - /// Initializes a new instance of the AzureFirewallApplicationRule - /// class. + /// Initializes a new instance of the AzureFirewallApplicationRule class. /// public AzureFirewallApplicationRule() { @@ -30,27 +21,39 @@ public AzureFirewallApplicationRule() } /// - /// Initializes a new instance of the AzureFirewallApplicationRule - /// class. + /// Initializes a new instance of the AzureFirewallApplicationRule class. /// - /// Name of the application rule. - /// Description of the rule. - /// List of source IP addresses for this - /// rule. - /// Array of ApplicationRuleProtocols. - /// List of FQDNs for this rule. - /// List of FQDN Tags for this rule. - /// List of source IpGroups for this - /// rule. - public AzureFirewallApplicationRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList protocols = default(IList), IList targetFqdns = default(IList), IList fqdnTags = default(IList), IList sourceIpGroups = default(IList)) + + /// Name of the application rule. + /// + + /// Description of the rule. + /// + + /// List of source IP addresses for this rule. + /// + + /// Array of ApplicationRuleProtocols. + /// + + /// List of FQDNs for this rule. + /// + + /// List of FQDN Tags for this rule. + /// + + /// List of source IpGroups for this rule. + /// + public AzureFirewallApplicationRule(string name = default(string), string description = default(string), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList protocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList targetFqdns = default(System.Collections.Generic.IList), System.Collections.Generic.IList fqdnTags = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList)) + { - Name = name; - Description = description; - SourceAddresses = sourceAddresses; - Protocols = protocols; - TargetFqdns = targetFqdns; - FqdnTags = fqdnTags; - SourceIpGroups = sourceIpGroups; + this.Name = name; + this.Description = description; + this.SourceAddresses = sourceAddresses; + this.Protocols = protocols; + this.TargetFqdns = targetFqdns; + this.FqdnTags = fqdnTags; + this.SourceIPGroups = sourceIPGroups; CustomInit(); } @@ -59,47 +62,47 @@ public AzureFirewallApplicationRule() /// partial void CustomInit(); + /// /// Gets or sets name of the application rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets description of the rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets list of source IP addresses for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// /// Gets or sets array of ApplicationRuleProtocols. /// - [JsonProperty(PropertyName = "protocols")] - public IList Protocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocols")] + public System.Collections.Generic.IList Protocols {get; set; } /// /// Gets or sets list of FQDNs for this rule. /// - [JsonProperty(PropertyName = "targetFqdns")] - public IList TargetFqdns { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetFqdns")] + public System.Collections.Generic.IList TargetFqdns {get; set; } /// /// Gets or sets list of FQDN Tags for this rule. /// - [JsonProperty(PropertyName = "fqdnTags")] - public IList FqdnTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdnTags")] + public System.Collections.Generic.IList FqdnTags {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollection.cs index 30fea8c7ada4..6c9751d06c6b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Application rule collection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureFirewallApplicationRuleCollection : SubResource { /// - /// Initializes a new instance of the - /// AzureFirewallApplicationRuleCollection class. + /// Initializes a new instance of the AzureFirewallApplicationRuleCollection class. /// public AzureFirewallApplicationRuleCollection() { @@ -33,32 +22,40 @@ public AzureFirewallApplicationRuleCollection() } /// - /// Initializes a new instance of the - /// AzureFirewallApplicationRuleCollection class. + /// Initializes a new instance of the AzureFirewallApplicationRuleCollection class. /// - /// Resource ID. - /// Priority of the application rule collection - /// resource. - /// The action type of a rule collection. - /// Collection of rules used by a application rule - /// collection. - /// The provisioning state of the - /// application rule collection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the Azure firewall. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public AzureFirewallApplicationRuleCollection(string id = default(string), int? priority = default(int?), AzureFirewallRCAction action = default(AzureFirewallRCAction), IList rules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the Azure firewall. This + /// name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the application rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Priority of the application rule collection resource. + /// + + /// The action type of a rule collection. + /// + + /// Collection of rules used by a application rule collection. + /// + public AzureFirewallApplicationRuleCollection(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), int? priority = default(int?), AzureFirewallRCAction action = default(AzureFirewallRCAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(id) { - Priority = priority; - Action = action; - Rules = rules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Priority = priority; + this.Action = action; + this.Rules = rules; CustomInit(); } @@ -67,66 +64,68 @@ public AzureFirewallApplicationRuleCollection() /// partial void CustomInit(); + /// - /// Gets or sets priority of the application rule collection resource. + /// Gets or sets the name of the resource that is unique within the Azure + /// firewall. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the action type of a rule collection. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.action")] - public AzureFirewallRCAction Action { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets collection of rules used by a application rule - /// collection. + /// Gets the provisioning state of the application rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the application rule collection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets priority of the application rule collection resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets the name of the resource that is unique within the - /// Azure firewall. This name can be used to access the resource. + /// Gets or sets the action type of a rule collection. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.action")] + public AzureFirewallRCAction Action {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets collection of rules used by a application rule collection. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority != null) + + + + if (this.Priority != null) { - if (Priority > 65000) + if (this.Priority > 65000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); } - if (Priority < 100) + if (this.Priority < 100) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollectionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollectionPropertiesFormat.cs new file mode 100644 index 000000000000..6a8927dac5bd --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleCollectionPropertiesFormat.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the application rule collection. + /// + public partial class AzureFirewallApplicationRuleCollectionPropertiesFormat + { + /// + /// Initializes a new instance of the AzureFirewallApplicationRuleCollectionPropertiesFormat class. + /// + public AzureFirewallApplicationRuleCollectionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFirewallApplicationRuleCollectionPropertiesFormat class. + /// + + /// Priority of the application rule collection resource. + /// + + /// The action type of a rule collection. + /// + + /// Collection of rules used by a application rule collection. + /// + + /// The provisioning state of the application rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public AzureFirewallApplicationRuleCollectionPropertiesFormat(int? priority = default(int?), AzureFirewallRCAction action = default(AzureFirewallRCAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Priority = priority; + this.Action = action; + this.Rules = rules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets priority of the application rule collection resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } + + /// + /// Gets or sets the action type of a rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public AzureFirewallRCAction Action {get; set; } + + /// + /// Gets or sets collection of rules used by a application rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } + + /// + /// Gets the provisioning state of the application rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Priority != null) + { + if (this.Priority > 65000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (this.Priority < 100) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocol.cs index 278a39b679cb..be0e8a9e7c10 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocol.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureFirewallApplicationRuleProtocol { /// - /// Initializes a new instance of the - /// AzureFirewallApplicationRuleProtocol class. + /// Initializes a new instance of the AzureFirewallApplicationRuleProtocol class. /// public AzureFirewallApplicationRuleProtocol() { @@ -29,17 +21,20 @@ public AzureFirewallApplicationRuleProtocol() } /// - /// Initializes a new instance of the - /// AzureFirewallApplicationRuleProtocol class. + /// Initializes a new instance of the AzureFirewallApplicationRuleProtocol class. /// - /// Protocol type. Possible values include: - /// 'Http', 'Https', 'Mssql' - /// Port number for the protocol, cannot be greater - /// than 64000. This field is optional. + + /// Protocol type. + /// Possible values include: 'Http', 'Https', 'Mssql' + + /// Port number for the protocol, cannot be greater than 64000. This field is + /// optional. + /// public AzureFirewallApplicationRuleProtocol(string protocolType = default(string), int? port = default(int?)) + { - ProtocolType = protocolType; - Port = port; + this.ProtocolType = protocolType; + this.Port = port; CustomInit(); } @@ -48,39 +43,39 @@ public AzureFirewallApplicationRuleProtocol() /// partial void CustomInit(); + /// - /// Gets or sets protocol type. Possible values include: 'Http', - /// 'Https', 'Mssql' + /// Gets or sets protocol type. Possible values include: 'Http', 'Https', 'Mssql' /// - [JsonProperty(PropertyName = "protocolType")] - public string ProtocolType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocolType")] + public string ProtocolType {get; set; } /// - /// Gets or sets port number for the protocol, cannot be greater than - /// 64000. This field is optional. + /// Gets or sets port number for the protocol, cannot be greater than 64000. + /// This field is optional. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + + if (this.Port != null) { - if (Port > 64000) + if (this.Port > 64000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 64000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 64000); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocolType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocolType.cs index 0e442c8773be..b23c5b7a356a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocolType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallApplicationRuleProtocolType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallApplicationRuleProtocolType. /// + + public static class AzureFirewallApplicationRuleProtocolType { public const string Http = "Http"; public const string Https = "Https"; public const string Mssql = "Mssql"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTag.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTag.cs index 822f78a349f2..0f9d300f376a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTag.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTag.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Azure Firewall FQDN Tag Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureFirewallFqdnTag : Resource { /// @@ -34,23 +24,37 @@ public AzureFirewallFqdnTag() /// /// Initializes a new instance of the AzureFirewallFqdnTag class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The provisioning state of the Azure - /// firewall FQDN tag resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of this FQDN Tag. - /// A unique read-only string that changes whenever - /// the resource is updated. - public AzureFirewallFqdnTag(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string fqdnTagName = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the Azure firewall FQDN tag resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The name of this FQDN Tag. + /// + public AzureFirewallFqdnTag(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string fqdnTagName = default(string)) + + : base(id, name, type, location, tags) { - ProvisioningState = provisioningState; - FqdnTagName = fqdnTagName; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.FqdnTagName = fqdnTagName; CustomInit(); } @@ -59,26 +63,24 @@ public AzureFirewallFqdnTag() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the Azure firewall FQDN tag - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the name of this FQDN Tag. + /// Gets the provisioning state of the Azure firewall FQDN tag resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.fqdnTagName")] - public string FqdnTagName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the name of this FQDN Tag. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdnTagName")] + public string FqdnTagName {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTagPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTagPropertiesFormat.cs new file mode 100644 index 000000000000..3efd5e435c59 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallFqdnTagPropertiesFormat.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Azure Firewall FQDN Tag Properties. + /// + public partial class AzureFirewallFqdnTagPropertiesFormat + { + /// + /// Initializes a new instance of the AzureFirewallFqdnTagPropertiesFormat class. + /// + public AzureFirewallFqdnTagPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFirewallFqdnTagPropertiesFormat class. + /// + + /// The provisioning state of the Azure firewall FQDN tag resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The name of this FQDN Tag. + /// + public AzureFirewallFqdnTagPropertiesFormat(string provisioningState = default(string), string fqdnTagName = default(string)) + + { + this.ProvisioningState = provisioningState; + this.FqdnTagName = fqdnTagName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the Azure firewall FQDN tag resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the name of this FQDN Tag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdnTagName")] + public string FqdnTagName {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfiguration.cs index e3ab290cc0ce..a718c0b9d953 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IP configuration of an Azure Firewall. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureFirewallIPConfiguration : SubResource { /// - /// Initializes a new instance of the AzureFirewallIPConfiguration - /// class. + /// Initializes a new instance of the AzureFirewallIPConfiguration class. /// public AzureFirewallIPConfiguration() { @@ -31,36 +22,47 @@ public AzureFirewallIPConfiguration() } /// - /// Initializes a new instance of the AzureFirewallIPConfiguration - /// class. + /// Initializes a new instance of the AzureFirewallIPConfiguration class. /// - /// Resource ID. - /// The Firewall Internal Load Balancer - /// IP to be used as the next hop in User Defined Routes. - /// Reference to the subnet resource. This - /// resource must be named 'AzureFirewallSubnet' or - /// 'AzureFirewallManagementSubnet'. - /// Reference to the PublicIP resource. - /// This field is a mandatory input if subnet is not null. - /// The provisioning state of the Azure - /// firewall IP configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public AzureFirewallIPConfiguration(string id = default(string), string privateIPAddress = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the resource that is unique within a resource group. This name can + /// be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the Azure firewall IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The Firewall Internal Load Balancer IP to be used as the next hop in User + /// Defined Routes. + /// + + /// Reference to the subnet resource. This resource must be named + /// 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + /// + + /// Reference to the PublicIP resource. This field is a mandatory input if + /// subnet is not null. + /// + public AzureFirewallIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string privateIPAddress = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource)) + + : base(id) { - PrivateIPAddress = privateIPAddress; - Subnet = subnet; - PublicIPAddress = publicIPAddress; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PrivateIPAddress = privateIPAddress; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; CustomInit(); } @@ -69,54 +71,53 @@ public AzureFirewallIPConfiguration() /// partial void CustomInit(); + /// - /// Gets the Firewall Internal Load Balancer IP to be used as the next - /// hop in User Defined Routes. + /// Gets or sets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets reference to the subnet resource. This resource must - /// be named 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets reference to the PublicIP resource. This field is a - /// mandatory input if subnet is not null. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public SubResource PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the provisioning state of the Azure firewall IP configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets the Firewall Internal Load Balancer IP to be used as the next hop in + /// User Defined Routes. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets reference to the subnet resource. This resource must be named + /// 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets type of the resource. + /// Gets or sets reference to the PublicIP resource. This field is a mandatory + /// input if subnet is not null. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public SubResource PublicIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..f48ebdfb3559 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIPConfigurationPropertiesFormat.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of IP configuration of an Azure Firewall. + /// + public partial class AzureFirewallIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the AzureFirewallIPConfigurationPropertiesFormat class. + /// + public AzureFirewallIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFirewallIPConfigurationPropertiesFormat class. + /// + + /// The Firewall Internal Load Balancer IP to be used as the next hop in User + /// Defined Routes. + /// + + /// Reference to the subnet resource. This resource must be named + /// 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + /// + + /// Reference to the PublicIP resource. This field is a mandatory input if + /// subnet is not null. + /// + + /// The provisioning state of the Azure firewall IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public AzureFirewallIPConfigurationPropertiesFormat(string privateIPAddress = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string provisioningState = default(string)) + + { + this.PrivateIPAddress = privateIPAddress; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the Firewall Internal Load Balancer IP to be used as the next hop in + /// User Defined Routes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; private set; } + + /// + /// Gets or sets reference to the subnet resource. This resource must be named + /// 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets reference to the PublicIP resource. This field is a mandatory + /// input if subnet is not null. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public SubResource PublicIPAddress {get; set; } + + /// + /// Gets the provisioning state of the Azure firewall IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIpGroups.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIpGroups.cs index 139783664cf3..d5ec7bf9edc4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIpGroups.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallIpGroups.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public AzureFirewallIpGroups() /// /// Initializes a new instance of the AzureFirewallIpGroups class. /// - /// Resource ID. - /// The iteration number. + + /// Resource ID. + /// + + /// The iteration number. + /// public AzureFirewallIpGroups(string id = default(string), string changeNumber = default(string)) + { - Id = id; - ChangeNumber = changeNumber; + this.Id = id; + this.ChangeNumber = changeNumber; CustomInit(); } @@ -43,17 +42,17 @@ public AzureFirewallIpGroups() /// partial void CustomInit(); + /// /// Gets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the iteration number. /// - [JsonProperty(PropertyName = "changeNumber")] - public string ChangeNumber { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "changeNumber")] + public string ChangeNumber {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCAction.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCAction.cs index b529a8cc6fe3..c49b91838e43 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCAction.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCAction.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public AzureFirewallNatRCAction() /// /// Initializes a new instance of the AzureFirewallNatRCAction class. /// - /// The type of action. Possible values include: - /// 'Snat', 'Dnat' + + /// The type of action. + /// Possible values include: 'Snat', 'Dnat' public AzureFirewallNatRCAction(string type = default(string)) + { - Type = type; + this.Type = type; CustomInit(); } @@ -42,12 +38,11 @@ public AzureFirewallNatRCAction() /// partial void CustomInit(); + /// - /// Gets or sets the type of action. Possible values include: 'Snat', - /// 'Dnat' + /// Gets or sets the type of action. Possible values include: 'Snat', 'Dnat' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCActionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCActionType.cs index e9eee7c947cc..254e6d5fe93a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCActionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRCActionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallNatRCActionType. /// + + public static class AzureFirewallNatRCActionType { public const string Snat = "Snat"; public const string Dnat = "Dnat"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRule.cs index a8658c0a4026..d4b37f0107f5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,36 +23,50 @@ public AzureFirewallNatRule() /// /// Initializes a new instance of the AzureFirewallNatRule class. /// - /// Name of the NAT rule. - /// Description of the rule. - /// List of source IP addresses for this - /// rule. - /// List of destination IP addresses - /// for this rule. Supports IP ranges, prefixes, and service - /// tags. - /// List of destination ports. - /// Array of AzureFirewallNetworkRuleProtocols - /// applicable to this NAT rule. - /// The translated address for this NAT - /// rule. - /// The translated port for this NAT - /// rule. - /// The translated FQDN for this NAT - /// rule. - /// List of source IpGroups for this - /// rule. - public AzureFirewallNatRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList protocols = default(IList), string translatedAddress = default(string), string translatedPort = default(string), string translatedFqdn = default(string), IList sourceIpGroups = default(IList)) + + /// Name of the NAT rule. + /// + + /// Description of the rule. + /// + + /// List of source IP addresses for this rule. + /// + + /// List of destination IP addresses for this rule. Supports IP ranges, + /// prefixes, and service tags. + /// + + /// List of destination ports. + /// + + /// Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + /// + + /// The translated address for this NAT rule. + /// + + /// The translated port for this NAT rule. + /// + + /// The translated FQDN for this NAT rule. + /// + + /// List of source IpGroups for this rule. + /// + public AzureFirewallNatRule(string name = default(string), string description = default(string), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList protocols = default(System.Collections.Generic.IList), string translatedAddress = default(string), string translatedPort = default(string), string translatedFqdn = default(string), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList)) + { - Name = name; - Description = description; - SourceAddresses = sourceAddresses; - DestinationAddresses = destinationAddresses; - DestinationPorts = destinationPorts; - Protocols = protocols; - TranslatedAddress = translatedAddress; - TranslatedPort = translatedPort; - TranslatedFqdn = translatedFqdn; - SourceIpGroups = sourceIpGroups; + this.Name = name; + this.Description = description; + this.SourceAddresses = sourceAddresses; + this.DestinationAddresses = destinationAddresses; + this.DestinationPorts = destinationPorts; + this.Protocols = protocols; + this.TranslatedAddress = translatedAddress; + this.TranslatedPort = translatedPort; + this.TranslatedFqdn = translatedFqdn; + this.SourceIPGroups = sourceIPGroups; CustomInit(); } @@ -69,67 +75,67 @@ public AzureFirewallNatRule() /// partial void CustomInit(); + /// /// Gets or sets name of the NAT rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets description of the rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets list of source IP addresses for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// - /// Gets or sets list of destination IP addresses for this rule. - /// Supports IP ranges, prefixes, and service tags. + /// Gets or sets list of destination IP addresses for this rule. Supports IP + /// ranges, prefixes, and service tags. /// - [JsonProperty(PropertyName = "destinationAddresses")] - public IList DestinationAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddresses")] + public System.Collections.Generic.IList DestinationAddresses {get; set; } /// /// Gets or sets list of destination ports. /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } /// - /// Gets or sets array of AzureFirewallNetworkRuleProtocols applicable - /// to this NAT rule. + /// Gets or sets array of AzureFirewallNetworkRuleProtocols applicable to this + /// NAT rule. /// - [JsonProperty(PropertyName = "protocols")] - public IList Protocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocols")] + public System.Collections.Generic.IList Protocols {get; set; } /// /// Gets or sets the translated address for this NAT rule. /// - [JsonProperty(PropertyName = "translatedAddress")] - public string TranslatedAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "translatedAddress")] + public string TranslatedAddress {get; set; } /// /// Gets or sets the translated port for this NAT rule. /// - [JsonProperty(PropertyName = "translatedPort")] - public string TranslatedPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "translatedPort")] + public string TranslatedPort {get; set; } /// /// Gets or sets the translated FQDN for this NAT rule. /// - [JsonProperty(PropertyName = "translatedFqdn")] - public string TranslatedFqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "translatedFqdn")] + public string TranslatedFqdn {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollection.cs index 01ffee90b3fd..cb23fd4318ee 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NAT rule collection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureFirewallNatRuleCollection : SubResource { /// - /// Initializes a new instance of the AzureFirewallNatRuleCollection - /// class. + /// Initializes a new instance of the AzureFirewallNatRuleCollection class. /// public AzureFirewallNatRuleCollection() { @@ -33,33 +22,40 @@ public AzureFirewallNatRuleCollection() } /// - /// Initializes a new instance of the AzureFirewallNatRuleCollection - /// class. + /// Initializes a new instance of the AzureFirewallNatRuleCollection class. /// - /// Resource ID. - /// Priority of the NAT rule collection - /// resource. - /// The action type of a NAT rule - /// collection. - /// Collection of rules used by a NAT rule - /// collection. - /// The provisioning state of the NAT - /// rule collection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the Azure firewall. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public AzureFirewallNatRuleCollection(string id = default(string), int? priority = default(int?), AzureFirewallNatRCAction action = default(AzureFirewallNatRCAction), IList rules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the Azure firewall. This + /// name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the NAT rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Priority of the NAT rule collection resource. + /// + + /// The action type of a NAT rule collection. + /// + + /// Collection of rules used by a NAT rule collection. + /// + public AzureFirewallNatRuleCollection(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), int? priority = default(int?), AzureFirewallNatRCAction action = default(AzureFirewallNatRCAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(id) { - Priority = priority; - Action = action; - Rules = rules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Priority = priority; + this.Action = action; + this.Rules = rules; CustomInit(); } @@ -68,65 +64,68 @@ public AzureFirewallNatRuleCollection() /// partial void CustomInit(); + /// - /// Gets or sets priority of the NAT rule collection resource. + /// Gets or sets the name of the resource that is unique within the Azure + /// firewall. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the action type of a NAT rule collection. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.action")] - public AzureFirewallNatRCAction Action { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets collection of rules used by a NAT rule collection. + /// Gets the provisioning state of the NAT rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the NAT rule collection resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets priority of the NAT rule collection resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets the name of the resource that is unique within the - /// Azure firewall. This name can be used to access the resource. + /// Gets or sets the action type of a NAT rule collection. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.action")] + public AzureFirewallNatRCAction Action {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets collection of rules used by a NAT rule collection. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority != null) + + + + if (this.Priority != null) { - if (Priority > 65000) + if (this.Priority > 65000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); } - if (Priority < 100) + if (this.Priority < 100) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollectionProperties.cs new file mode 100644 index 000000000000..cd4eb14d05e8 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNatRuleCollectionProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the NAT rule collection. + /// + public partial class AzureFirewallNatRuleCollectionProperties + { + /// + /// Initializes a new instance of the AzureFirewallNatRuleCollectionProperties class. + /// + public AzureFirewallNatRuleCollectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFirewallNatRuleCollectionProperties class. + /// + + /// Priority of the NAT rule collection resource. + /// + + /// The action type of a NAT rule collection. + /// + + /// Collection of rules used by a NAT rule collection. + /// + + /// The provisioning state of the NAT rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public AzureFirewallNatRuleCollectionProperties(int? priority = default(int?), AzureFirewallNatRCAction action = default(AzureFirewallNatRCAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Priority = priority; + this.Action = action; + this.Rules = rules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets priority of the NAT rule collection resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } + + /// + /// Gets or sets the action type of a NAT rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public AzureFirewallNatRCAction Action {get; set; } + + /// + /// Gets or sets collection of rules used by a NAT rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } + + /// + /// Gets the provisioning state of the NAT rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Priority != null) + { + if (this.Priority > 65000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (this.Priority < 100) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRule.cs index ff68b06b3b44..ffcf7dd3c4c1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,31 +23,45 @@ public AzureFirewallNetworkRule() /// /// Initializes a new instance of the AzureFirewallNetworkRule class. /// - /// Name of the network rule. - /// Description of the rule. - /// Array of - /// AzureFirewallNetworkRuleProtocols. - /// List of source IP addresses for this - /// rule. - /// List of destination IP - /// addresses. - /// List of destination ports. - /// List of destination FQDNs. - /// List of source IpGroups for this - /// rule. - /// List of destination IpGroups for - /// this rule. - public AzureFirewallNetworkRule(string name = default(string), string description = default(string), IList protocols = default(IList), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList destinationFqdns = default(IList), IList sourceIpGroups = default(IList), IList destinationIpGroups = default(IList)) + + /// Name of the network rule. + /// + + /// Description of the rule. + /// + + /// Array of AzureFirewallNetworkRuleProtocols. + /// + + /// List of source IP addresses for this rule. + /// + + /// List of destination IP addresses. + /// + + /// List of destination ports. + /// + + /// List of destination FQDNs. + /// + + /// List of source IpGroups for this rule. + /// + + /// List of destination IpGroups for this rule. + /// + public AzureFirewallNetworkRule(string name = default(string), string description = default(string), System.Collections.Generic.IList protocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationFqdns = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationIPGroups = default(System.Collections.Generic.IList)) + { - Name = name; - Description = description; - Protocols = protocols; - SourceAddresses = sourceAddresses; - DestinationAddresses = destinationAddresses; - DestinationPorts = destinationPorts; - DestinationFqdns = destinationFqdns; - SourceIpGroups = sourceIpGroups; - DestinationIpGroups = destinationIpGroups; + this.Name = name; + this.Description = description; + this.Protocols = protocols; + this.SourceAddresses = sourceAddresses; + this.DestinationAddresses = destinationAddresses; + this.DestinationPorts = destinationPorts; + this.DestinationFqdns = destinationFqdns; + this.SourceIPGroups = sourceIPGroups; + this.DestinationIPGroups = destinationIPGroups; CustomInit(); } @@ -64,59 +70,59 @@ public AzureFirewallNetworkRule() /// partial void CustomInit(); + /// /// Gets or sets name of the network rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets description of the rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets array of AzureFirewallNetworkRuleProtocols. /// - [JsonProperty(PropertyName = "protocols")] - public IList Protocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocols")] + public System.Collections.Generic.IList Protocols {get; set; } /// /// Gets or sets list of source IP addresses for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// /// Gets or sets list of destination IP addresses. /// - [JsonProperty(PropertyName = "destinationAddresses")] - public IList DestinationAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddresses")] + public System.Collections.Generic.IList DestinationAddresses {get; set; } /// /// Gets or sets list of destination ports. /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } /// /// Gets or sets list of destination FQDNs. /// - [JsonProperty(PropertyName = "destinationFqdns")] - public IList DestinationFqdns { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationFqdns")] + public System.Collections.Generic.IList DestinationFqdns {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } /// /// Gets or sets list of destination IpGroups for this rule. /// - [JsonProperty(PropertyName = "destinationIpGroups")] - public IList DestinationIpGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationIpGroups")] + public System.Collections.Generic.IList DestinationIPGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollection.cs index cb720dc5c385..f56bced7231b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network rule collection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureFirewallNetworkRuleCollection : SubResource { /// - /// Initializes a new instance of the - /// AzureFirewallNetworkRuleCollection class. + /// Initializes a new instance of the AzureFirewallNetworkRuleCollection class. /// public AzureFirewallNetworkRuleCollection() { @@ -33,32 +22,40 @@ public AzureFirewallNetworkRuleCollection() } /// - /// Initializes a new instance of the - /// AzureFirewallNetworkRuleCollection class. + /// Initializes a new instance of the AzureFirewallNetworkRuleCollection class. /// - /// Resource ID. - /// Priority of the network rule collection - /// resource. - /// The action type of a rule collection. - /// Collection of rules used by a network rule - /// collection. - /// The provisioning state of the - /// network rule collection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the Azure firewall. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public AzureFirewallNetworkRuleCollection(string id = default(string), int? priority = default(int?), AzureFirewallRCAction action = default(AzureFirewallRCAction), IList rules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the Azure firewall. This + /// name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the network rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Priority of the network rule collection resource. + /// + + /// The action type of a rule collection. + /// + + /// Collection of rules used by a network rule collection. + /// + public AzureFirewallNetworkRuleCollection(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), int? priority = default(int?), AzureFirewallRCAction action = default(AzureFirewallRCAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(id) { - Priority = priority; - Action = action; - Rules = rules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Priority = priority; + this.Action = action; + this.Rules = rules; CustomInit(); } @@ -67,65 +64,68 @@ public AzureFirewallNetworkRuleCollection() /// partial void CustomInit(); + /// - /// Gets or sets priority of the network rule collection resource. + /// Gets or sets the name of the resource that is unique within the Azure + /// firewall. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the action type of a rule collection. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.action")] - public AzureFirewallRCAction Action { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets collection of rules used by a network rule collection. + /// Gets the provisioning state of the network rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the network rule collection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets priority of the network rule collection resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets the name of the resource that is unique within the - /// Azure firewall. This name can be used to access the resource. + /// Gets or sets the action type of a rule collection. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.action")] + public AzureFirewallRCAction Action {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets collection of rules used by a network rule collection. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority != null) + + + + if (this.Priority != null) { - if (Priority > 65000) + if (this.Priority > 65000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); } - if (Priority < 100) + if (this.Priority < 100) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollectionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollectionPropertiesFormat.cs new file mode 100644 index 000000000000..9863e966eb73 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleCollectionPropertiesFormat.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the network rule collection. + /// + public partial class AzureFirewallNetworkRuleCollectionPropertiesFormat + { + /// + /// Initializes a new instance of the AzureFirewallNetworkRuleCollectionPropertiesFormat class. + /// + public AzureFirewallNetworkRuleCollectionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFirewallNetworkRuleCollectionPropertiesFormat class. + /// + + /// Priority of the network rule collection resource. + /// + + /// The action type of a rule collection. + /// + + /// Collection of rules used by a network rule collection. + /// + + /// The provisioning state of the network rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public AzureFirewallNetworkRuleCollectionPropertiesFormat(int? priority = default(int?), AzureFirewallRCAction action = default(AzureFirewallRCAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Priority = priority; + this.Action = action; + this.Rules = rules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets priority of the network rule collection resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } + + /// + /// Gets or sets the action type of a rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public AzureFirewallRCAction Action {get; set; } + + /// + /// Gets or sets collection of rules used by a network rule collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } + + /// + /// Gets the provisioning state of the network rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Priority != null) + { + if (this.Priority > 65000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (this.Priority < 100) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleProtocol.cs index b1acae7f47e0..4d82eac6b57d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallNetworkRuleProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,11 +9,13 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallNetworkRuleProtocol. /// + + public static class AzureFirewallNetworkRuleProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; public const string Any = "Any"; - public const string ICMP = "ICMP"; + public const string Icmp = "ICMP"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlags.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlags.cs index 40ebc9f8653a..6d771d0ce122 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlags.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlags.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureFirewallPacketCaptureFlags { /// - /// Initializes a new instance of the AzureFirewallPacketCaptureFlags - /// class. + /// Initializes a new instance of the AzureFirewallPacketCaptureFlags class. /// public AzureFirewallPacketCaptureFlags() { @@ -28,14 +21,15 @@ public AzureFirewallPacketCaptureFlags() } /// - /// Initializes a new instance of the AzureFirewallPacketCaptureFlags - /// class. + /// Initializes a new instance of the AzureFirewallPacketCaptureFlags class. /// - /// Flags to capture. Possible values include: - /// 'fin', 'syn', 'rst', 'push', 'ack', 'urg' + + /// Flags to capture + /// Possible values include: 'fin', 'syn', 'rst', 'push', 'ack', 'urg' public AzureFirewallPacketCaptureFlags(string type = default(string)) + { - Type = type; + this.Type = type; CustomInit(); } @@ -44,12 +38,11 @@ public AzureFirewallPacketCaptureFlags() /// partial void CustomInit(); + /// - /// Gets or sets flags to capture. Possible values include: 'fin', - /// 'syn', 'rst', 'push', 'ack', 'urg' + /// Gets or sets flags to capture Possible values include: 'fin', 'syn', 'rst', 'push', 'ack', 'urg' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlagsType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlagsType.cs index 4272a0584c2e..08757affb9d3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlagsType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureFlagsType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallPacketCaptureFlagsType. /// + + public static class AzureFirewallPacketCaptureFlagsType { public const string Fin = "fin"; @@ -23,4 +20,4 @@ public static class AzureFirewallPacketCaptureFlagsType public const string Ack = "ack"; public const string Urg = "urg"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureRule.cs index cb71cb94bd06..2dbf36641516 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPacketCaptureRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureFirewallPacketCaptureRule { /// - /// Initializes a new instance of the AzureFirewallPacketCaptureRule - /// class. + /// Initializes a new instance of the AzureFirewallPacketCaptureRule class. /// public AzureFirewallPacketCaptureRule() { @@ -30,20 +21,23 @@ public AzureFirewallPacketCaptureRule() } /// - /// Initializes a new instance of the AzureFirewallPacketCaptureRule - /// class. + /// Initializes a new instance of the AzureFirewallPacketCaptureRule class. /// - /// List of source IP addresses/subnets to be - /// captured. - /// List of destination IP addresses/subnets - /// to be captured. - /// List of ports to be - /// captured. - public AzureFirewallPacketCaptureRule(IList sources = default(IList), IList destinations = default(IList), IList destinationPorts = default(IList)) + + /// List of source IP addresses/subnets to be captured. + /// + + /// List of destination IP addresses/subnets to be captured. + /// + + /// List of ports to be captured. + /// + public AzureFirewallPacketCaptureRule(System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList)) + { - Sources = sources; - Destinations = destinations; - DestinationPorts = destinationPorts; + this.Sources = sources; + this.Destinations = destinations; + this.DestinationPorts = destinationPorts; CustomInit(); } @@ -52,24 +46,23 @@ public AzureFirewallPacketCaptureRule() /// partial void CustomInit(); + /// /// Gets or sets list of source IP addresses/subnets to be captured. /// - [JsonProperty(PropertyName = "sources")] - public IList Sources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sources")] + public System.Collections.Generic.IList Sources {get; set; } /// - /// Gets or sets list of destination IP addresses/subnets to be - /// captured. + /// Gets or sets list of destination IP addresses/subnets to be captured. /// - [JsonProperty(PropertyName = "destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Gets or sets list of ports to be captured. /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPropertiesFormat.cs new file mode 100644 index 000000000000..b9671b56c9eb --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPropertiesFormat.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the Azure Firewall. + /// + public partial class AzureFirewallPropertiesFormat + { + /// + /// Initializes a new instance of the AzureFirewallPropertiesFormat class. + /// + public AzureFirewallPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFirewallPropertiesFormat class. + /// + + /// Collection of application rule collections used by Azure Firewall. + /// + + /// Collection of NAT rule collections used by Azure Firewall. + /// + + /// Collection of network rule collections used by Azure Firewall. + /// + + /// IP configuration of the Azure Firewall resource. + /// + + /// IP configuration of the Azure Firewall used for management traffic. + /// + + /// The provisioning state of the Azure firewall resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The operation mode for Threat Intelligence. + /// Possible values include: 'Alert', 'Deny', 'Off' + + /// The virtualHub to which the firewall belongs. + /// + + /// The firewallPolicy associated with this azure firewall. + /// + + /// IP addresses associated with AzureFirewall. + /// + + /// IpGroups associated with AzureFirewall. + /// + + /// The Azure Firewall Resource SKU. + /// + + /// The additional properties used to further config this azure firewall. + /// + public AzureFirewallPropertiesFormat(System.Collections.Generic.IList applicationRuleCollections = default(System.Collections.Generic.IList), System.Collections.Generic.IList natRuleCollections = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkRuleCollections = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), AzureFirewallIPConfiguration managementIPConfiguration = default(AzureFirewallIPConfiguration), string provisioningState = default(string), string threatIntelMode = default(string), SubResource virtualHub = default(SubResource), SubResource firewallPolicy = default(SubResource), HubIPAddresses hubIPAddresses = default(HubIPAddresses), System.Collections.Generic.IList ipGroups = default(System.Collections.Generic.IList), AzureFirewallSku sku = default(AzureFirewallSku), System.Collections.Generic.IDictionary additionalProperties = default(System.Collections.Generic.IDictionary)) + + { + this.ApplicationRuleCollections = applicationRuleCollections; + this.NatRuleCollections = natRuleCollections; + this.NetworkRuleCollections = networkRuleCollections; + this.IPConfigurations = ipConfigurations; + this.ManagementIPConfiguration = managementIPConfiguration; + this.ProvisioningState = provisioningState; + this.ThreatIntelMode = threatIntelMode; + this.VirtualHub = virtualHub; + this.FirewallPolicy = firewallPolicy; + this.HubIPAddresses = hubIPAddresses; + this.IPGroups = ipGroups; + this.Sku = sku; + this.AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets collection of application rule collections used by Azure + /// Firewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationRuleCollections")] + public System.Collections.Generic.IList ApplicationRuleCollections {get; set; } + + /// + /// Gets or sets collection of NAT rule collections used by Azure Firewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "natRuleCollections")] + public System.Collections.Generic.IList NatRuleCollections {get; set; } + + /// + /// Gets or sets collection of network rule collections used by Azure Firewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkRuleCollections")] + public System.Collections.Generic.IList NetworkRuleCollections {get; set; } + + /// + /// Gets or sets iP configuration of the Azure Firewall resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets or sets iP configuration of the Azure Firewall used for management + /// traffic. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managementIpConfiguration")] + public AzureFirewallIPConfiguration ManagementIPConfiguration {get; set; } + + /// + /// Gets the provisioning state of the Azure firewall resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatIntelMode")] + public string ThreatIntelMode {get; set; } + + /// + /// Gets or sets the virtualHub to which the firewall belongs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHub")] + public SubResource VirtualHub {get; set; } + + /// + /// Gets or sets the firewallPolicy associated with this azure firewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallPolicy")] + public SubResource FirewallPolicy {get; set; } + + /// + /// Gets or sets iP addresses associated with AzureFirewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hubIPAddresses")] + public HubIPAddresses HubIPAddresses {get; set; } + + /// + /// Gets ipGroups associated with AzureFirewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipGroups")] + public System.Collections.Generic.IList IPGroups {get; private set; } + + /// + /// Gets or sets the Azure Firewall Resource SKU. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public AzureFirewallSku Sku {get; set; } + + /// + /// Gets or sets the additional properties used to further config this azure + /// firewall. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalProperties")] + public System.Collections.Generic.IDictionary AdditionalProperties {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPublicIPAddress.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPublicIPAddress.cs index eacd1bf90222..f53e58f512be 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPublicIPAddress.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallPublicIPAddress.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureFirewallPublicIPAddress { /// - /// Initializes a new instance of the AzureFirewallPublicIPAddress - /// class. + /// Initializes a new instance of the AzureFirewallPublicIPAddress class. /// public AzureFirewallPublicIPAddress() { @@ -28,13 +21,15 @@ public AzureFirewallPublicIPAddress() } /// - /// Initializes a new instance of the AzureFirewallPublicIPAddress - /// class. + /// Initializes a new instance of the AzureFirewallPublicIPAddress class. /// - /// Public IP Address value. + + /// Public IP Address value. + /// public AzureFirewallPublicIPAddress(string address = default(string)) + { - Address = address; + this.Address = address; CustomInit(); } @@ -43,11 +38,11 @@ public AzureFirewallPublicIPAddress() /// partial void CustomInit(); + /// /// Gets or sets public IP Address value. /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCAction.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCAction.cs index c9c0875f1e52..e2bbb9cd4e80 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCAction.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCAction.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public AzureFirewallRCAction() /// /// Initializes a new instance of the AzureFirewallRCAction class. /// - /// The type of action. Possible values include: - /// 'Allow', 'Deny' + + /// The type of action. + /// Possible values include: 'Allow', 'Deny' public AzureFirewallRCAction(string type = default(string)) + { - Type = type; + this.Type = type; CustomInit(); } @@ -42,12 +38,11 @@ public AzureFirewallRCAction() /// partial void CustomInit(); + /// - /// Gets or sets the type of action. Possible values include: 'Allow', - /// 'Deny' + /// Gets or sets the type of action. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCActionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCActionType.cs index 9539421fd106..194a85b42d62 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCActionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallRCActionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallRCActionType. /// + + public static class AzureFirewallRCActionType { public const string Allow = "Allow"; public const string Deny = "Deny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSku.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSku.cs index 5d76f2608be0..333935f93db3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public AzureFirewallSku() /// /// Initializes a new instance of the AzureFirewallSku class. /// - /// Name of an Azure Firewall SKU. Possible values - /// include: 'AZFW_VNet', 'AZFW_Hub' - /// Tier of an Azure Firewall. Possible values - /// include: 'Standard', 'Premium', 'Basic' + + /// Name of an Azure Firewall SKU. + /// Possible values include: 'AZFW_VNet', 'AZFW_Hub' + + /// Tier of an Azure Firewall. + /// Possible values include: 'Standard', 'Premium', 'Basic' public AzureFirewallSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -45,19 +42,17 @@ public AzureFirewallSku() /// partial void CustomInit(); + /// - /// Gets or sets name of an Azure Firewall SKU. Possible values - /// include: 'AZFW_VNet', 'AZFW_Hub' + /// Gets or sets name of an Azure Firewall SKU. Possible values include: 'AZFW_VNet', 'AZFW_Hub' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets tier of an Azure Firewall. Possible values include: - /// 'Standard', 'Premium', 'Basic' + /// Gets or sets tier of an Azure Firewall. Possible values include: 'Standard', 'Premium', 'Basic' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuName.cs index cc38d856ac18..32760aaaeb1f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallSkuName. /// + + public static class AzureFirewallSkuName { - public const string AZFWVNet = "AZFW_VNet"; - public const string AZFWHub = "AZFW_Hub"; + public const string AzfwVnet = "AZFW_VNet"; + public const string AzfwHub = "AZFW_Hub"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuTier.cs index d1cd7fcdedff..b4f82647441e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallSkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallSkuTier. /// + + public static class AzureFirewallSkuTier { public const string Standard = "Standard"; public const string Premium = "Premium"; public const string Basic = "Basic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallThreatIntelMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallThreatIntelMode.cs index 82b0ea59bebd..df5439db533e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallThreatIntelMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallThreatIntelMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for AzureFirewallThreatIntelMode. /// + + public static class AzureFirewallThreatIntelMode { public const string Alert = "Alert"; public const string Deny = "Deny"; public const string Off = "Off"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallsPacketCaptureHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallsPacketCaptureHeaders.cs index 6e88e750edfa..69adcd7abc28 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallsPacketCaptureHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureFirewallsPacketCaptureHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for PacketCapture operation. - /// public partial class AzureFirewallsPacketCaptureHeaders { /// - /// Initializes a new instance of the - /// AzureFirewallsPacketCaptureHeaders class. + /// Initializes a new instance of the AzureFirewallsPacketCaptureHeaders class. /// public AzureFirewallsPacketCaptureHeaders() { @@ -28,12 +18,15 @@ public AzureFirewallsPacketCaptureHeaders() } /// - /// Initializes a new instance of the - /// AzureFirewallsPacketCaptureHeaders class. + /// Initializes a new instance of the AzureFirewallsPacketCaptureHeaders class. /// + + /// + /// public AzureFirewallsPacketCaptureHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public AzureFirewallsPacketCaptureHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReport.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReport.cs index fdec1e701c97..2bb56103329f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReport.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReport.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,17 +23,22 @@ public AzureReachabilityReport() /// /// Initializes a new instance of the AzureReachabilityReport class. /// - /// The aggregation level of Azure - /// reachability report. Can be Country, State or City. - /// Parameters that define a geographic - /// location. - /// List of Azure reachability report - /// items. - public AzureReachabilityReport(string aggregationLevel, AzureReachabilityReportLocation providerLocation, IList reachabilityReport) + + /// The aggregation level of Azure reachability report. Can be Country, State + /// or City. + /// + + /// Parameters that define a geographic location. + /// + + /// List of Azure reachability report items. + /// + public AzureReachabilityReport(string aggregationLevel, AzureReachabilityReportLocation providerLocation, System.Collections.Generic.IList reachabilityReport) + { - AggregationLevel = aggregationLevel; - ProviderLocation = providerLocation; - ReachabilityReport = reachabilityReport; + this.AggregationLevel = aggregationLevel; + this.ProviderLocation = providerLocation; + this.ReachabilityReport = reachabilityReport; CustomInit(); } @@ -51,49 +47,51 @@ public AzureReachabilityReport(string aggregationLevel, AzureReachabilityReportL /// partial void CustomInit(); + /// - /// Gets or sets the aggregation level of Azure reachability report. - /// Can be Country, State or City. + /// Gets or sets the aggregation level of Azure reachability report. Can be + /// Country, State or City. /// - [JsonProperty(PropertyName = "aggregationLevel")] - public string AggregationLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregationLevel")] + public string AggregationLevel {get; set; } /// /// Gets or sets parameters that define a geographic location. /// - [JsonProperty(PropertyName = "providerLocation")] - public AzureReachabilityReportLocation ProviderLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "providerLocation")] + public AzureReachabilityReportLocation ProviderLocation {get; set; } /// /// Gets or sets list of Azure reachability report items. /// - [JsonProperty(PropertyName = "reachabilityReport")] - public IList ReachabilityReport { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "reachabilityReport")] + public System.Collections.Generic.IList ReachabilityReport {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (AggregationLevel == null) + if (this.AggregationLevel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "AggregationLevel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AggregationLevel"); } - if (ProviderLocation == null) + if (this.ProviderLocation == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ProviderLocation"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ProviderLocation"); } - if (ReachabilityReport == null) + if (this.ReachabilityReport == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ReachabilityReport"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ReachabilityReport"); } - if (ProviderLocation != null) + + if (this.ProviderLocation != null) { - ProviderLocation.Validate(); + this.ProviderLocation.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportItem.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportItem.cs index c0b78dbca285..e8869c91f27b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportItem.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportItem.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureReachabilityReportItem { /// - /// Initializes a new instance of the AzureReachabilityReportItem - /// class. + /// Initializes a new instance of the AzureReachabilityReportItem class. /// public AzureReachabilityReportItem() { @@ -30,18 +21,23 @@ public AzureReachabilityReportItem() } /// - /// Initializes a new instance of the AzureReachabilityReportItem - /// class. + /// Initializes a new instance of the AzureReachabilityReportItem class. /// - /// The Internet service provider. - /// The Azure region. - /// List of latency details for each of the - /// time series. - public AzureReachabilityReportItem(string provider = default(string), string azureLocation = default(string), IList latencies = default(IList)) + + /// The Internet service provider. + /// + + /// The Azure region. + /// + + /// List of latency details for each of the time series. + /// + public AzureReachabilityReportItem(string provider = default(string), string azureLocation = default(string), System.Collections.Generic.IList latencies = default(System.Collections.Generic.IList)) + { - Provider = provider; - AzureLocation = azureLocation; - Latencies = latencies; + this.Provider = provider; + this.AzureLocation = azureLocation; + this.Latencies = latencies; CustomInit(); } @@ -50,23 +46,23 @@ public AzureReachabilityReportItem() /// partial void CustomInit(); + /// /// Gets or sets the Internet service provider. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets the Azure region. /// - [JsonProperty(PropertyName = "azureLocation")] - public string AzureLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "azureLocation")] + public string AzureLocation {get; set; } /// /// Gets or sets list of latency details for each of the time series. /// - [JsonProperty(PropertyName = "latencies")] - public IList Latencies { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "latencies")] + public System.Collections.Generic.IList Latencies {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLatencyInfo.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLatencyInfo.cs index da00b97ff30c..87855b4f35d6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLatencyInfo.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLatencyInfo.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureReachabilityReportLatencyInfo { /// - /// Initializes a new instance of the - /// AzureReachabilityReportLatencyInfo class. + /// Initializes a new instance of the AzureReachabilityReportLatencyInfo class. /// public AzureReachabilityReportLatencyInfo() { @@ -29,16 +21,20 @@ public AzureReachabilityReportLatencyInfo() } /// - /// Initializes a new instance of the - /// AzureReachabilityReportLatencyInfo class. + /// Initializes a new instance of the AzureReachabilityReportLatencyInfo class. /// - /// The time stamp. - /// The relative latency score between 1 and 100, - /// higher values indicating a faster connection. + + /// The time stamp. + /// + + /// The relative latency score between 1 and 100, higher values indicating a + /// faster connection. + /// public AzureReachabilityReportLatencyInfo(System.DateTime? timeStamp = default(System.DateTime?), int? score = default(int?)) + { - TimeStamp = timeStamp; - Score = score; + this.TimeStamp = timeStamp; + this.Score = score; CustomInit(); } @@ -47,38 +43,38 @@ public AzureReachabilityReportLatencyInfo() /// partial void CustomInit(); + /// /// Gets or sets the time stamp. /// - [JsonProperty(PropertyName = "timeStamp")] - public System.DateTime? TimeStamp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeStamp")] + public System.DateTime? TimeStamp {get; set; } /// - /// Gets or sets the relative latency score between 1 and 100, higher - /// values indicating a faster connection. + /// Gets or sets the relative latency score between 1 and 100, higher values + /// indicating a faster connection. /// - [JsonProperty(PropertyName = "score")] - public int? Score { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "score")] + public int? Score {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Score != null) + if (this.Score != null) { - if (Score > 100) + if (this.Score > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Score", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Score", 100); } - if (Score < 1) + if (this.Score < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Score", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Score", 1); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLocation.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLocation.cs index 1cdb5617926e..128f112d53c2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLocation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportLocation.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureReachabilityReportLocation { /// - /// Initializes a new instance of the AzureReachabilityReportLocation - /// class. + /// Initializes a new instance of the AzureReachabilityReportLocation class. /// public AzureReachabilityReportLocation() { @@ -29,17 +21,23 @@ public AzureReachabilityReportLocation() } /// - /// Initializes a new instance of the AzureReachabilityReportLocation - /// class. + /// Initializes a new instance of the AzureReachabilityReportLocation class. /// - /// The name of the country. - /// The name of the state. - /// The name of the city or town. + + /// The name of the country. + /// + + /// The name of the state. + /// + + /// The name of the city or town. + /// public AzureReachabilityReportLocation(string country, string state = default(string), string city = default(string)) + { - Country = country; - State = state; - City = city; + this.Country = country; + this.State = state; + this.City = city; CustomInit(); } @@ -48,36 +46,39 @@ public AzureReachabilityReportLocation() /// partial void CustomInit(); + /// /// Gets or sets the name of the country. /// - [JsonProperty(PropertyName = "country")] - public string Country { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "country")] + public string Country {get; set; } /// /// Gets or sets the name of the state. /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// /// Gets or sets the name of the city or town. /// - [JsonProperty(PropertyName = "city")] - public string City { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "city")] + public string City {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Country == null) + if (this.Country == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Country"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Country"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportParameters.cs index dea53301d726..9ad4b83d9c29 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureReachabilityReportParameters.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class AzureReachabilityReportParameters { /// - /// Initializes a new instance of the AzureReachabilityReportParameters - /// class. + /// Initializes a new instance of the AzureReachabilityReportParameters class. /// public AzureReachabilityReportParameters() { @@ -31,25 +21,31 @@ public AzureReachabilityReportParameters() } /// - /// Initializes a new instance of the AzureReachabilityReportParameters - /// class. + /// Initializes a new instance of the AzureReachabilityReportParameters class. /// - /// Parameters that define a geographic - /// location. - /// The start time for the Azure reachability - /// report. - /// The end time for the Azure reachability - /// report. - /// List of Internet service providers. - /// Optional Azure regions to scope the - /// query to. - public AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, System.DateTime startTime, System.DateTime endTime, IList providers = default(IList), IList azureLocations = default(IList)) + + /// Parameters that define a geographic location. + /// + + /// List of Internet service providers. + /// + + /// Optional Azure regions to scope the query to. + /// + + /// The start time for the Azure reachability report. + /// + + /// The end time for the Azure reachability report. + /// + public AzureReachabilityReportParameters(AzureReachabilityReportLocation providerLocation, System.DateTime startTime, System.DateTime endTime, System.Collections.Generic.IList providers = default(System.Collections.Generic.IList), System.Collections.Generic.IList azureLocations = default(System.Collections.Generic.IList)) + { - ProviderLocation = providerLocation; - Providers = providers; - AzureLocations = azureLocations; - StartTime = startTime; - EndTime = endTime; + this.ProviderLocation = providerLocation; + this.Providers = providers; + this.AzureLocations = azureLocations; + this.StartTime = startTime; + this.EndTime = endTime; CustomInit(); } @@ -58,52 +54,54 @@ public AzureReachabilityReportParameters() /// partial void CustomInit(); + /// /// Gets or sets parameters that define a geographic location. /// - [JsonProperty(PropertyName = "providerLocation")] - public AzureReachabilityReportLocation ProviderLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "providerLocation")] + public AzureReachabilityReportLocation ProviderLocation {get; set; } /// /// Gets or sets list of Internet service providers. /// - [JsonProperty(PropertyName = "providers")] - public IList Providers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "providers")] + public System.Collections.Generic.IList Providers {get; set; } /// /// Gets or sets optional Azure regions to scope the query to. /// - [JsonProperty(PropertyName = "azureLocations")] - public IList AzureLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "azureLocations")] + public System.Collections.Generic.IList AzureLocations {get; set; } /// /// Gets or sets the start time for the Azure reachability report. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime StartTime {get; set; } /// /// Gets or sets the end time for the Azure reachability report. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime EndTime { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime EndTime {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ProviderLocation == null) + if (this.ProviderLocation == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ProviderLocation"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ProviderLocation"); } - if (ProviderLocation != null) + if (this.ProviderLocation != null) { - ProviderLocation.Validate(); + this.ProviderLocation.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategory.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategory.cs index 3c2df782911e..6558e44f707b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategory.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategory.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Azure Web Category Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AzureWebCategory { /// @@ -32,20 +24,29 @@ public AzureWebCategory() /// /// Initializes a new instance of the AzureWebCategory class. /// - /// The name of the group that the category belongs - /// to. - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public AzureWebCategory(string group = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The name of the group that the category belongs to. + /// + public AzureWebCategory(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string group = default(string)) + { - Group = group; - Id = id; - Name = name; - Type = type; - Etag = etag; + this.Id = id; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.Group = group; CustomInit(); } @@ -54,36 +55,36 @@ public AzureWebCategory() /// partial void CustomInit(); - /// - /// Gets the name of the group that the category belongs to. - /// - [JsonProperty(PropertyName = "properties.group")] - public string Group { get; private set; } /// /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + /// + /// Gets the name of the group that the category belongs to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.group")] + public string Group {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategoryPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategoryPropertiesFormat.cs new file mode 100644 index 000000000000..0f4d067e94af --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/AzureWebCategoryPropertiesFormat.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Azure Web Category Properties. + /// + public partial class AzureWebCategoryPropertiesFormat + { + /// + /// Initializes a new instance of the AzureWebCategoryPropertiesFormat class. + /// + public AzureWebCategoryPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWebCategoryPropertiesFormat class. + /// + + /// The name of the group that the category belongs to. + /// + public AzureWebCategoryPropertiesFormat(string group = default(string)) + + { + this.Group = group; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the group that the category belongs to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "group")] + public string Group {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BGPCommunity.cs b/src/Network/Network.Management.Sdk/Generated/Models/BGPCommunity.cs index 6a1cb121447e..736150baa9d3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BGPCommunity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BGPCommunity.cs @@ -1,23 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Contains bgp community information offered in Service Community - /// resources. + /// Contains bgp community information offered in Service Community resources. /// public partial class BGPCommunity { @@ -32,27 +23,34 @@ public BGPCommunity() /// /// Initializes a new instance of the BGPCommunity class. /// - /// The region which the service - /// support. e.g. For O365, region is Global. - /// The name of the bgp community. e.g. - /// Skype. - /// The value of the bgp community. For - /// more information: - /// https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - /// The prefixes that the bgp community - /// contains. - /// Customer is authorized to use bgp - /// community or not. - /// The service group of the bgp community - /// contains. - public BGPCommunity(string serviceSupportedRegion = default(string), string communityName = default(string), string communityValue = default(string), IList communityPrefixes = default(IList), bool? isAuthorizedToUse = default(bool?), string serviceGroup = default(string)) + + /// The region which the service support. e.g. For O365, region is Global. + /// + + /// The name of the bgp community. e.g. Skype. + /// + + /// The value of the bgp community. For more information: + /// https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + /// + + /// The prefixes that the bgp community contains. + /// + + /// Customer is authorized to use bgp community or not. + /// + + /// The service group of the bgp community contains. + /// + public BGPCommunity(string serviceSupportedRegion = default(string), string communityName = default(string), string communityValue = default(string), System.Collections.Generic.IList communityPrefixes = default(System.Collections.Generic.IList), bool? isAuthorizedToUse = default(bool?), string serviceGroup = default(string)) + { - ServiceSupportedRegion = serviceSupportedRegion; - CommunityName = communityName; - CommunityValue = communityValue; - CommunityPrefixes = communityPrefixes; - IsAuthorizedToUse = isAuthorizedToUse; - ServiceGroup = serviceGroup; + this.ServiceSupportedRegion = serviceSupportedRegion; + this.CommunityName = communityName; + this.CommunityValue = communityValue; + this.CommunityPrefixes = communityPrefixes; + this.IsAuthorizedToUse = isAuthorizedToUse; + this.ServiceGroup = serviceGroup; CustomInit(); } @@ -61,43 +59,43 @@ public BGPCommunity() /// partial void CustomInit(); + /// - /// Gets or sets the region which the service support. e.g. For O365, - /// region is Global. + /// Gets or sets the region which the service support. e.g. For O365, region is + /// Global. /// - [JsonProperty(PropertyName = "serviceSupportedRegion")] - public string ServiceSupportedRegion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceSupportedRegion")] + public string ServiceSupportedRegion {get; set; } /// /// Gets or sets the name of the bgp community. e.g. Skype. /// - [JsonProperty(PropertyName = "communityName")] - public string CommunityName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "communityName")] + public string CommunityName {get; set; } /// /// Gets or sets the value of the bgp community. For more information: /// https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. /// - [JsonProperty(PropertyName = "communityValue")] - public string CommunityValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "communityValue")] + public string CommunityValue {get; set; } /// /// Gets or sets the prefixes that the bgp community contains. /// - [JsonProperty(PropertyName = "communityPrefixes")] - public IList CommunityPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "communityPrefixes")] + public System.Collections.Generic.IList CommunityPrefixes {get; set; } /// /// Gets or sets customer is authorized to use bgp community or not. /// - [JsonProperty(PropertyName = "isAuthorizedToUse")] - public bool? IsAuthorizedToUse { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isAuthorizedToUse")] + public bool? IsAuthorizedToUse {get; set; } /// /// Gets or sets the service group of the bgp community contains. /// - [JsonProperty(PropertyName = "serviceGroup")] - public string ServiceGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceGroup")] + public string ServiceGroup {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressInboundNatRulePortMappings.cs b/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressInboundNatRulePortMappings.cs index 118c44fbd125..c6f8cdaa5d7d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressInboundNatRulePortMappings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressInboundNatRulePortMappings.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class BackendAddressInboundNatRulePortMappings { /// - /// Initializes a new instance of the - /// BackendAddressInboundNatRulePortMappings class. + /// Initializes a new instance of the BackendAddressInboundNatRulePortMappings class. /// public BackendAddressInboundNatRulePortMappings() { @@ -30,14 +21,15 @@ public BackendAddressInboundNatRulePortMappings() } /// - /// Initializes a new instance of the - /// BackendAddressInboundNatRulePortMappings class. + /// Initializes a new instance of the BackendAddressInboundNatRulePortMappings class. /// - /// Collection of inbound NAT - /// rule port mappings. - public BackendAddressInboundNatRulePortMappings(IList inboundNatRulePortMappings = default(IList)) + + /// Collection of inbound NAT rule port mappings. + /// + public BackendAddressInboundNatRulePortMappings(System.Collections.Generic.IList inboundNatRulePortMappings = default(System.Collections.Generic.IList)) + { - InboundNatRulePortMappings = inboundNatRulePortMappings; + this.InboundNatRulePortMappings = inboundNatRulePortMappings; CustomInit(); } @@ -46,11 +38,11 @@ public BackendAddressInboundNatRulePortMappings() /// partial void CustomInit(); + /// /// Gets or sets collection of inbound NAT rule port mappings. /// - [JsonProperty(PropertyName = "inboundNatRulePortMappings")] - public IList InboundNatRulePortMappings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRulePortMappings")] + public System.Collections.Generic.IList InboundNatRulePortMappings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPool.cs b/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPool.cs index 013188628f3e..f39573b3fce1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPool.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPool.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Pool of backend IP addresses. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BackendAddressPool : SubResource { /// @@ -34,58 +24,79 @@ public BackendAddressPool() /// /// Initializes a new instance of the BackendAddressPool class. /// - /// Resource ID. - /// The location of the backend address - /// pool. - /// An array of gateway load balancer - /// tunnel interfaces. - /// An array of backend - /// addresses. - /// An array of references to IP - /// addresses defined in network interfaces. - /// An array of references to load - /// balancing rules that use this backend address pool. - /// A reference to an outbound rule that - /// uses this backend address pool. - /// An array of references to outbound - /// rules that use this backend address pool. - /// An array of references to inbound NAT - /// rules that use this backend address pool. - /// The provisioning state of the - /// backend address pool resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Amount of seconds Load Balancer - /// waits for before sending RESET to client and backend - /// address. - /// A reference to a virtual - /// network. - /// Backend address synchronous mode for the - /// backend pool. Possible values include: 'Automatic', - /// 'Manual' - /// The name of the resource that is unique within - /// the set of backend address pools used by the load balancer. This - /// name can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public BackendAddressPool(string id = default(string), string location = default(string), IList tunnelInterfaces = default(IList), IList loadBalancerBackendAddresses = default(IList), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundRule = default(SubResource), IList outboundRules = default(IList), IList inboundNatRules = default(IList), string provisioningState = default(string), int? drainPeriodInSeconds = default(int?), SubResource virtualNetwork = default(SubResource), string syncMode = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of backend address + /// pools used by the load balancer. This name can be used to access the + /// resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the backend address pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Backend address synchronous mode for the backend pool + /// Possible values include: 'Automatic', 'Manual' + + /// The location of the backend address pool. + /// + + /// An array of gateway load balancer tunnel interfaces. + /// + + /// An array of backend addresses. + /// + + /// An array of references to IP addresses defined in network interfaces. + /// + + /// An array of references to load balancing rules that use this backend + /// address pool. + /// + + /// A reference to an outbound rule that uses this backend address pool. + /// + + /// An array of references to outbound rules that use this backend address + /// pool. + /// + + /// An array of references to inbound NAT rules that use this backend address + /// pool. + /// + + /// Amount of seconds Load Balancer waits for before sending RESET to client + /// and backend address. + /// + + /// A reference to a virtual network. + /// + public BackendAddressPool(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string syncMode = default(string), string location = default(string), System.Collections.Generic.IList tunnelInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), SubResource outboundRule = default(SubResource), System.Collections.Generic.IList outboundRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), int? drainPeriodInSeconds = default(int?), SubResource virtualNetwork = default(SubResource)) + + : base(id) { - Location = location; - TunnelInterfaces = tunnelInterfaces; - LoadBalancerBackendAddresses = loadBalancerBackendAddresses; - BackendIPConfigurations = backendIPConfigurations; - LoadBalancingRules = loadBalancingRules; - OutboundRule = outboundRule; - OutboundRules = outboundRules; - InboundNatRules = inboundNatRules; - ProvisioningState = provisioningState; - DrainPeriodInSeconds = drainPeriodInSeconds; - VirtualNetwork = virtualNetwork; - SyncMode = syncMode; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.SyncMode = syncMode; + this.Location = location; + this.TunnelInterfaces = tunnelInterfaces; + this.LoadBalancerBackendAddresses = loadBalancerBackendAddresses; + this.BackendIPConfigurations = backendIPConfigurations; + this.LoadBalancingRules = loadBalancingRules; + this.OutboundRule = outboundRule; + this.OutboundRules = outboundRules; + this.InboundNatRules = inboundNatRules; + this.DrainPeriodInSeconds = drainPeriodInSeconds; + this.VirtualNetwork = virtualNetwork; CustomInit(); } @@ -94,107 +105,102 @@ public BackendAddressPool() /// partial void CustomInit(); + /// - /// Gets or sets the location of the backend address pool. + /// Gets or sets the name of the resource that is unique within the set of + /// backend address pools used by the load balancer. This name can be used to + /// access the resource. /// - [JsonProperty(PropertyName = "properties.location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets an array of gateway load balancer tunnel interfaces. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.tunnelInterfaces")] - public IList TunnelInterfaces { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets an array of backend addresses. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.loadBalancerBackendAddresses")] - public IList LoadBalancerBackendAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets an array of references to IP addresses defined in network - /// interfaces. + /// Gets the provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public IList BackendIPConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets an array of references to load balancing rules that use this - /// backend address pool. + /// Gets or sets backend address synchronous mode for the backend pool Possible values include: 'Automatic', 'Manual' /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.syncMode")] + public string SyncMode {get; set; } /// - /// Gets a reference to an outbound rule that uses this backend address - /// pool. + /// Gets or sets the location of the backend address pool. /// - [JsonProperty(PropertyName = "properties.outboundRule")] - public SubResource OutboundRule { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.location")] + public string Location {get; set; } /// - /// Gets an array of references to outbound rules that use this backend - /// address pool. + /// Gets or sets an array of gateway load balancer tunnel interfaces. /// - [JsonProperty(PropertyName = "properties.outboundRules")] - public IList OutboundRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tunnelInterfaces")] + public System.Collections.Generic.IList TunnelInterfaces {get; set; } /// - /// Gets an array of references to inbound NAT rules that use this - /// backend address pool. + /// Gets or sets an array of backend addresses. /// - [JsonProperty(PropertyName = "properties.inboundNatRules")] - public IList InboundNatRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddresses")] + public System.Collections.Generic.IList LoadBalancerBackendAddresses {get; set; } /// - /// Gets the provisioning state of the backend address pool resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets an array of references to IP addresses defined in network interfaces. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfigurations")] + public System.Collections.Generic.IList BackendIPConfigurations {get; private set; } /// - /// Gets or sets amount of seconds Load Balancer waits for before - /// sending RESET to client and backend address. + /// Gets an array of references to load balancing rules that use this backend + /// address pool. /// - [JsonProperty(PropertyName = "properties.drainPeriodInSeconds")] - public int? DrainPeriodInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; private set; } /// - /// Gets or sets a reference to a virtual network. + /// Gets a reference to an outbound rule that uses this backend address pool. /// - [JsonProperty(PropertyName = "properties.virtualNetwork")] - public SubResource VirtualNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundRule")] + public SubResource OutboundRule {get; private set; } /// - /// Gets or sets backend address synchronous mode for the backend pool. - /// Possible values include: 'Automatic', 'Manual' + /// Gets an array of references to outbound rules that use this backend address + /// pool. /// - [JsonProperty(PropertyName = "properties.syncMode")] - public string SyncMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundRules")] + public System.Collections.Generic.IList OutboundRules {get; private set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of backend address pools used by the load balancer. This name can - /// be used to access the resource. + /// Gets an array of references to inbound NAT rules that use this backend + /// address pool. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets amount of seconds Load Balancer waits for before sending RESET + /// to client and backend address. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.drainPeriodInSeconds")] + public int? DrainPeriodInSeconds {get; set; } /// - /// Gets type of the resource. + /// Gets or sets a reference to a virtual network. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetwork")] + public SubResource VirtualNetwork {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPoolPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPoolPropertiesFormat.cs new file mode 100644 index 000000000000..ce38e7e19d04 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/BackendAddressPoolPropertiesFormat.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the backend address pool. + /// + public partial class BackendAddressPoolPropertiesFormat + { + /// + /// Initializes a new instance of the BackendAddressPoolPropertiesFormat class. + /// + public BackendAddressPoolPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackendAddressPoolPropertiesFormat class. + /// + + /// The location of the backend address pool. + /// + + /// An array of gateway load balancer tunnel interfaces. + /// + + /// An array of backend addresses. + /// + + /// An array of references to IP addresses defined in network interfaces. + /// + + /// An array of references to load balancing rules that use this backend + /// address pool. + /// + + /// A reference to an outbound rule that uses this backend address pool. + /// + + /// An array of references to outbound rules that use this backend address + /// pool. + /// + + /// An array of references to inbound NAT rules that use this backend address + /// pool. + /// + + /// The provisioning state of the backend address pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Amount of seconds Load Balancer waits for before sending RESET to client + /// and backend address. + /// + + /// A reference to a virtual network. + /// + + /// Backend address synchronous mode for the backend pool + /// Possible values include: 'Automatic', 'Manual' + public BackendAddressPoolPropertiesFormat(string location = default(string), System.Collections.Generic.IList tunnelInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), SubResource outboundRule = default(SubResource), System.Collections.Generic.IList outboundRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), string provisioningState = default(string), int? drainPeriodInSeconds = default(int?), SubResource virtualNetwork = default(SubResource), string syncMode = default(string)) + + { + this.Location = location; + this.TunnelInterfaces = tunnelInterfaces; + this.LoadBalancerBackendAddresses = loadBalancerBackendAddresses; + this.BackendIPConfigurations = backendIPConfigurations; + this.LoadBalancingRules = loadBalancingRules; + this.OutboundRule = outboundRule; + this.OutboundRules = outboundRules; + this.InboundNatRules = inboundNatRules; + this.ProvisioningState = provisioningState; + this.DrainPeriodInSeconds = drainPeriodInSeconds; + this.VirtualNetwork = virtualNetwork; + this.SyncMode = syncMode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the location of the backend address pool. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets an array of gateway load balancer tunnel interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnelInterfaces")] + public System.Collections.Generic.IList TunnelInterfaces {get; set; } + + /// + /// Gets or sets an array of backend addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerBackendAddresses")] + public System.Collections.Generic.IList LoadBalancerBackendAddresses {get; set; } + + /// + /// Gets an array of references to IP addresses defined in network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendIPConfigurations")] + public System.Collections.Generic.IList BackendIPConfigurations {get; private set; } + + /// + /// Gets an array of references to load balancing rules that use this backend + /// address pool. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; private set; } + + /// + /// Gets a reference to an outbound rule that uses this backend address pool. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outboundRule")] + public SubResource OutboundRule {get; private set; } + + /// + /// Gets an array of references to outbound rules that use this backend address + /// pool. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outboundRules")] + public System.Collections.Generic.IList OutboundRules {get; private set; } + + /// + /// Gets an array of references to inbound NAT rules that use this backend + /// address pool. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; private set; } + + /// + /// Gets the provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets amount of seconds Load Balancer waits for before sending RESET + /// to client and backend address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "drainPeriodInSeconds")] + public int? DrainPeriodInSeconds {get; set; } + + /// + /// Gets or sets a reference to a virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetwork")] + public SubResource VirtualNetwork {get; set; } + + /// + /// Gets or sets backend address synchronous mode for the backend pool Possible values include: 'Automatic', 'Manual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "syncMode")] + public string SyncMode {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BaseAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/BaseAdminRule.cs index d47a51667907..dccd493808b2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BaseAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BaseAdminRule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,17 +24,26 @@ public BaseAdminRule() /// /// Initializes a new instance of the BaseAdminRule class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The system metadata related to this - /// resource. + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// public BaseAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + : base(id, name, type, etag) { - SystemData = systemData; + this.SystemData = systemData; CustomInit(); } @@ -49,11 +52,11 @@ public BaseAdminRule() /// partial void CustomInit(); + /// /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionActiveSession.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionActiveSession.cs index a6d0793b5e10..6eca009ab91c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionActiveSession.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionActiveSession.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,36 +23,53 @@ public BastionActiveSession() /// /// Initializes a new instance of the BastionActiveSession class. /// - /// A unique id for the session. - /// The time when the session started. - /// The subscription id for the - /// target virtual machine. - /// The type of the resource. - /// The host name of the target. - /// The resource group of the - /// target. - /// The user name who is active on this - /// session. - /// The IP Address of the target. + + /// A unique id for the session. + /// + + /// The time when the session started. + /// + + /// The subscription id for the target virtual machine. + /// + + /// The type of the resource. + /// + + /// The host name of the target. + /// + + /// The resource group of the target. + /// + + /// The user name who is active on this session. + /// + + /// The IP Address of the target. + /// + /// The protocol used to connect to the target. - /// Possible values include: 'SSH', 'RDP' - /// The resource id of the - /// target. - /// Duration in mins the session - /// has been active. - public BastionActiveSession(string sessionId = default(string), object startTime = default(object), string targetSubscriptionId = default(string), string resourceType = default(string), string targetHostName = default(string), string targetResourceGroup = default(string), string userName = default(string), string targetIpAddress = default(string), string protocol = default(string), string targetResourceId = default(string), double? sessionDurationInMins = default(double?)) + /// Possible values include: 'SSH', 'RDP' + + /// The resource id of the target. + /// + + /// Duration in mins the session has been active. + /// + public BastionActiveSession(string sessionId = default(string), object startTime = default(object), string targetSubscriptionId = default(string), string resourceType = default(string), string targetHostName = default(string), string targetResourceGroup = default(string), string userName = default(string), string targetIPAddress = default(string), string protocol = default(string), string targetResourceId = default(string), double? sessionDurationInMins = default(double?)) + { - SessionId = sessionId; - StartTime = startTime; - TargetSubscriptionId = targetSubscriptionId; - ResourceType = resourceType; - TargetHostName = targetHostName; - TargetResourceGroup = targetResourceGroup; - UserName = userName; - TargetIpAddress = targetIpAddress; - Protocol = protocol; - TargetResourceId = targetResourceId; - SessionDurationInMins = sessionDurationInMins; + this.SessionId = sessionId; + this.StartTime = startTime; + this.TargetSubscriptionId = targetSubscriptionId; + this.ResourceType = resourceType; + this.TargetHostName = targetHostName; + this.TargetResourceGroup = targetResourceGroup; + this.UserName = userName; + this.TargetIPAddress = targetIPAddress; + this.Protocol = protocol; + this.TargetResourceId = targetResourceId; + this.SessionDurationInMins = sessionDurationInMins; CustomInit(); } @@ -67,72 +78,71 @@ public BastionActiveSession() /// partial void CustomInit(); + /// /// Gets a unique id for the session. /// - [JsonProperty(PropertyName = "sessionId")] - public string SessionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sessionId")] + public string SessionId {get; private set; } /// /// Gets the time when the session started. /// - [JsonProperty(PropertyName = "startTime")] - public object StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public object StartTime {get; private set; } /// /// Gets the subscription id for the target virtual machine. /// - [JsonProperty(PropertyName = "targetSubscriptionId")] - public string TargetSubscriptionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetSubscriptionId")] + public string TargetSubscriptionId {get; private set; } /// /// Gets the type of the resource. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; private set; } /// /// Gets the host name of the target. /// - [JsonProperty(PropertyName = "targetHostName")] - public string TargetHostName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetHostName")] + public string TargetHostName {get; private set; } /// /// Gets the resource group of the target. /// - [JsonProperty(PropertyName = "targetResourceGroup")] - public string TargetResourceGroup { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGroup")] + public string TargetResourceGroup {get; private set; } /// /// Gets the user name who is active on this session. /// - [JsonProperty(PropertyName = "userName")] - public string UserName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userName")] + public string UserName {get; private set; } /// /// Gets the IP Address of the target. /// - [JsonProperty(PropertyName = "targetIpAddress")] - public string TargetIpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetIpAddress")] + public string TargetIPAddress {get; private set; } /// - /// Gets the protocol used to connect to the target. Possible values - /// include: 'SSH', 'RDP' + /// Gets the protocol used to connect to the target. Possible values include: 'SSH', 'RDP' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; private set; } /// /// Gets the resource id of the target. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; private set; } /// /// Gets duration in mins the session has been active. /// - [JsonProperty(PropertyName = "sessionDurationInMins")] - public double? SessionDurationInMins { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sessionDurationInMins")] + public double? SessionDurationInMins {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionConnectProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionConnectProtocol.cs index cdb59ff65a5b..b128267f18a0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionConnectProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionConnectProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for BastionConnectProtocol. /// + + public static class BastionConnectProtocol { public const string SSH = "SSH"; public const string RDP = "RDP"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionHost.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionHost.cs index 099428d2f81a..5c27dab03cac 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionHost.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionHost.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Bastion Host resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BastionHost : Resource { /// @@ -34,54 +24,82 @@ public BastionHost() /// /// Initializes a new instance of the BastionHost class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// IP configuration of the Bastion Host - /// resource. - /// FQDN for the endpoint on which bastion host - /// is accessible. - /// Reference to an existing virtual - /// network required for Developer Bastion Host only. - /// The provisioning state of the - /// bastion host resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The scale units for the Bastion Host - /// resource. - /// Enable/Disable Copy/Paste feature of - /// the Bastion Host resource. - /// Enable/Disable File Copy feature of - /// the Bastion Host resource. - /// Enable/Disable IP Connect feature of - /// the Bastion Host resource. - /// Enable/Disable Shareable Link of - /// the Bastion Host resource. - /// Enable/Disable Tunneling feature of - /// the Bastion Host resource. - /// Enable/Disable Kerberos feature of the - /// Bastion Host resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The sku of this Bastion Host. - public BastionHost(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList ipConfigurations = default(IList), string dnsName = default(string), SubResource virtualNetwork = default(SubResource), BastionHostPropertiesFormatNetworkAcls networkAcls = default(BastionHostPropertiesFormatNetworkAcls), string provisioningState = default(string), int? scaleUnits = default(int?), bool? disableCopyPaste = default(bool?), bool? enableFileCopy = default(bool?), bool? enableIpConnect = default(bool?), bool? enableShareableLink = default(bool?), bool? enableTunneling = default(bool?), bool? enableKerberos = default(bool?), string etag = default(string), Sku sku = default(Sku)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The sku of this Bastion Host. + /// + + /// The provisioning state of the bastion host resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// IP configuration of the Bastion Host resource. + /// + + /// FQDN for the endpoint on which bastion host is accessible. + /// + + /// Reference to an existing virtual network required for Developer Bastion + /// Host only. + /// + + /// + /// + + /// The scale units for the Bastion Host resource. + /// + + /// Enable/Disable Copy/Paste feature of the Bastion Host resource. + /// + + /// Enable/Disable File Copy feature of the Bastion Host resource. + /// + + /// Enable/Disable IP Connect feature of the Bastion Host resource. + /// + + /// Enable/Disable Shareable Link of the Bastion Host resource. + /// + + /// Enable/Disable Tunneling feature of the Bastion Host resource. + /// + + /// Enable/Disable Kerberos feature of the Bastion Host resource. + /// + public BastionHost(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), Sku sku = default(Sku), string provisioningState = default(string), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string dnsName = default(string), SubResource virtualNetwork = default(SubResource), BastionHostPropertiesFormatNetworkAcls networkAcls = default(BastionHostPropertiesFormatNetworkAcls), int? scaleUnits = default(int?), bool? disableCopyPaste = default(bool?), bool? enableFileCopy = default(bool?), bool? enableIPConnect = default(bool?), bool? enableShareableLink = default(bool?), bool? enableTunneling = default(bool?), bool? enableKerberos = default(bool?)) + + : base(id, name, type, location, tags) { - IpConfigurations = ipConfigurations; - DnsName = dnsName; - VirtualNetwork = virtualNetwork; - NetworkAcls = networkAcls; - ProvisioningState = provisioningState; - ScaleUnits = scaleUnits; - DisableCopyPaste = disableCopyPaste; - EnableFileCopy = enableFileCopy; - EnableIpConnect = enableIpConnect; - EnableShareableLink = enableShareableLink; - EnableTunneling = enableTunneling; - EnableKerberos = enableKerberos; - Etag = etag; - Sku = sku; + this.Etag = etag; + this.Sku = sku; + this.ProvisioningState = provisioningState; + this.IPConfigurations = ipConfigurations; + this.DnsName = dnsName; + this.VirtualNetwork = virtualNetwork; + this.NetworkAcls = networkAcls; + this.ScaleUnits = scaleUnits; + this.DisableCopyPaste = disableCopyPaste; + this.EnableFileCopy = enableFileCopy; + this.EnableIPConnect = enableIPConnect; + this.EnableShareableLink = enableShareableLink; + this.EnableTunneling = enableTunneling; + this.EnableKerberos = enableKerberos; CustomInit(); } @@ -90,128 +108,120 @@ public BastionHost() /// partial void CustomInit(); + /// - /// Gets or sets IP configuration of the Bastion Host resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets FQDN for the endpoint on which bastion host is - /// accessible. + /// Gets or sets the sku of this Bastion Host. /// - [JsonProperty(PropertyName = "properties.dnsName")] - public string DnsName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } /// - /// Gets or sets reference to an existing virtual network required for - /// Developer Bastion Host only. + /// Gets the provisioning state of the bastion host resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.virtualNetwork")] - public SubResource VirtualNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// + /// Gets or sets iP configuration of the Bastion Host resource. /// - [JsonProperty(PropertyName = "properties.networkAcls")] - public BastionHostPropertiesFormatNetworkAcls NetworkAcls { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// - /// Gets the provisioning state of the bastion host resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets fQDN for the endpoint on which bastion host is accessible. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsName")] + public string DnsName {get; set; } /// - /// Gets or sets the scale units for the Bastion Host resource. + /// Gets or sets reference to an existing virtual network required for + /// Developer Bastion Host only. /// - [JsonProperty(PropertyName = "properties.scaleUnits")] - public int? ScaleUnits { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetwork")] + public SubResource VirtualNetwork {get; set; } /// - /// Gets or sets enable/Disable Copy/Paste feature of the Bastion Host - /// resource. + /// Gets or sets /// - [JsonProperty(PropertyName = "properties.disableCopyPaste")] - public bool? DisableCopyPaste { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkAcls")] + public BastionHostPropertiesFormatNetworkAcls NetworkAcls {get; set; } /// - /// Gets or sets enable/Disable File Copy feature of the Bastion Host - /// resource. + /// Gets or sets the scale units for the Bastion Host resource. /// - [JsonProperty(PropertyName = "properties.enableFileCopy")] - public bool? EnableFileCopy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scaleUnits")] + public int? ScaleUnits {get; set; } /// - /// Gets or sets enable/Disable IP Connect feature of the Bastion Host + /// Gets or sets enable/Disable Copy/Paste feature of the Bastion Host /// resource. /// - [JsonProperty(PropertyName = "properties.enableIpConnect")] - public bool? EnableIpConnect { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableCopyPaste")] + public bool? DisableCopyPaste {get; set; } /// - /// Gets or sets enable/Disable Shareable Link of the Bastion Host - /// resource. + /// Gets or sets enable/Disable File Copy feature of the Bastion Host resource. /// - [JsonProperty(PropertyName = "properties.enableShareableLink")] - public bool? EnableShareableLink { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFileCopy")] + public bool? EnableFileCopy {get; set; } /// - /// Gets or sets enable/Disable Tunneling feature of the Bastion Host + /// Gets or sets enable/Disable IP Connect feature of the Bastion Host /// resource. /// - [JsonProperty(PropertyName = "properties.enableTunneling")] - public bool? EnableTunneling { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIpConnect")] + public bool? EnableIPConnect {get; set; } /// - /// Gets or sets enable/Disable Kerberos feature of the Bastion Host - /// resource. + /// Gets or sets enable/Disable Shareable Link of the Bastion Host resource. /// - [JsonProperty(PropertyName = "properties.enableKerberos")] - public bool? EnableKerberos { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableShareableLink")] + public bool? EnableShareableLink {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets enable/Disable Tunneling feature of the Bastion Host resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableTunneling")] + public bool? EnableTunneling {get; set; } /// - /// Gets or sets the sku of this Bastion Host. + /// Gets or sets enable/Disable Kerberos feature of the Bastion Host resource. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableKerberos")] + public bool? EnableKerberos {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (IpConfigurations != null) - { - foreach (var element in IpConfigurations) - { - if (element != null) - { - element.Validate(); - } - } - } - if (ScaleUnits != null) + + + + + + + + if (this.ScaleUnits != null) { - if (ScaleUnits > 50) + if (this.ScaleUnits > 50) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ScaleUnits", 50); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "ScaleUnits", 50); } - if (ScaleUnits < 2) + if (this.ScaleUnits < 2) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ScaleUnits", 2); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ScaleUnits", 2); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfiguration.cs index 0bd55c666c8f..d7e6d20ef716 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfiguration.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IP configuration of an Bastion Host. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BastionHostIPConfiguration : SubResource { /// @@ -32,31 +24,42 @@ public BastionHostIPConfiguration() /// /// Initializes a new instance of the BastionHostIPConfiguration class. /// - /// Reference of the subnet resource. - /// Reference of the PublicIP - /// resource. - /// Resource ID. - /// The provisioning state of the - /// bastion host IP configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Private IP allocation - /// method. Possible values include: 'Static', 'Dynamic' - /// Name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Ip configuration type. - public BastionHostIPConfiguration(SubResource subnet, SubResource publicIPAddress, string id = default(string), string provisioningState = default(string), string privateIPAllocationMethod = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the resource that is unique within a resource group. This name can + /// be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Ip configuration type. + /// + + /// The provisioning state of the bastion host IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Reference of the subnet resource. + /// + + /// Reference of the PublicIP resource. + /// + + /// Private IP allocation method. + /// Possible values include: 'Static', 'Dynamic' + public BastionHostIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string privateIPAllocationMethod = default(string)) + + : base(id) { - Subnet = subnet; - PublicIPAddress = publicIPAddress; - ProvisioningState = provisioningState; - PrivateIPAllocationMethod = privateIPAllocationMethod; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; CustomInit(); } @@ -65,69 +68,49 @@ public BastionHostIPConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets reference of the subnet resource. - /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } /// - /// Gets or sets reference of the PublicIP resource. + /// Gets or sets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public SubResource PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the bastion host IP configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets private IP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets ip configuration type. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets the provisioning state of the bastion host IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets reference of the subnet resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets ip configuration type. + /// Gets or sets reference of the PublicIP resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public SubResource PublicIPAddress {get; set; } /// - /// Validate the object. + /// Gets or sets private IP allocation method. Possible values include: 'Static', 'Dynamic' /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Subnet == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Subnet"); - } - if (PublicIPAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicIPAddress"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..15019767f339 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostIPConfigurationPropertiesFormat.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of IP configuration of an Bastion Host. + /// + public partial class BastionHostIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the BastionHostIPConfigurationPropertiesFormat class. + /// + public BastionHostIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BastionHostIPConfigurationPropertiesFormat class. + /// + + /// Reference of the subnet resource. + /// + + /// Reference of the PublicIP resource. + /// + + /// The provisioning state of the bastion host IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Private IP allocation method. + /// Possible values include: 'Static', 'Dynamic' + public BastionHostIPConfigurationPropertiesFormat(SubResource subnet, SubResource publicIPAddress, string provisioningState = default(string), string privateIPAllocationMethod = default(string)) + + { + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.ProvisioningState = provisioningState; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets reference of the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets reference of the PublicIP resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public SubResource PublicIPAddress {get; set; } + + /// + /// Gets the provisioning state of the bastion host IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets private IP allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Subnet == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Subnet"); + } + if (this.PublicIPAddress == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicIPAddress"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormat.cs new file mode 100644 index 000000000000..93f5b59f8499 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormat.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the Bastion Host. + /// + public partial class BastionHostPropertiesFormat + { + /// + /// Initializes a new instance of the BastionHostPropertiesFormat class. + /// + public BastionHostPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BastionHostPropertiesFormat class. + /// + + /// IP configuration of the Bastion Host resource. + /// + + /// FQDN for the endpoint on which bastion host is accessible. + /// + + /// Reference to an existing virtual network required for Developer Bastion + /// Host only. + /// + + /// + /// + + /// The provisioning state of the bastion host resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The scale units for the Bastion Host resource. + /// + + /// Enable/Disable Copy/Paste feature of the Bastion Host resource. + /// + + /// Enable/Disable File Copy feature of the Bastion Host resource. + /// + + /// Enable/Disable IP Connect feature of the Bastion Host resource. + /// + + /// Enable/Disable Shareable Link of the Bastion Host resource. + /// + + /// Enable/Disable Tunneling feature of the Bastion Host resource. + /// + + /// Enable/Disable Kerberos feature of the Bastion Host resource. + /// + public BastionHostPropertiesFormat(System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string dnsName = default(string), SubResource virtualNetwork = default(SubResource), BastionHostPropertiesFormatNetworkAcls networkAcls = default(BastionHostPropertiesFormatNetworkAcls), string provisioningState = default(string), int? scaleUnits = default(int?), bool? disableCopyPaste = default(bool?), bool? enableFileCopy = default(bool?), bool? enableIPConnect = default(bool?), bool? enableShareableLink = default(bool?), bool? enableTunneling = default(bool?), bool? enableKerberos = default(bool?)) + + { + this.IPConfigurations = ipConfigurations; + this.DnsName = dnsName; + this.VirtualNetwork = virtualNetwork; + this.NetworkAcls = networkAcls; + this.ProvisioningState = provisioningState; + this.ScaleUnits = scaleUnits; + this.DisableCopyPaste = disableCopyPaste; + this.EnableFileCopy = enableFileCopy; + this.EnableIPConnect = enableIPConnect; + this.EnableShareableLink = enableShareableLink; + this.EnableTunneling = enableTunneling; + this.EnableKerberos = enableKerberos; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets iP configuration of the Bastion Host resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets or sets fQDN for the endpoint on which bastion host is accessible. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsName")] + public string DnsName {get; set; } + + /// + /// Gets or sets reference to an existing virtual network required for + /// Developer Bastion Host only. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetwork")] + public SubResource VirtualNetwork {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkAcls")] + public BastionHostPropertiesFormatNetworkAcls NetworkAcls {get; set; } + + /// + /// Gets the provisioning state of the bastion host resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the scale units for the Bastion Host resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleUnits")] + public int? ScaleUnits {get; set; } + + /// + /// Gets or sets enable/Disable Copy/Paste feature of the Bastion Host + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableCopyPaste")] + public bool? DisableCopyPaste {get; set; } + + /// + /// Gets or sets enable/Disable File Copy feature of the Bastion Host resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFileCopy")] + public bool? EnableFileCopy {get; set; } + + /// + /// Gets or sets enable/Disable IP Connect feature of the Bastion Host + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableIpConnect")] + public bool? EnableIPConnect {get; set; } + + /// + /// Gets or sets enable/Disable Shareable Link of the Bastion Host resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableShareableLink")] + public bool? EnableShareableLink {get; set; } + + /// + /// Gets or sets enable/Disable Tunneling feature of the Bastion Host resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableTunneling")] + public bool? EnableTunneling {get; set; } + + /// + /// Gets or sets enable/Disable Kerberos feature of the Bastion Host resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableKerberos")] + public bool? EnableKerberos {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + if (this.ScaleUnits != null) + { + if (this.ScaleUnits > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "ScaleUnits", 50); + } + if (this.ScaleUnits < 2) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ScaleUnits", 2); + } + } + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormatNetworkAcls.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormatNetworkAcls.cs index e3fcb92a0cda..5ad610a063d9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormatNetworkAcls.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostPropertiesFormatNetworkAcls.cs @@ -1,25 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class BastionHostPropertiesFormatNetworkAcls { /// - /// Initializes a new instance of the - /// BastionHostPropertiesFormatNetworkAcls class. + /// Initializes a new instance of the BastionHostPropertiesFormatNetworkAcls class. /// public BastionHostPropertiesFormatNetworkAcls() { @@ -27,14 +18,15 @@ public BastionHostPropertiesFormatNetworkAcls() } /// - /// Initializes a new instance of the - /// BastionHostPropertiesFormatNetworkAcls class. + /// Initializes a new instance of the BastionHostPropertiesFormatNetworkAcls class. /// - /// Sets the IP ACL rules for Developer Bastion - /// Host. - public BastionHostPropertiesFormatNetworkAcls(IList ipRules = default(IList)) + + /// Sets the IP ACL rules for Developer Bastion Host. + /// + public BastionHostPropertiesFormatNetworkAcls(System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList)) + { - IpRules = ipRules; + this.IPRules = ipRules; CustomInit(); } @@ -43,11 +35,11 @@ public BastionHostPropertiesFormatNetworkAcls() /// partial void CustomInit(); + /// /// Gets or sets sets the IP ACL rules for Developer Bastion Host. /// - [JsonProperty(PropertyName = "ipRules")] - public IList IpRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ipRules")] + public System.Collections.Generic.IList IPRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostSkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostSkuName.cs index 4360be113fd4..3851f5ac93d9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionHostSkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionHostSkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for BastionHostSkuName. /// + + public static class BastionHostSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; public const string Developer = "Developer"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionSessionState.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionSessionState.cs index 2da12830d19b..aa8497b98ac6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionSessionState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionSessionState.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public BastionSessionState() /// /// Initializes a new instance of the BastionSessionState class. /// - /// A unique id for the session. - /// Used for extra information. - /// The state of the session. - /// Disconnected/Failed/NotFound. + + /// A unique id for the session. + /// + + /// Used for extra information. + /// + + /// The state of the session. Disconnected/Failed/NotFound. + /// public BastionSessionState(string sessionId = default(string), string message = default(string), string state = default(string)) + { - SessionId = sessionId; - Message = message; - State = state; + this.SessionId = sessionId; + this.Message = message; + this.State = state; CustomInit(); } @@ -46,23 +46,23 @@ public BastionSessionState() /// partial void CustomInit(); + /// /// Gets a unique id for the session. /// - [JsonProperty(PropertyName = "sessionId")] - public string SessionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sessionId")] + public string SessionId {get; private set; } /// /// Gets used for extra information. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } /// /// Gets the state of the session. Disconnected/Failed/NotFound. /// - [JsonProperty(PropertyName = "state")] - public string State { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLink.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLink.cs index 72720c788105..0cee51daef11 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLink.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLink.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,18 +23,26 @@ public BastionShareableLink() /// /// Initializes a new instance of the BastionShareableLink class. /// - /// Reference of the virtual machine resource. - /// The unique Bastion Shareable Link to the virtual - /// machine. - /// The time when the link was created. - /// Optional field indicating the warning or - /// error message related to the vm in case of partial failure. + + /// Reference of the virtual machine resource. + /// + + /// The unique Bastion Shareable Link to the virtual machine. + /// + + /// The time when the link was created. + /// + + /// Optional field indicating the warning or error message related to the vm in + /// case of partial failure. + /// public BastionShareableLink(VM vm, string bsl = default(string), string createdAt = default(string), string message = default(string)) + { - Vm = vm; - Bsl = bsl; - CreatedAt = createdAt; - Message = message; + this.VM = vm; + this.Bsl = bsl; + this.CreatedAt = createdAt; + this.Message = message; CustomInit(); } @@ -50,43 +51,47 @@ public BastionShareableLink() /// partial void CustomInit(); + /// /// Gets or sets reference of the virtual machine resource. /// - [JsonProperty(PropertyName = "vm")] - public VM Vm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vm")] + public VM VM {get; set; } /// /// Gets the unique Bastion Shareable Link to the virtual machine. /// - [JsonProperty(PropertyName = "bsl")] - public string Bsl { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bsl")] + public string Bsl {get; private set; } /// /// Gets the time when the link was created. /// - [JsonProperty(PropertyName = "createdAt")] - public string CreatedAt { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public string CreatedAt {get; private set; } /// - /// Gets optional field indicating the warning or error message related - /// to the vm in case of partial failure. + /// Gets optional field indicating the warning or error message related to the + /// vm in case of partial failure. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Vm == null) + if (this.VM == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Vm"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VM"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkListRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkListRequest.cs index 1a247c7e02df..e9c6aacbf268 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkListRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkListRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class BastionShareableLinkListRequest { /// - /// Initializes a new instance of the BastionShareableLinkListRequest - /// class. + /// Initializes a new instance of the BastionShareableLinkListRequest class. /// public BastionShareableLinkListRequest() { @@ -30,13 +21,15 @@ public BastionShareableLinkListRequest() } /// - /// Initializes a new instance of the BastionShareableLinkListRequest - /// class. + /// Initializes a new instance of the BastionShareableLinkListRequest class. /// - /// List of VM references. - public BastionShareableLinkListRequest(IList vms = default(IList)) + + /// List of VM references. + /// + public BastionShareableLinkListRequest(System.Collections.Generic.IList vms = default(System.Collections.Generic.IList)) + { - Vms = vms; + this.Vms = vms; CustomInit(); } @@ -45,11 +38,11 @@ public BastionShareableLinkListRequest() /// partial void CustomInit(); + /// /// Gets or sets list of VM references. /// - [JsonProperty(PropertyName = "vms")] - public IList Vms { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vms")] + public System.Collections.Generic.IList Vms {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkTokenListRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkTokenListRequest.cs index 7c4d44f71a14..52259e0b6af5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkTokenListRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BastionShareableLinkTokenListRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class BastionShareableLinkTokenListRequest { /// - /// Initializes a new instance of the - /// BastionShareableLinkTokenListRequest class. + /// Initializes a new instance of the BastionShareableLinkTokenListRequest class. /// public BastionShareableLinkTokenListRequest() { @@ -30,13 +21,15 @@ public BastionShareableLinkTokenListRequest() } /// - /// Initializes a new instance of the - /// BastionShareableLinkTokenListRequest class. + /// Initializes a new instance of the BastionShareableLinkTokenListRequest class. /// - /// List of Bastion Shareable Link Token. - public BastionShareableLinkTokenListRequest(IList tokens = default(IList)) + + /// List of Bastion Shareable Link Token. + /// + public BastionShareableLinkTokenListRequest(System.Collections.Generic.IList tokens = default(System.Collections.Generic.IList)) + { - Tokens = tokens; + this.Tokens = tokens; CustomInit(); } @@ -45,11 +38,11 @@ public BastionShareableLinkTokenListRequest() /// partial void CustomInit(); + /// /// Gets or sets list of Bastion Shareable Link Token. /// - [JsonProperty(PropertyName = "tokens")] - public IList Tokens { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tokens")] + public System.Collections.Generic.IList Tokens {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpConnection.cs index 35fd140862ac..783e09bbe7f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BgpConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpConnection.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Virtual Appliance Site resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BgpConnection : SubResource { /// @@ -32,32 +24,46 @@ public BgpConnection() /// /// Initializes a new instance of the BgpConnection class. /// - /// Resource ID. - /// Peer ASN. - /// Peer IP. - /// The reference to the - /// HubVirtualNetworkConnection resource. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The current state of the VirtualHub - /// to Peer. Possible values include: 'Unknown', 'Connecting', - /// 'Connected', 'NotConnected' - /// Name of the connection. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Connection type. - public BgpConnection(string id = default(string), long? peerAsn = default(long?), string peerIp = default(string), SubResource hubVirtualNetworkConnection = default(SubResource), string provisioningState = default(string), string connectionState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the connection. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Connection type. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Peer ASN. + /// + + /// Peer IP. + /// + + /// The reference to the HubVirtualNetworkConnection resource. + /// + + /// The current state of the VirtualHub to Peer. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + public BgpConnection(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), long? peerAsn = default(long?), string peerIP = default(string), SubResource hubVirtualNetworkConnection = default(SubResource), string connectionState = default(string)) + + : base(id) { - PeerAsn = peerAsn; - PeerIp = peerIp; - HubVirtualNetworkConnection = hubVirtualNetworkConnection; - ProvisioningState = provisioningState; - ConnectionState = connectionState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PeerAsn = peerAsn; + this.PeerIP = peerIP; + this.HubVirtualNetworkConnection = hubVirtualNetworkConnection; + this.ConnectionState = connectionState; CustomInit(); } @@ -66,77 +72,81 @@ public BgpConnection() /// partial void CustomInit(); + /// - /// Gets or sets peer ASN. + /// Gets or sets name of the connection. /// - [JsonProperty(PropertyName = "properties.peerAsn")] - public long? PeerAsn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets peer IP. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.peerIp")] - public string PeerIp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the HubVirtualNetworkConnection - /// resource. + /// Gets connection type. /// - [JsonProperty(PropertyName = "properties.hubVirtualNetworkConnection")] - public SubResource HubVirtualNetworkConnection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the current state of the VirtualHub to Peer. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets or sets peer ASN. /// - [JsonProperty(PropertyName = "properties.connectionState")] - public string ConnectionState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerAsn")] + public long? PeerAsn {get; set; } /// - /// Gets or sets name of the connection. + /// Gets or sets peer IP. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerIp")] + public string PeerIP {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the reference to the HubVirtualNetworkConnection resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hubVirtualNetworkConnection")] + public SubResource HubVirtualNetworkConnection {get; set; } /// - /// Gets connection type. + /// Gets the current state of the VirtualHub to Peer. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionState")] + public string ConnectionState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PeerAsn != null) + + + + + if (this.PeerAsn != null) { - if (PeerAsn > 4294967295) + if (this.PeerAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); } - if (PeerAsn < 0) + if (this.PeerAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 0); } } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpConnectionProperties.cs new file mode 100644 index 000000000000..87a5bd0f46dd --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpConnectionProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the bgp connection. + /// + public partial class BgpConnectionProperties + { + /// + /// Initializes a new instance of the BgpConnectionProperties class. + /// + public BgpConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BgpConnectionProperties class. + /// + + /// Peer ASN. + /// + + /// Peer IP. + /// + + /// The reference to the HubVirtualNetworkConnection resource. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The current state of the VirtualHub to Peer. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + public BgpConnectionProperties(long? peerAsn = default(long?), string peerIP = default(string), SubResource hubVirtualNetworkConnection = default(SubResource), string provisioningState = default(string), string connectionState = default(string)) + + { + this.PeerAsn = peerAsn; + this.PeerIP = peerIP; + this.HubVirtualNetworkConnection = hubVirtualNetworkConnection; + this.ProvisioningState = provisioningState; + this.ConnectionState = connectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets peer ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerAsn")] + public long? PeerAsn {get; set; } + + /// + /// Gets or sets peer IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerIp")] + public string PeerIP {get; set; } + + /// + /// Gets or sets the reference to the HubVirtualNetworkConnection resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hubVirtualNetworkConnection")] + public SubResource HubVirtualNetworkConnection {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the current state of the VirtualHub to Peer. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionState")] + public string ConnectionState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PeerAsn != null) + { + if (this.PeerAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + } + if (this.PeerAsn < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 0); + } + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerState.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerState.cs index 7f10003ee10c..194670ee3dab 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for BgpPeerState. /// + + public static class BgpPeerState { public const string Unknown = "Unknown"; @@ -22,4 +19,4 @@ public static class BgpPeerState public const string Connecting = "Connecting"; public const string Connected = "Connected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatus.cs index 843529d85907..4e16ac99e989 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatus.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,30 +23,42 @@ public BgpPeerStatus() /// /// Initializes a new instance of the BgpPeerStatus class. /// - /// The virtual network gateway's local - /// address. - /// The remote BGP peer. - /// The autonomous system number of the remote BGP - /// peer. - /// The BGP peer state. Possible values include: - /// 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected' - /// For how long the peering has been - /// up. - /// The number of routes learned from this - /// peer. - /// The number of BGP messages sent. - /// The number of BGP messages - /// received. + + /// The virtual network gateway's local address. + /// + + /// The remote BGP peer. + /// + + /// The autonomous system number of the remote BGP peer. + /// + + /// The BGP peer state. + /// Possible values include: 'Unknown', 'Stopped', 'Idle', 'Connecting', + /// 'Connected' + + /// For how long the peering has been up. + /// + + /// The number of routes learned from this peer. + /// + + /// The number of BGP messages sent. + /// + + /// The number of BGP messages received. + /// public BgpPeerStatus(string localAddress = default(string), string neighbor = default(string), long? asn = default(long?), string state = default(string), string connectedDuration = default(string), long? routesReceived = default(long?), long? messagesSent = default(long?), long? messagesReceived = default(long?)) + { - LocalAddress = localAddress; - Neighbor = neighbor; - Asn = asn; - State = state; - ConnectedDuration = connectedDuration; - RoutesReceived = routesReceived; - MessagesSent = messagesSent; - MessagesReceived = messagesReceived; + this.LocalAddress = localAddress; + this.Neighbor = neighbor; + this.Asn = asn; + this.State = state; + this.ConnectedDuration = connectedDuration; + this.RoutesReceived = routesReceived; + this.MessagesSent = messagesSent; + this.MessagesReceived = messagesReceived; CustomInit(); } @@ -62,74 +67,77 @@ public BgpPeerStatus() /// partial void CustomInit(); + /// - /// Gets the virtual network gateway's local address. + /// Gets the virtual network gateway's local address. /// - [JsonProperty(PropertyName = "localAddress")] - public string LocalAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localAddress")] + public string LocalAddress {get; private set; } /// /// Gets the remote BGP peer. /// - [JsonProperty(PropertyName = "neighbor")] - public string Neighbor { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "neighbor")] + public string Neighbor {get; private set; } /// /// Gets the autonomous system number of the remote BGP peer. /// - [JsonProperty(PropertyName = "asn")] - public long? Asn { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + public long? Asn {get; private set; } /// - /// Gets the BGP peer state. Possible values include: 'Unknown', - /// 'Stopped', 'Idle', 'Connecting', 'Connected' + /// Gets the BGP peer state. Possible values include: 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected' /// - [JsonProperty(PropertyName = "state")] - public string State { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; private set; } /// /// Gets for how long the peering has been up. /// - [JsonProperty(PropertyName = "connectedDuration")] - public string ConnectedDuration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "connectedDuration")] + public string ConnectedDuration {get; private set; } /// /// Gets the number of routes learned from this peer. /// - [JsonProperty(PropertyName = "routesReceived")] - public long? RoutesReceived { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "routesReceived")] + public long? RoutesReceived {get; private set; } /// /// Gets the number of BGP messages sent. /// - [JsonProperty(PropertyName = "messagesSent")] - public long? MessagesSent { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "messagesSent")] + public long? MessagesSent {get; private set; } /// /// Gets the number of BGP messages received. /// - [JsonProperty(PropertyName = "messagesReceived")] - public long? MessagesReceived { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "messagesReceived")] + public long? MessagesReceived {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Asn != null) + + + if (this.Asn != null) { - if (Asn > 4294967295) + if (this.Asn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Asn", 4294967295); } - if (Asn < 0) + if (this.Asn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Asn", 0); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatusListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatusListResult.cs index 5b9c261cfc24..8962bcae5e40 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatusListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpPeerStatusListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public BgpPeerStatusListResult() /// /// Initializes a new instance of the BgpPeerStatusListResult class. /// - /// List of BGP peers. - public BgpPeerStatusListResult(IList value = default(IList)) + + /// List of BGP peers. + /// + public BgpPeerStatusListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public BgpPeerStatusListResult() /// partial void CustomInit(); + /// /// Gets or sets list of BGP peers. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunity.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunity.cs index 38391a0ad0fa..b59021edb942 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunity.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Service Community Properties. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BgpServiceCommunity : Resource { /// @@ -34,19 +24,33 @@ public BgpServiceCommunity() /// /// Initializes a new instance of the BgpServiceCommunity class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The name of the bgp community. e.g. - /// Skype. - /// A list of bgp communities. - public BgpServiceCommunity(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string serviceName = default(string), IList bgpCommunities = default(IList)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The name of the bgp community. e.g. Skype. + /// + + /// A list of bgp communities. + /// + public BgpServiceCommunity(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string serviceName = default(string), System.Collections.Generic.IList bgpCommunities = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - ServiceName = serviceName; - BgpCommunities = bgpCommunities; + this.ServiceName = serviceName; + this.BgpCommunities = bgpCommunities; CustomInit(); } @@ -55,17 +59,17 @@ public BgpServiceCommunity() /// partial void CustomInit(); + /// /// Gets or sets the name of the bgp community. e.g. Skype. /// - [JsonProperty(PropertyName = "properties.serviceName")] - public string ServiceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceName")] + public string ServiceName {get; set; } /// /// Gets or sets a list of bgp communities. /// - [JsonProperty(PropertyName = "properties.bgpCommunities")] - public IList BgpCommunities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpCommunities")] + public System.Collections.Generic.IList BgpCommunities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunityPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunityPropertiesFormat.cs new file mode 100644 index 000000000000..99dc464e0689 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpServiceCommunityPropertiesFormat.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Service Community. + /// + public partial class BgpServiceCommunityPropertiesFormat + { + /// + /// Initializes a new instance of the BgpServiceCommunityPropertiesFormat class. + /// + public BgpServiceCommunityPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BgpServiceCommunityPropertiesFormat class. + /// + + /// The name of the bgp community. e.g. Skype. + /// + + /// A list of bgp communities. + /// + public BgpServiceCommunityPropertiesFormat(string serviceName = default(string), System.Collections.Generic.IList bgpCommunities = default(System.Collections.Generic.IList)) + + { + this.ServiceName = serviceName; + this.BgpCommunities = bgpCommunities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the bgp community. e.g. Skype. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } + + /// + /// Gets or sets a list of bgp communities. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpCommunities")] + public System.Collections.Generic.IList BgpCommunities {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BgpSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/BgpSettings.cs index 7ae62bc4e6bb..488a5151f1db 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BgpSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BgpSettings.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,19 +23,25 @@ public BgpSettings() /// /// Initializes a new instance of the BgpSettings class. /// - /// The BGP speaker's ASN. - /// The BGP peering address and BGP - /// identifier of this BGP speaker. - /// The weight added to routes learned from - /// this BGP speaker. - /// BGP peering address with IP - /// configuration ID for virtual network gateway. - public BgpSettings(long? asn = default(long?), string bgpPeeringAddress = default(string), int? peerWeight = default(int?), IList bgpPeeringAddresses = default(IList)) + + /// The BGP speaker's ASN. + /// + + /// The BGP peering address and BGP identifier of this BGP speaker. + /// + + /// The weight added to routes learned from this BGP speaker. + /// + + /// BGP peering address with IP configuration ID for virtual network gateway. + /// + public BgpSettings(long? asn = default(long?), string bgpPeeringAddress = default(string), int? peerWeight = default(int?), System.Collections.Generic.IList bgpPeeringAddresses = default(System.Collections.Generic.IList)) + { - Asn = asn; - BgpPeeringAddress = bgpPeeringAddress; - PeerWeight = peerWeight; - BgpPeeringAddresses = bgpPeeringAddresses; + this.Asn = asn; + this.BgpPeeringAddress = bgpPeeringAddress; + this.PeerWeight = peerWeight; + this.BgpPeeringAddresses = bgpPeeringAddresses; CustomInit(); } @@ -53,52 +50,53 @@ public BgpSettings() /// partial void CustomInit(); + /// - /// Gets or sets the BGP speaker's ASN. + /// Gets or sets the BGP speaker's ASN. /// - [JsonProperty(PropertyName = "asn")] - public long? Asn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + public long? Asn {get; set; } /// /// Gets or sets the BGP peering address and BGP identifier of this BGP /// speaker. /// - [JsonProperty(PropertyName = "bgpPeeringAddress")] - public string BgpPeeringAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpPeeringAddress")] + public string BgpPeeringAddress {get; set; } /// - /// Gets or sets the weight added to routes learned from this BGP - /// speaker. + /// Gets or sets the weight added to routes learned from this BGP speaker. /// - [JsonProperty(PropertyName = "peerWeight")] - public int? PeerWeight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "peerWeight")] + public int? PeerWeight {get; set; } /// - /// Gets or sets BGP peering address with IP configuration ID for - /// virtual network gateway. + /// Gets or sets bGP peering address with IP configuration ID for virtual + /// network gateway. /// - [JsonProperty(PropertyName = "bgpPeeringAddresses")] - public IList BgpPeeringAddresses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpPeeringAddresses")] + public System.Collections.Generic.IList BgpPeeringAddresses {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Asn != null) + if (this.Asn != null) { - if (Asn > 4294967295) + if (this.Asn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Asn", 4294967295); } - if (Asn < 0) + if (this.Asn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Asn", 0); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/BreakOutCategoryPolicies.cs b/src/Network/Network.Management.Sdk/Generated/Models/BreakOutCategoryPolicies.cs index f651387d6125..4ebd13adc5da 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/BreakOutCategoryPolicies.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/BreakOutCategoryPolicies.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public BreakOutCategoryPolicies() /// /// Initializes a new instance of the BreakOutCategoryPolicies class. /// - /// Flag to control breakout of o365 allow - /// category. - /// Flag to control breakout of o365 optimize - /// category. - /// Flag to control breakout of o365 - /// default category. + + /// Flag to control breakout of o365 allow category. + /// + + /// Flag to control breakout of o365 optimize category. + /// + + /// Flag to control breakout of o365 default category. + /// public BreakOutCategoryPolicies(bool? allow = default(bool?), bool? optimize = default(bool?), bool? defaultProperty = default(bool?)) + { - Allow = allow; - Optimize = optimize; - DefaultProperty = defaultProperty; + this.Allow = allow; + this.Optimize = optimize; + this.DefaultProperty = defaultProperty; CustomInit(); } @@ -48,23 +46,23 @@ public BreakOutCategoryPolicies() /// partial void CustomInit(); + /// /// Gets or sets flag to control breakout of o365 allow category. /// - [JsonProperty(PropertyName = "allow")] - public bool? Allow { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "allow")] + public bool? Allow {get; set; } /// /// Gets or sets flag to control breakout of o365 optimize category. /// - [JsonProperty(PropertyName = "optimize")] - public bool? Optimize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "optimize")] + public bool? Optimize {get; set; } /// /// Gets or sets flag to control breakout of o365 default category. /// - [JsonProperty(PropertyName = "default")] - public bool? DefaultProperty { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + public bool? DefaultProperty {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CheckPrivateLinkServiceVisibilityRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/CheckPrivateLinkServiceVisibilityRequest.cs index 10d1b67b8554..25a35ae1f3d0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CheckPrivateLinkServiceVisibilityRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CheckPrivateLinkServiceVisibilityRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class CheckPrivateLinkServiceVisibilityRequest { /// - /// Initializes a new instance of the - /// CheckPrivateLinkServiceVisibilityRequest class. + /// Initializes a new instance of the CheckPrivateLinkServiceVisibilityRequest class. /// public CheckPrivateLinkServiceVisibilityRequest() { @@ -28,14 +21,15 @@ public CheckPrivateLinkServiceVisibilityRequest() } /// - /// Initializes a new instance of the - /// CheckPrivateLinkServiceVisibilityRequest class. + /// Initializes a new instance of the CheckPrivateLinkServiceVisibilityRequest class. /// - /// The alias of the private link - /// service. + + /// The alias of the private link service. + /// public CheckPrivateLinkServiceVisibilityRequest(string privateLinkServiceAlias = default(string)) + { - PrivateLinkServiceAlias = privateLinkServiceAlias; + this.PrivateLinkServiceAlias = privateLinkServiceAlias; CustomInit(); } @@ -44,11 +38,11 @@ public CheckPrivateLinkServiceVisibilityRequest() /// partial void CustomInit(); + /// /// Gets or sets the alias of the private link service. /// - [JsonProperty(PropertyName = "privateLinkServiceAlias")] - public string PrivateLinkServiceAlias { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceAlias")] + public string PrivateLinkServiceAlias {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ChildResource.cs b/src/Network/Network.Management.Sdk/Generated/Models/ChildResource.cs index fffba08cc82b..871db3a80adb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ChildResource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ChildResource.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Proxy resource representation. /// - public partial class ChildResource : IResource + public partial class ChildResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ChildResource class. @@ -31,17 +23,25 @@ public ChildResource() /// /// Initializes a new instance of the ChildResource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// public ChildResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + { - Id = id; - Name = name; - Type = type; - Etag = etag; + this.Id = id; + this.Name = name; + this.Type = type; + this.Etag = etag; CustomInit(); } @@ -50,30 +50,30 @@ public ChildResource() /// partial void CustomInit(); + /// /// Gets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CircuitConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/CircuitConnectionStatus.cs index c0eea9205b43..c4d02df1ad16 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CircuitConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CircuitConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for CircuitConnectionStatus. /// + + public static class CircuitConnectionStatus { public const string Connected = "Connected"; public const string Connecting = "Connecting"; public const string Disconnected = "Disconnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CommissionedState.cs b/src/Network/Network.Management.Sdk/Generated/Models/CommissionedState.cs index 9ff5fdb78595..b81d17876fe6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CommissionedState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CommissionedState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for CommissionedState. /// + + public static class CommissionedState { public const string Provisioning = "Provisioning"; @@ -25,4 +22,4 @@ public static class CommissionedState public const string Deprovisioning = "Deprovisioning"; public const string Deprovisioned = "Deprovisioned"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationGroup.cs index 966ec0ae66f7..2baa8ec84fb0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationGroup.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The network configuration group resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ConfigurationGroup { /// @@ -32,20 +24,25 @@ public ConfigurationGroup() /// /// Initializes a new instance of the ConfigurationGroup class. /// - /// Network group ID. - /// A description of the network - /// group. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public ConfigurationGroup(string id = default(string), string description = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + /// Network group ID. + /// + + /// The provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the network group. + /// + + /// Unique identifier for this resource. + /// + public ConfigurationGroup(string id = default(string), string provisioningState = default(string), string description = default(string), string resourceGuid = default(string)) + { - Id = id; - Description = description; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.Id = id; + this.ProvisioningState = provisioningState; + this.Description = description; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -54,31 +51,29 @@ public ConfigurationGroup() /// partial void CustomInit(); + /// /// Gets or sets network group ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets a description of the network group. + /// Gets the provisioning state of the scope assignment resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the scope assignment resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets a description of the network group. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationType.cs index 47fd98bf8e93..f9da0f929049 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConfigurationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConfigurationType. /// + + public static class ConfigurationType { public const string SecurityAdmin = "SecurityAdmin"; public const string Connectivity = "Connectivity"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitor.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitor.cs index 89593c0c4910..afcf3f971134 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitor.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitor.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Parameters that define the operation to create a connection monitor. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ConnectionMonitor { /// @@ -34,38 +24,53 @@ public ConnectionMonitor() /// /// Initializes a new instance of the ConnectionMonitor class. /// - /// Connection monitor location. - /// Connection monitor tags. - /// Describes the source of connection - /// monitor. - /// Describes the destination of connection - /// monitor. - /// Determines if the connection monitor will - /// start automatically once created. - /// Monitoring interval in - /// seconds. - /// List of connection monitor - /// endpoints. - /// List of connection monitor test - /// configurations. - /// List of connection monitor test - /// groups. - /// List of connection monitor outputs. - /// Optional notes to be associated with the - /// connection monitor. - public ConnectionMonitor(string location = default(string), IDictionary tags = default(IDictionary), ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), IList endpoints = default(IList), IList testConfigurations = default(IList), IList testGroups = default(IList), IList outputs = default(IList), string notes = default(string)) + + /// Connection monitor location. + /// + + /// Connection monitor tags. + /// + + /// Describes the source of connection monitor. + /// + + /// Describes the destination of connection monitor. + /// + + /// Determines if the connection monitor will start automatically once created. + /// + + /// Monitoring interval in seconds. + /// + + /// List of connection monitor endpoints. + /// + + /// List of connection monitor test configurations. + /// + + /// List of connection monitor test groups. + /// + + /// List of connection monitor outputs. + /// + + /// Optional notes to be associated with the connection monitor. + /// + public ConnectionMonitor(string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), System.Collections.Generic.IList endpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList testConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList testGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputs = default(System.Collections.Generic.IList), string notes = default(string)) + { - Location = location; - Tags = tags; - Source = source; - Destination = destination; - AutoStart = autoStart; - MonitoringIntervalInSeconds = monitoringIntervalInSeconds; - Endpoints = endpoints; - TestConfigurations = testConfigurations; - TestGroups = testGroups; - Outputs = outputs; - Notes = notes; + this.Location = location; + this.Tags = tags; + this.Source = source; + this.Destination = destination; + this.AutoStart = autoStart; + this.MonitoringIntervalInSeconds = monitoringIntervalInSeconds; + this.Endpoints = endpoints; + this.TestConfigurations = testConfigurations; + this.TestGroups = testGroups; + this.Outputs = outputs; + this.Notes = notes; CustomInit(); } @@ -74,104 +79,105 @@ public ConnectionMonitor() /// partial void CustomInit(); + /// /// Gets or sets connection monitor location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets connection monitor tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets describes the source of connection monitor. /// - [JsonProperty(PropertyName = "properties.source")] - public ConnectionMonitorSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.source")] + public ConnectionMonitorSource Source {get; set; } /// /// Gets or sets describes the destination of connection monitor. /// - [JsonProperty(PropertyName = "properties.destination")] - public ConnectionMonitorDestination Destination { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination")] + public ConnectionMonitorDestination Destination {get; set; } /// - /// Gets or sets determines if the connection monitor will start - /// automatically once created. + /// Gets or sets determines if the connection monitor will start automatically + /// once created. /// - [JsonProperty(PropertyName = "properties.autoStart")] - public bool? AutoStart { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoStart")] + public bool? AutoStart {get; set; } /// /// Gets or sets monitoring interval in seconds. /// - [JsonProperty(PropertyName = "properties.monitoringIntervalInSeconds")] - public int? MonitoringIntervalInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monitoringIntervalInSeconds")] + public int? MonitoringIntervalInSeconds {get; set; } /// /// Gets or sets list of connection monitor endpoints. /// - [JsonProperty(PropertyName = "properties.endpoints")] - public IList Endpoints { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endpoints")] + public System.Collections.Generic.IList Endpoints {get; set; } /// /// Gets or sets list of connection monitor test configurations. /// - [JsonProperty(PropertyName = "properties.testConfigurations")] - public IList TestConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.testConfigurations")] + public System.Collections.Generic.IList TestConfigurations {get; set; } /// /// Gets or sets list of connection monitor test groups. /// - [JsonProperty(PropertyName = "properties.testGroups")] - public IList TestGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.testGroups")] + public System.Collections.Generic.IList TestGroups {get; set; } /// /// Gets or sets list of connection monitor outputs. /// - [JsonProperty(PropertyName = "properties.outputs")] - public IList Outputs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputs")] + public System.Collections.Generic.IList Outputs {get; set; } /// - /// Gets or sets optional notes to be associated with the connection - /// monitor. + /// Gets or sets optional notes to be associated with the connection monitor. /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notes")] + public string Notes {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Source != null) + + + if (this.Source != null) { - Source.Validate(); + this.Source.Validate(); } - if (Destination != null) + if (this.Destination != null) { - Destination.Validate(); + this.Destination.Validate(); } - if (MonitoringIntervalInSeconds != null) + if (this.MonitoringIntervalInSeconds != null) { - if (MonitoringIntervalInSeconds > 1800) + if (this.MonitoringIntervalInSeconds > 1800) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); } - if (MonitoringIntervalInSeconds < 30) + if (this.MonitoringIntervalInSeconds < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); } } - if (Endpoints != null) + if (this.Endpoints != null) { - foreach (var element in Endpoints) + foreach (var element in this.Endpoints) { if (element != null) { @@ -179,26 +185,28 @@ public virtual void Validate() } } } - if (TestConfigurations != null) + if (this.TestConfigurations != null) { - foreach (var element1 in TestConfigurations) + foreach (var element in this.TestConfigurations) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (TestGroups != null) + if (this.TestGroups != null) { - foreach (var element2 in TestGroups) + foreach (var element in this.TestGroups) { - if (element2 != null) + if (element != null) { - element2.Validate(); + element.Validate(); } } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorDestination.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorDestination.cs index a2c4c891be63..3e9c6a7eee50 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorDestination.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorDestination.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorDestination { /// - /// Initializes a new instance of the ConnectionMonitorDestination - /// class. + /// Initializes a new instance of the ConnectionMonitorDestination class. /// public ConnectionMonitorDestination() { @@ -29,20 +21,23 @@ public ConnectionMonitorDestination() } /// - /// Initializes a new instance of the ConnectionMonitorDestination - /// class. + /// Initializes a new instance of the ConnectionMonitorDestination class. /// - /// The ID of the resource used as the - /// destination by connection monitor. - /// Address of the connection monitor destination - /// (IP or domain name). - /// The destination port used by connection - /// monitor. + + /// The ID of the resource used as the destination by connection monitor. + /// + + /// Address of the connection monitor destination (IP or domain name). + /// + + /// The destination port used by connection monitor. + /// public ConnectionMonitorDestination(string resourceId = default(string), string address = default(string), int? port = default(int?)) + { - ResourceId = resourceId; - Address = address; - Port = port; + this.ResourceId = resourceId; + this.Address = address; + this.Port = port; CustomInit(); } @@ -51,45 +46,47 @@ public ConnectionMonitorDestination() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the resource used as the destination by - /// connection monitor. + /// Gets or sets the ID of the resource used as the destination by connection + /// monitor. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets address of the connection monitor destination (IP or - /// domain name). + /// Gets or sets address of the connection monitor destination (IP or domain + /// name). /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } /// /// Gets or sets the destination port used by connection monitor. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + + + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpoint.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpoint.cs index 90cc248d8cb0..b3db82e1ffe8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpoint.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpoint.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,31 +23,40 @@ public ConnectionMonitorEndpoint() /// /// Initializes a new instance of the ConnectionMonitorEndpoint class. /// - /// The name of the connection monitor - /// endpoint. - /// The endpoint type. Possible values include: - /// 'AzureVM', 'AzureVNet', 'AzureSubnet', 'ExternalAddress', - /// 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', - /// 'AzureVMSS' - /// Resource ID of the connection monitor - /// endpoint. - /// Address of the connection monitor endpoint - /// (IP or domain name). - /// Filter for sub-items within the - /// endpoint. - /// Endpoint scope. + + /// The name of the connection monitor endpoint. + /// + + /// The endpoint type. + /// Possible values include: 'AzureVM', 'AzureVNet', 'AzureSubnet', + /// 'ExternalAddress', 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', + /// 'AzureArcVM', 'AzureVMSS' + + /// Resource ID of the connection monitor endpoint. + /// + + /// Address of the connection monitor endpoint (IP or domain name). + /// + + /// Filter for sub-items within the endpoint. + /// + + /// Endpoint scope. + /// + /// Test coverage for the endpoint. - /// Possible values include: 'Default', 'Low', 'BelowAverage', - /// 'Average', 'AboveAverage', 'Full' + /// Possible values include: 'Default', 'Low', 'BelowAverage', 'Average', + /// 'AboveAverage', 'Full' public ConnectionMonitorEndpoint(string name, string type = default(string), string resourceId = default(string), string address = default(string), ConnectionMonitorEndpointFilter filter = default(ConnectionMonitorEndpointFilter), ConnectionMonitorEndpointScope scope = default(ConnectionMonitorEndpointScope), string coverageLevel = default(string)) + { - Name = name; - Type = type; - ResourceId = resourceId; - Address = address; - Filter = filter; - Scope = scope; - CoverageLevel = coverageLevel; + this.Name = name; + this.Type = type; + this.ResourceId = resourceId; + this.Address = address; + this.Filter = filter; + this.Scope = scope; + this.CoverageLevel = coverageLevel; CustomInit(); } @@ -63,66 +65,68 @@ public ConnectionMonitorEndpoint() /// partial void CustomInit(); + /// /// Gets or sets the name of the connection monitor endpoint. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the endpoint type. Possible values include: 'AzureVM', - /// 'AzureVNet', 'AzureSubnet', 'ExternalAddress', - /// 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', - /// 'AzureVMSS' + /// Gets or sets the endpoint type. Possible values include: 'AzureVM', 'AzureVNet', 'AzureSubnet', 'ExternalAddress', 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', 'AzureVMSS' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets resource ID of the connection monitor endpoint. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets address of the connection monitor endpoint (IP or - /// domain name). + /// Gets or sets address of the connection monitor endpoint (IP or domain + /// name). /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } /// /// Gets or sets filter for sub-items within the endpoint. /// - [JsonProperty(PropertyName = "filter")] - public ConnectionMonitorEndpointFilter Filter { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "filter")] + public ConnectionMonitorEndpointFilter Filter {get; set; } /// /// Gets or sets endpoint scope. /// - [JsonProperty(PropertyName = "scope")] - public ConnectionMonitorEndpointScope Scope { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public ConnectionMonitorEndpointScope Scope {get; set; } /// - /// Gets or sets test coverage for the endpoint. Possible values - /// include: 'Default', 'Low', 'BelowAverage', 'Average', - /// 'AboveAverage', 'Full' + /// Gets or sets test coverage for the endpoint. Possible values include: 'Default', 'Low', 'BelowAverage', 'Average', 'AboveAverage', 'Full' /// - [JsonProperty(PropertyName = "coverageLevel")] - public string CoverageLevel { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "coverageLevel")] + public string CoverageLevel {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilter.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilter.cs index 7568f85295dd..5a4ddce9f9f3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilter.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorEndpointFilter { /// - /// Initializes a new instance of the ConnectionMonitorEndpointFilter - /// class. + /// Initializes a new instance of the ConnectionMonitorEndpointFilter class. /// public ConnectionMonitorEndpointFilter() { @@ -30,17 +21,19 @@ public ConnectionMonitorEndpointFilter() } /// - /// Initializes a new instance of the ConnectionMonitorEndpointFilter - /// class. + /// Initializes a new instance of the ConnectionMonitorEndpointFilter class. /// - /// The behavior of the endpoint filter. Currently - /// only 'Include' is supported. Possible values include: - /// 'Include' - /// List of items in the filter. - public ConnectionMonitorEndpointFilter(string type = default(string), IList items = default(IList)) + + /// The behavior of the endpoint filter. Currently only 'Include' is supported. + /// Possible values include: 'Include' + + /// List of items in the filter. + /// + public ConnectionMonitorEndpointFilter(string type = default(string), System.Collections.Generic.IList items = default(System.Collections.Generic.IList)) + { - Type = type; - Items = items; + this.Type = type; + this.Items = items; CustomInit(); } @@ -49,18 +42,18 @@ public ConnectionMonitorEndpointFilter() /// partial void CustomInit(); + /// - /// Gets or sets the behavior of the endpoint filter. Currently only - /// 'Include' is supported. Possible values include: 'Include' + /// Gets or sets the behavior of the endpoint filter. Currently only 'Include' + /// is supported. Possible values include: 'Include' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets list of items in the filter. /// - [JsonProperty(PropertyName = "items")] - public IList Items { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "items")] + public System.Collections.Generic.IList Items {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItem.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItem.cs index 921690dd0a46..821c4009f98a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItem.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItem.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorEndpointFilterItem { /// - /// Initializes a new instance of the - /// ConnectionMonitorEndpointFilterItem class. + /// Initializes a new instance of the ConnectionMonitorEndpointFilterItem class. /// public ConnectionMonitorEndpointFilterItem() { @@ -28,17 +21,20 @@ public ConnectionMonitorEndpointFilterItem() } /// - /// Initializes a new instance of the - /// ConnectionMonitorEndpointFilterItem class. + /// Initializes a new instance of the ConnectionMonitorEndpointFilterItem class. /// - /// The type of item included in the filter. - /// Currently only 'AgentAddress' is supported. Possible values - /// include: 'AgentAddress' - /// The address of the filter item. + + /// The type of item included in the filter. Currently only 'AgentAddress' is + /// supported. + /// Possible values include: 'AgentAddress' + + /// The address of the filter item. + /// public ConnectionMonitorEndpointFilterItem(string type = default(string), string address = default(string)) + { - Type = type; - Address = address; + this.Type = type; + this.Address = address; CustomInit(); } @@ -47,19 +43,18 @@ public ConnectionMonitorEndpointFilterItem() /// partial void CustomInit(); + /// - /// Gets or sets the type of item included in the filter. Currently - /// only 'AgentAddress' is supported. Possible values include: - /// 'AgentAddress' + /// Gets or sets the type of item included in the filter. Currently only + /// 'AgentAddress' is supported. Possible values include: 'AgentAddress' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the address of the filter item. /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItemType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItemType.cs index 0e5c6175435c..15a6e71bd73a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItemType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterItemType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionMonitorEndpointFilterItemType. /// + + public static class ConnectionMonitorEndpointFilterItemType { public const string AgentAddress = "AgentAddress"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterType.cs index b7faa109bae0..e2ae016edf37 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointFilterType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionMonitorEndpointFilterType. /// + + public static class ConnectionMonitorEndpointFilterType { public const string Include = "Include"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScope.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScope.cs index 530599545f24..66cf1ee6a20e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScope.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScope.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorEndpointScope { /// - /// Initializes a new instance of the ConnectionMonitorEndpointScope - /// class. + /// Initializes a new instance of the ConnectionMonitorEndpointScope class. /// public ConnectionMonitorEndpointScope() { @@ -30,17 +21,19 @@ public ConnectionMonitorEndpointScope() } /// - /// Initializes a new instance of the ConnectionMonitorEndpointScope - /// class. + /// Initializes a new instance of the ConnectionMonitorEndpointScope class. /// - /// List of items which needs to be included to - /// the endpoint scope. - /// List of items which needs to be excluded from - /// the endpoint scope. - public ConnectionMonitorEndpointScope(IList include = default(IList), IList exclude = default(IList)) + + /// List of items which needs to be included to the endpoint scope. + /// + + /// List of items which needs to be excluded from the endpoint scope. + /// + public ConnectionMonitorEndpointScope(System.Collections.Generic.IList include = default(System.Collections.Generic.IList), System.Collections.Generic.IList exclude = default(System.Collections.Generic.IList)) + { - Include = include; - Exclude = exclude; + this.Include = include; + this.Exclude = exclude; CustomInit(); } @@ -49,19 +42,19 @@ public ConnectionMonitorEndpointScope() /// partial void CustomInit(); + /// - /// Gets or sets list of items which needs to be included to the - /// endpoint scope. + /// Gets or sets list of items which needs to be included to the endpoint + /// scope. /// - [JsonProperty(PropertyName = "include")] - public IList Include { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "include")] + public System.Collections.Generic.IList Include {get; set; } /// - /// Gets or sets list of items which needs to be excluded from the - /// endpoint scope. + /// Gets or sets list of items which needs to be excluded from the endpoint + /// scope. /// - [JsonProperty(PropertyName = "exclude")] - public IList Exclude { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "exclude")] + public System.Collections.Generic.IList Exclude {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScopeItem.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScopeItem.cs index 813ebe3edd79..267db0df79fe 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScopeItem.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorEndpointScopeItem.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorEndpointScopeItem { /// - /// Initializes a new instance of the - /// ConnectionMonitorEndpointScopeItem class. + /// Initializes a new instance of the ConnectionMonitorEndpointScopeItem class. /// public ConnectionMonitorEndpointScopeItem() { @@ -28,14 +21,16 @@ public ConnectionMonitorEndpointScopeItem() } /// - /// Initializes a new instance of the - /// ConnectionMonitorEndpointScopeItem class. + /// Initializes a new instance of the ConnectionMonitorEndpointScopeItem class. /// - /// The address of the endpoint item. Supported - /// types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. + + /// The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask + /// or IPv4/IPv6 IP address. + /// public ConnectionMonitorEndpointScopeItem(string address = default(string)) + { - Address = address; + this.Address = address; CustomInit(); } @@ -44,12 +39,12 @@ public ConnectionMonitorEndpointScopeItem() /// partial void CustomInit(); + /// /// Gets or sets the address of the endpoint item. Supported types are /// IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorHttpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorHttpConfiguration.cs index 9f52940d25c4..bc2a096082a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorHttpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorHttpConfiguration.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorHttpConfiguration { /// - /// Initializes a new instance of the - /// ConnectionMonitorHttpConfiguration class. + /// Initializes a new instance of the ConnectionMonitorHttpConfiguration class. /// public ConnectionMonitorHttpConfiguration() { @@ -31,29 +21,36 @@ public ConnectionMonitorHttpConfiguration() } /// - /// Initializes a new instance of the - /// ConnectionMonitorHttpConfiguration class. + /// Initializes a new instance of the ConnectionMonitorHttpConfiguration class. /// - /// The port to connect to. - /// The HTTP method to use. Possible values - /// include: 'Get', 'Post' - /// The path component of the URI. For instance, - /// "/dir1/dir2". - /// The HTTP headers to transmit with the - /// request. - /// HTTP status codes to consider - /// successful. For instance, "2xx,301-304,418". - /// Value indicating whether HTTPS is - /// preferred over HTTP in cases where the choice is not - /// explicit. - public ConnectionMonitorHttpConfiguration(int? port = default(int?), string method = default(string), string path = default(string), IList requestHeaders = default(IList), IList validStatusCodeRanges = default(IList), bool? preferHTTPS = default(bool?)) + + /// The port to connect to. + /// + + /// The HTTP method to use. + /// Possible values include: 'Get', 'Post' + + /// The path component of the URI. For instance, "/dir1/dir2". + /// + + /// The HTTP headers to transmit with the request. + /// + + /// HTTP status codes to consider successful. For instance, "2xx,301-304,418". + /// + + /// Value indicating whether HTTPS is preferred over HTTP in cases where the + /// choice is not explicit. + /// + public ConnectionMonitorHttpConfiguration(int? port = default(int?), string method = default(string), string path = default(string), System.Collections.Generic.IList requestHeaders = default(System.Collections.Generic.IList), System.Collections.Generic.IList validStatusCodeRanges = default(System.Collections.Generic.IList), bool? preferHttps = default(bool?)) + { - Port = port; - Method = method; - Path = path; - RequestHeaders = requestHeaders; - ValidStatusCodeRanges = validStatusCodeRanges; - PreferHTTPS = preferHTTPS; + this.Port = port; + this.Method = method; + this.Path = path; + this.RequestHeaders = requestHeaders; + this.ValidStatusCodeRanges = validStatusCodeRanges; + this.PreferHttps = preferHttps; CustomInit(); } @@ -62,65 +59,67 @@ public ConnectionMonitorHttpConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the port to connect to. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// - /// Gets or sets the HTTP method to use. Possible values include: - /// 'Get', 'Post' + /// Gets or sets the HTTP method to use. Possible values include: 'Get', 'Post' /// - [JsonProperty(PropertyName = "method")] - public string Method { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "method")] + public string Method {get; set; } /// - /// Gets or sets the path component of the URI. For instance, - /// "/dir1/dir2". + /// Gets or sets the path component of the URI. For instance, "/dir1/dir2". /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// /// Gets or sets the HTTP headers to transmit with the request. /// - [JsonProperty(PropertyName = "requestHeaders")] - public IList RequestHeaders { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestHeaders")] + public System.Collections.Generic.IList RequestHeaders {get; set; } /// - /// Gets or sets HTTP status codes to consider successful. For - /// instance, "2xx,301-304,418". + /// Gets or sets hTTP status codes to consider successful. For instance, + /// "2xx,301-304,418". /// - [JsonProperty(PropertyName = "validStatusCodeRanges")] - public IList ValidStatusCodeRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "validStatusCodeRanges")] + public System.Collections.Generic.IList ValidStatusCodeRanges {get; set; } /// - /// Gets or sets value indicating whether HTTPS is preferred over HTTP - /// in cases where the choice is not explicit. + /// Gets or sets value indicating whether HTTPS is preferred over HTTP in cases + /// where the choice is not explicit. /// - [JsonProperty(PropertyName = "preferHTTPS")] - public bool? PreferHTTPS { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "preferHTTPS")] + public bool? PreferHttps {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorIcmpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorIcmpConfiguration.cs index be968f378873..9ebe985d32c3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorIcmpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorIcmpConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorIcmpConfiguration { /// - /// Initializes a new instance of the - /// ConnectionMonitorIcmpConfiguration class. + /// Initializes a new instance of the ConnectionMonitorIcmpConfiguration class. /// public ConnectionMonitorIcmpConfiguration() { @@ -28,14 +21,16 @@ public ConnectionMonitorIcmpConfiguration() } /// - /// Initializes a new instance of the - /// ConnectionMonitorIcmpConfiguration class. + /// Initializes a new instance of the ConnectionMonitorIcmpConfiguration class. /// - /// Value indicating whether path - /// evaluation with trace route should be disabled. + + /// Value indicating whether path evaluation with trace route should be + /// disabled. + /// public ConnectionMonitorIcmpConfiguration(bool? disableTraceRoute = default(bool?)) + { - DisableTraceRoute = disableTraceRoute; + this.DisableTraceRoute = disableTraceRoute; CustomInit(); } @@ -44,12 +39,12 @@ public ConnectionMonitorIcmpConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets value indicating whether path evaluation with trace - /// route should be disabled. + /// Gets or sets value indicating whether path evaluation with trace route + /// should be disabled. /// - [JsonProperty(PropertyName = "disableTraceRoute")] - public bool? DisableTraceRoute { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "disableTraceRoute")] + public bool? DisableTraceRoute {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorOutput.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorOutput.cs index 2540a0168f34..96559c473753 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorOutput.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorOutput.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,18 @@ public ConnectionMonitorOutput() /// /// Initializes a new instance of the ConnectionMonitorOutput class. /// - /// Connection monitor output destination type. - /// Currently, only "Workspace" is supported. Possible values include: - /// 'Workspace' - /// Describes the settings for - /// producing output into a log analytics workspace. + + /// Connection monitor output destination type. Currently, only "Workspace" is + /// supported. + /// Possible values include: 'Workspace' + + /// Describes the settings for producing output into a log analytics workspace. + /// public ConnectionMonitorOutput(string type = default(string), ConnectionMonitorWorkspaceSettings workspaceSettings = default(ConnectionMonitorWorkspaceSettings)) + { - Type = type; - WorkspaceSettings = workspaceSettings; + this.Type = type; + this.WorkspaceSettings = workspaceSettings; CustomInit(); } @@ -46,19 +43,19 @@ public ConnectionMonitorOutput() /// partial void CustomInit(); + /// - /// Gets or sets connection monitor output destination type. Currently, - /// only "Workspace" is supported. Possible values include: 'Workspace' + /// Gets or sets connection monitor output destination type. Currently, only + /// "Workspace" is supported. Possible values include: 'Workspace' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets describes the settings for producing output into a log /// analytics workspace. /// - [JsonProperty(PropertyName = "workspaceSettings")] - public ConnectionMonitorWorkspaceSettings WorkspaceSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceSettings")] + public ConnectionMonitorWorkspaceSettings WorkspaceSettings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorParameters.cs index 403ef9585674..3b73568b33cc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorParameters.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorParameters { /// - /// Initializes a new instance of the ConnectionMonitorParameters - /// class. + /// Initializes a new instance of the ConnectionMonitorParameters class. /// public ConnectionMonitorParameters() { @@ -31,37 +21,47 @@ public ConnectionMonitorParameters() } /// - /// Initializes a new instance of the ConnectionMonitorParameters - /// class. + /// Initializes a new instance of the ConnectionMonitorParameters class. /// - /// Describes the source of connection - /// monitor. - /// Describes the destination of connection - /// monitor. - /// Determines if the connection monitor will - /// start automatically once created. - /// Monitoring interval in - /// seconds. - /// List of connection monitor - /// endpoints. - /// List of connection monitor test - /// configurations. - /// List of connection monitor test - /// groups. - /// List of connection monitor outputs. - /// Optional notes to be associated with the - /// connection monitor. - public ConnectionMonitorParameters(ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), IList endpoints = default(IList), IList testConfigurations = default(IList), IList testGroups = default(IList), IList outputs = default(IList), string notes = default(string)) + + /// Describes the source of connection monitor. + /// + + /// Describes the destination of connection monitor. + /// + + /// Determines if the connection monitor will start automatically once created. + /// + + /// Monitoring interval in seconds. + /// + + /// List of connection monitor endpoints. + /// + + /// List of connection monitor test configurations. + /// + + /// List of connection monitor test groups. + /// + + /// List of connection monitor outputs. + /// + + /// Optional notes to be associated with the connection monitor. + /// + public ConnectionMonitorParameters(ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), System.Collections.Generic.IList endpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList testConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList testGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputs = default(System.Collections.Generic.IList), string notes = default(string)) + { - Source = source; - Destination = destination; - AutoStart = autoStart; - MonitoringIntervalInSeconds = monitoringIntervalInSeconds; - Endpoints = endpoints; - TestConfigurations = testConfigurations; - TestGroups = testGroups; - Outputs = outputs; - Notes = notes; + this.Source = source; + this.Destination = destination; + this.AutoStart = autoStart; + this.MonitoringIntervalInSeconds = monitoringIntervalInSeconds; + this.Endpoints = endpoints; + this.TestConfigurations = testConfigurations; + this.TestGroups = testGroups; + this.Outputs = outputs; + this.Notes = notes; CustomInit(); } @@ -70,92 +70,91 @@ public ConnectionMonitorParameters() /// partial void CustomInit(); + /// /// Gets or sets describes the source of connection monitor. /// - [JsonProperty(PropertyName = "source")] - public ConnectionMonitorSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public ConnectionMonitorSource Source {get; set; } /// /// Gets or sets describes the destination of connection monitor. /// - [JsonProperty(PropertyName = "destination")] - public ConnectionMonitorDestination Destination { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destination")] + public ConnectionMonitorDestination Destination {get; set; } /// - /// Gets or sets determines if the connection monitor will start - /// automatically once created. + /// Gets or sets determines if the connection monitor will start automatically + /// once created. /// - [JsonProperty(PropertyName = "autoStart")] - public bool? AutoStart { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "autoStart")] + public bool? AutoStart {get; set; } /// /// Gets or sets monitoring interval in seconds. /// - [JsonProperty(PropertyName = "monitoringIntervalInSeconds")] - public int? MonitoringIntervalInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "monitoringIntervalInSeconds")] + public int? MonitoringIntervalInSeconds {get; set; } /// /// Gets or sets list of connection monitor endpoints. /// - [JsonProperty(PropertyName = "endpoints")] - public IList Endpoints { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endpoints")] + public System.Collections.Generic.IList Endpoints {get; set; } /// /// Gets or sets list of connection monitor test configurations. /// - [JsonProperty(PropertyName = "testConfigurations")] - public IList TestConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "testConfigurations")] + public System.Collections.Generic.IList TestConfigurations {get; set; } /// /// Gets or sets list of connection monitor test groups. /// - [JsonProperty(PropertyName = "testGroups")] - public IList TestGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "testGroups")] + public System.Collections.Generic.IList TestGroups {get; set; } /// /// Gets or sets list of connection monitor outputs. /// - [JsonProperty(PropertyName = "outputs")] - public IList Outputs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "outputs")] + public System.Collections.Generic.IList Outputs {get; set; } /// - /// Gets or sets optional notes to be associated with the connection - /// monitor. + /// Gets or sets optional notes to be associated with the connection monitor. /// - [JsonProperty(PropertyName = "notes")] - public string Notes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "notes")] + public string Notes {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Source != null) + if (this.Source != null) { - Source.Validate(); + this.Source.Validate(); } - if (Destination != null) + if (this.Destination != null) { - Destination.Validate(); + this.Destination.Validate(); } - if (MonitoringIntervalInSeconds != null) + if (this.MonitoringIntervalInSeconds != null) { - if (MonitoringIntervalInSeconds > 1800) + if (this.MonitoringIntervalInSeconds > 1800) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); } - if (MonitoringIntervalInSeconds < 30) + if (this.MonitoringIntervalInSeconds < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); } } - if (Endpoints != null) + if (this.Endpoints != null) { - foreach (var element in Endpoints) + foreach (var element in this.Endpoints) { if (element != null) { @@ -163,26 +162,28 @@ public virtual void Validate() } } } - if (TestConfigurations != null) + if (this.TestConfigurations != null) { - foreach (var element1 in TestConfigurations) + foreach (var element in this.TestConfigurations) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (TestGroups != null) + if (this.TestGroups != null) { - foreach (var element2 in TestGroups) + foreach (var element in this.TestGroups) { - if (element2 != null) + if (element != null) { - element2.Validate(); + element.Validate(); } } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorQueryResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorQueryResult.cs index ba173903f5b3..8d75b04a16e1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorQueryResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorQueryResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorQueryResult { /// - /// Initializes a new instance of the ConnectionMonitorQueryResult - /// class. + /// Initializes a new instance of the ConnectionMonitorQueryResult class. /// public ConnectionMonitorQueryResult() { @@ -30,16 +21,19 @@ public ConnectionMonitorQueryResult() } /// - /// Initializes a new instance of the ConnectionMonitorQueryResult - /// class. + /// Initializes a new instance of the ConnectionMonitorQueryResult class. /// + /// Status of connection monitor source. - /// Possible values include: 'Unknown', 'Active', 'Inactive' - /// Information about connection states. - public ConnectionMonitorQueryResult(string sourceStatus = default(string), IList states = default(IList)) + /// Possible values include: 'Unknown', 'Active', 'Inactive' + + /// Information about connection states. + /// + public ConnectionMonitorQueryResult(string sourceStatus = default(string), System.Collections.Generic.IList states = default(System.Collections.Generic.IList)) + { - SourceStatus = sourceStatus; - States = states; + this.SourceStatus = sourceStatus; + this.States = states; CustomInit(); } @@ -48,18 +42,17 @@ public ConnectionMonitorQueryResult() /// partial void CustomInit(); + /// - /// Gets or sets status of connection monitor source. Possible values - /// include: 'Unknown', 'Active', 'Inactive' + /// Gets or sets status of connection monitor source. Possible values include: 'Unknown', 'Active', 'Inactive' /// - [JsonProperty(PropertyName = "sourceStatus")] - public string SourceStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceStatus")] + public string SourceStatus {get; set; } /// /// Gets or sets information about connection states. /// - [JsonProperty(PropertyName = "states")] - public IList States { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "states")] + public System.Collections.Generic.IList States {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResult.cs index afe0533ea4c7..70be688e0d5f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResult.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Information about the connection monitor. /// - [Rest.Serialization.JsonTransformation] - public partial class ConnectionMonitorResult : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ConnectionMonitorResult : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ConnectionMonitorResult class. @@ -35,61 +24,85 @@ public ConnectionMonitorResult() /// /// Initializes a new instance of the ConnectionMonitorResult class. /// - /// Name of the connection monitor. - /// ID of the connection monitor. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Connection monitor type. - /// Connection monitor location. - /// Connection monitor tags. - /// Describes the source of connection - /// monitor. - /// Describes the destination of connection - /// monitor. - /// Determines if the connection monitor will - /// start automatically once created. - /// Monitoring interval in - /// seconds. - /// List of connection monitor - /// endpoints. - /// List of connection monitor test - /// configurations. - /// List of connection monitor test - /// groups. - /// List of connection monitor outputs. - /// Optional notes to be associated with the - /// connection monitor. - /// The provisioning state of the - /// connection monitor. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The date and time when the connection - /// monitor was started. - /// The monitoring status of the - /// connection monitor. + + /// Name of the connection monitor. + /// + + /// ID of the connection monitor. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Connection monitor type. + /// + + /// Connection monitor location. + /// + + /// Connection monitor tags. + /// + + /// The provisioning state of the connection monitor. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Describes the source of connection monitor. + /// + + /// Describes the destination of connection monitor. + /// + + /// Determines if the connection monitor will start automatically once created. + /// + + /// Monitoring interval in seconds. + /// + + /// List of connection monitor endpoints. + /// + + /// List of connection monitor test configurations. + /// + + /// List of connection monitor test groups. + /// + + /// List of connection monitor outputs. + /// + + /// Optional notes to be associated with the connection monitor. + /// + + /// The date and time when the connection monitor was started. + /// + + /// The monitoring status of the connection monitor. + /// + /// Type of connection monitor. - /// Possible values include: 'MultiEndpoint', - /// 'SingleSourceDestination' - public ConnectionMonitorResult(string name = default(string), string id = default(string), string etag = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), IList endpoints = default(IList), IList testConfigurations = default(IList), IList testGroups = default(IList), IList outputs = default(IList), string notes = default(string), string provisioningState = default(string), System.DateTime? startTime = default(System.DateTime?), string monitoringStatus = default(string), string connectionMonitorType = default(string)) + /// Possible values include: 'MultiEndpoint', 'SingleSourceDestination' + public ConnectionMonitorResult(string name = default(string), string id = default(string), string etag = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string provisioningState = default(string), ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), System.Collections.Generic.IList endpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList testConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList testGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputs = default(System.Collections.Generic.IList), string notes = default(string), System.DateTime? startTime = default(System.DateTime?), string monitoringStatus = default(string), string connectionMonitorType = default(string)) + { - Name = name; - Id = id; - Etag = etag; - Type = type; - Location = location; - Tags = tags; - Source = source; - Destination = destination; - AutoStart = autoStart; - MonitoringIntervalInSeconds = monitoringIntervalInSeconds; - Endpoints = endpoints; - TestConfigurations = testConfigurations; - TestGroups = testGroups; - Outputs = outputs; - Notes = notes; - ProvisioningState = provisioningState; - StartTime = startTime; - MonitoringStatus = monitoringStatus; - ConnectionMonitorType = connectionMonitorType; + this.Name = name; + this.Id = id; + this.Etag = etag; + this.Type = type; + this.Location = location; + this.Tags = tags; + this.ProvisioningState = provisioningState; + this.Source = source; + this.Destination = destination; + this.AutoStart = autoStart; + this.MonitoringIntervalInSeconds = monitoringIntervalInSeconds; + this.Endpoints = endpoints; + this.TestConfigurations = testConfigurations; + this.TestGroups = testGroups; + this.Outputs = outputs; + this.Notes = notes; + this.StartTime = startTime; + this.MonitoringStatus = monitoringStatus; + this.ConnectionMonitorType = connectionMonitorType; CustomInit(); } @@ -98,155 +111,159 @@ public ConnectionMonitorResult() /// partial void CustomInit(); + /// /// Gets name of the connection monitor. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets ID of the connection monitor. + /// Gets iD of the connection monitor. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Gets connection monitor type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets connection monitor location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets connection monitor tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets describes the source of connection monitor. /// - [JsonProperty(PropertyName = "properties.source")] - public ConnectionMonitorSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.source")] + public ConnectionMonitorSource Source {get; set; } /// /// Gets or sets describes the destination of connection monitor. /// - [JsonProperty(PropertyName = "properties.destination")] - public ConnectionMonitorDestination Destination { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination")] + public ConnectionMonitorDestination Destination {get; set; } /// - /// Gets or sets determines if the connection monitor will start - /// automatically once created. + /// Gets or sets determines if the connection monitor will start automatically + /// once created. /// - [JsonProperty(PropertyName = "properties.autoStart")] - public bool? AutoStart { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoStart")] + public bool? AutoStart {get; set; } /// /// Gets or sets monitoring interval in seconds. /// - [JsonProperty(PropertyName = "properties.monitoringIntervalInSeconds")] - public int? MonitoringIntervalInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monitoringIntervalInSeconds")] + public int? MonitoringIntervalInSeconds {get; set; } /// /// Gets or sets list of connection monitor endpoints. /// - [JsonProperty(PropertyName = "properties.endpoints")] - public IList Endpoints { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endpoints")] + public System.Collections.Generic.IList Endpoints {get; set; } /// /// Gets or sets list of connection monitor test configurations. /// - [JsonProperty(PropertyName = "properties.testConfigurations")] - public IList TestConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.testConfigurations")] + public System.Collections.Generic.IList TestConfigurations {get; set; } /// /// Gets or sets list of connection monitor test groups. /// - [JsonProperty(PropertyName = "properties.testGroups")] - public IList TestGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.testGroups")] + public System.Collections.Generic.IList TestGroups {get; set; } /// /// Gets or sets list of connection monitor outputs. /// - [JsonProperty(PropertyName = "properties.outputs")] - public IList Outputs { get; set; } - - /// - /// Gets or sets optional notes to be associated with the connection - /// monitor. - /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputs")] + public System.Collections.Generic.IList Outputs {get; set; } /// - /// Gets the provisioning state of the connection monitor. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets optional notes to be associated with the connection monitor. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notes")] + public string Notes {get; set; } /// /// Gets the date and time when the connection monitor was started. /// - [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.startTime")] + public System.DateTime? StartTime {get; private set; } /// /// Gets the monitoring status of the connection monitor. /// - [JsonProperty(PropertyName = "properties.monitoringStatus")] - public string MonitoringStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monitoringStatus")] + public string MonitoringStatus {get; private set; } /// - /// Gets type of connection monitor. Possible values include: - /// 'MultiEndpoint', 'SingleSourceDestination' + /// Gets type of connection monitor. Possible values include: 'MultiEndpoint', 'SingleSourceDestination' /// - [JsonProperty(PropertyName = "properties.connectionMonitorType")] - public string ConnectionMonitorType { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionMonitorType")] + public string ConnectionMonitorType {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Source != null) + + + + + + + + if (this.Source != null) { - Source.Validate(); + this.Source.Validate(); } - if (Destination != null) + if (this.Destination != null) { - Destination.Validate(); + this.Destination.Validate(); } - if (MonitoringIntervalInSeconds != null) + if (this.MonitoringIntervalInSeconds != null) { - if (MonitoringIntervalInSeconds > 1800) + if (this.MonitoringIntervalInSeconds > 1800) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); } - if (MonitoringIntervalInSeconds < 30) + if (this.MonitoringIntervalInSeconds < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); } } - if (Endpoints != null) + if (this.Endpoints != null) { - foreach (var element in Endpoints) + foreach (var element in this.Endpoints) { if (element != null) { @@ -254,26 +271,30 @@ public virtual void Validate() } } } - if (TestConfigurations != null) + if (this.TestConfigurations != null) { - foreach (var element1 in TestConfigurations) + foreach (var element in this.TestConfigurations) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (TestGroups != null) + if (this.TestGroups != null) { - foreach (var element2 in TestGroups) + foreach (var element in this.TestGroups) { - if (element2 != null) + if (element != null) { - element2.Validate(); + element.Validate(); } } } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResultProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResultProperties.cs new file mode 100644 index 000000000000..e7e6d629301f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorResultProperties.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Describes the properties of a connection monitor. + /// + public partial class ConnectionMonitorResultProperties : ConnectionMonitorParameters + { + /// + /// Initializes a new instance of the ConnectionMonitorResultProperties class. + /// + public ConnectionMonitorResultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionMonitorResultProperties class. + /// + + /// Describes the source of connection monitor. + /// + + /// Describes the destination of connection monitor. + /// + + /// Determines if the connection monitor will start automatically once created. + /// + + /// Monitoring interval in seconds. + /// + + /// List of connection monitor endpoints. + /// + + /// List of connection monitor test configurations. + /// + + /// List of connection monitor test groups. + /// + + /// List of connection monitor outputs. + /// + + /// Optional notes to be associated with the connection monitor. + /// + + /// The provisioning state of the connection monitor. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The date and time when the connection monitor was started. + /// + + /// The monitoring status of the connection monitor. + /// + + /// Type of connection monitor. + /// Possible values include: 'MultiEndpoint', 'SingleSourceDestination' + public ConnectionMonitorResultProperties(ConnectionMonitorSource source = default(ConnectionMonitorSource), ConnectionMonitorDestination destination = default(ConnectionMonitorDestination), bool? autoStart = default(bool?), int? monitoringIntervalInSeconds = default(int?), System.Collections.Generic.IList endpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList testConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList testGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList outputs = default(System.Collections.Generic.IList), string notes = default(string), string provisioningState = default(string), System.DateTime? startTime = default(System.DateTime?), string monitoringStatus = default(string), string connectionMonitorType = default(string)) + + : base(source, destination, autoStart, monitoringIntervalInSeconds, endpoints, testConfigurations, testGroups, outputs, notes) + { + this.ProvisioningState = provisioningState; + this.StartTime = startTime; + this.MonitoringStatus = monitoringStatus; + this.ConnectionMonitorType = connectionMonitorType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the date and time when the connection monitor was started. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; private set; } + + /// + /// Gets the monitoring status of the connection monitor. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "monitoringStatus")] + public string MonitoringStatus {get; private set; } + + /// + /// Gets type of connection monitor. Possible values include: 'MultiEndpoint', 'SingleSourceDestination' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionMonitorType")] + public string ConnectionMonitorType {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSource.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSource.cs index 83bd49a53e0d..744295d1ae54 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSource.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,17 @@ public ConnectionMonitorSource() /// /// Initializes a new instance of the ConnectionMonitorSource class. /// - /// The ID of the resource used as the source - /// by connection monitor. - /// The source port used by connection - /// monitor. + + /// The ID of the resource used as the source by connection monitor. + /// + + /// The source port used by connection monitor. + /// public ConnectionMonitorSource(string resourceId, int? port = default(int?)) + { - ResourceId = resourceId; - Port = port; + this.ResourceId = resourceId; + this.Port = port; CustomInit(); } @@ -46,42 +42,43 @@ public ConnectionMonitorSource() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the resource used as the source by - /// connection monitor. + /// Gets or sets the ID of the resource used as the source by connection + /// monitor. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the source port used by connection monitor. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ResourceId == null) + if (this.ResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceId"); } - if (Port != null) + + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSourceStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSourceStatus.cs index b7ba0195f771..e6400728c37d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSourceStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSourceStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionMonitorSourceStatus. /// + + public static class ConnectionMonitorSourceStatus { public const string Unknown = "Unknown"; public const string Active = "Active"; public const string Inactive = "Inactive"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSuccessThreshold.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSuccessThreshold.cs index c7dc20fd5f0b..a9ee4bab0ff5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSuccessThreshold.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorSuccessThreshold.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorSuccessThreshold { /// - /// Initializes a new instance of the ConnectionMonitorSuccessThreshold - /// class. + /// Initializes a new instance of the ConnectionMonitorSuccessThreshold class. /// public ConnectionMonitorSuccessThreshold() { @@ -28,18 +21,21 @@ public ConnectionMonitorSuccessThreshold() } /// - /// Initializes a new instance of the ConnectionMonitorSuccessThreshold - /// class. + /// Initializes a new instance of the ConnectionMonitorSuccessThreshold class. /// - /// The maximum percentage of failed - /// checks permitted for a test to evaluate as successful. - /// The maximum round-trip time in - /// milliseconds permitted for a test to evaluate as - /// successful. - public ConnectionMonitorSuccessThreshold(int? checksFailedPercent = default(int?), double? roundTripTimeMs = default(double?)) + + /// The maximum percentage of failed checks permitted for a test to evaluate as + /// successful. + /// + + /// The maximum round-trip time in milliseconds permitted for a test to + /// evaluate as successful. + /// + public ConnectionMonitorSuccessThreshold(int? checksFailedPercent = default(int?), double? roundTripTimeMS = default(double?)) + { - ChecksFailedPercent = checksFailedPercent; - RoundTripTimeMs = roundTripTimeMs; + this.ChecksFailedPercent = checksFailedPercent; + this.RoundTripTimeMS = roundTripTimeMS; CustomInit(); } @@ -48,19 +44,19 @@ public ConnectionMonitorSuccessThreshold() /// partial void CustomInit(); + /// - /// Gets or sets the maximum percentage of failed checks permitted for - /// a test to evaluate as successful. + /// Gets or sets the maximum percentage of failed checks permitted for a test + /// to evaluate as successful. /// - [JsonProperty(PropertyName = "checksFailedPercent")] - public int? ChecksFailedPercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "checksFailedPercent")] + public int? ChecksFailedPercent {get; set; } /// - /// Gets or sets the maximum round-trip time in milliseconds permitted - /// for a test to evaluate as successful. + /// Gets or sets the maximum round-trip time in milliseconds permitted for a + /// test to evaluate as successful. /// - [JsonProperty(PropertyName = "roundTripTimeMs")] - public double? RoundTripTimeMs { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "roundTripTimeMs")] + public double? RoundTripTimeMS {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTcpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTcpConfiguration.cs index 2fe276a1ca7c..555fb6f7e5c6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTcpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTcpConfiguration.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorTcpConfiguration { /// - /// Initializes a new instance of the ConnectionMonitorTcpConfiguration - /// class. + /// Initializes a new instance of the ConnectionMonitorTcpConfiguration class. /// public ConnectionMonitorTcpConfiguration() { @@ -29,19 +21,24 @@ public ConnectionMonitorTcpConfiguration() } /// - /// Initializes a new instance of the ConnectionMonitorTcpConfiguration - /// class. + /// Initializes a new instance of the ConnectionMonitorTcpConfiguration class. /// - /// The port to connect to. - /// Value indicating whether path - /// evaluation with trace route should be disabled. + + /// The port to connect to. + /// + + /// Value indicating whether path evaluation with trace route should be + /// disabled. + /// + /// Destination port behavior. - /// Possible values include: 'None', 'ListenIfAvailable' + /// Possible values include: 'None', 'ListenIfAvailable' public ConnectionMonitorTcpConfiguration(int? port = default(int?), bool? disableTraceRoute = default(bool?), string destinationPortBehavior = default(string)) + { - Port = port; - DisableTraceRoute = disableTraceRoute; - DestinationPortBehavior = destinationPortBehavior; + this.Port = port; + this.DisableTraceRoute = disableTraceRoute; + this.DestinationPortBehavior = destinationPortBehavior; CustomInit(); } @@ -50,45 +47,45 @@ public ConnectionMonitorTcpConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the port to connect to. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// - /// Gets or sets value indicating whether path evaluation with trace - /// route should be disabled. + /// Gets or sets value indicating whether path evaluation with trace route + /// should be disabled. /// - [JsonProperty(PropertyName = "disableTraceRoute")] - public bool? DisableTraceRoute { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disableTraceRoute")] + public bool? DisableTraceRoute {get; set; } /// - /// Gets or sets destination port behavior. Possible values include: - /// 'None', 'ListenIfAvailable' + /// Gets or sets destination port behavior. Possible values include: 'None', 'ListenIfAvailable' /// - [JsonProperty(PropertyName = "destinationPortBehavior")] - public string DestinationPortBehavior { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortBehavior")] + public string DestinationPortBehavior {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfiguration.cs index 90d21586f194..efece80bc667 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfiguration.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ConnectionMonitorTestConfiguration { /// - /// Initializes a new instance of the - /// ConnectionMonitorTestConfiguration class. + /// Initializes a new instance of the ConnectionMonitorTestConfiguration class. /// public ConnectionMonitorTestConfiguration() { @@ -29,37 +21,44 @@ public ConnectionMonitorTestConfiguration() } /// - /// Initializes a new instance of the - /// ConnectionMonitorTestConfiguration class. + /// Initializes a new instance of the ConnectionMonitorTestConfiguration class. /// - /// The name of the connection monitor test - /// configuration. + + /// The name of the connection monitor test configuration. + /// + + /// The frequency of test evaluation, in seconds. + /// + /// The protocol to use in test evaluation. - /// Possible values include: 'Tcp', 'Http', 'Icmp' - /// The frequency of test evaluation, in - /// seconds. - /// The preferred IP version to use in - /// test evaluation. The connection monitor may choose to use a - /// different version depending on other parameters. Possible values - /// include: 'IPv4', 'IPv6' - /// The parameters used to perform test - /// evaluation over HTTP. - /// The parameters used to perform test - /// evaluation over TCP. - /// The parameters used to perform test - /// evaluation over ICMP. - /// The threshold for declaring a test - /// successful. + /// Possible values include: 'Tcp', 'Http', 'Icmp' + + /// The preferred IP version to use in test evaluation. The connection monitor + /// may choose to use a different version depending on other parameters. + /// Possible values include: 'IPv4', 'IPv6' + + /// The parameters used to perform test evaluation over HTTP. + /// + + /// The parameters used to perform test evaluation over TCP. + /// + + /// The parameters used to perform test evaluation over ICMP. + /// + + /// The threshold for declaring a test successful. + /// public ConnectionMonitorTestConfiguration(string name, string protocol, int? testFrequencySec = default(int?), string preferredIPVersion = default(string), ConnectionMonitorHttpConfiguration httpConfiguration = default(ConnectionMonitorHttpConfiguration), ConnectionMonitorTcpConfiguration tcpConfiguration = default(ConnectionMonitorTcpConfiguration), ConnectionMonitorIcmpConfiguration icmpConfiguration = default(ConnectionMonitorIcmpConfiguration), ConnectionMonitorSuccessThreshold successThreshold = default(ConnectionMonitorSuccessThreshold)) + { - Name = name; - TestFrequencySec = testFrequencySec; - Protocol = protocol; - PreferredIPVersion = preferredIPVersion; - HttpConfiguration = httpConfiguration; - TcpConfiguration = tcpConfiguration; - IcmpConfiguration = icmpConfiguration; - SuccessThreshold = successThreshold; + this.Name = name; + this.TestFrequencySec = testFrequencySec; + this.Protocol = protocol; + this.PreferredIPVersion = preferredIPVersion; + this.HttpConfiguration = httpConfiguration; + this.TcpConfiguration = tcpConfiguration; + this.IcmpConfiguration = icmpConfiguration; + this.SuccessThreshold = successThreshold; CustomInit(); } @@ -68,85 +67,85 @@ public ConnectionMonitorTestConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the name of the connection monitor test configuration. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the frequency of test evaluation, in seconds. /// - [JsonProperty(PropertyName = "testFrequencySec")] - public int? TestFrequencySec { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "testFrequencySec")] + public int? TestFrequencySec {get; set; } /// - /// Gets or sets the protocol to use in test evaluation. Possible - /// values include: 'Tcp', 'Http', 'Icmp' + /// Gets or sets the protocol to use in test evaluation. Possible values include: 'Tcp', 'Http', 'Icmp' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets the preferred IP version to use in test evaluation. - /// The connection monitor may choose to use a different version - /// depending on other parameters. Possible values include: 'IPv4', - /// 'IPv6' + /// Gets or sets the preferred IP version to use in test evaluation. The + /// connection monitor may choose to use a different version depending on other + /// parameters. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "preferredIPVersion")] - public string PreferredIPVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "preferredIPVersion")] + public string PreferredIPVersion {get; set; } /// - /// Gets or sets the parameters used to perform test evaluation over - /// HTTP. + /// Gets or sets the parameters used to perform test evaluation over HTTP. /// - [JsonProperty(PropertyName = "httpConfiguration")] - public ConnectionMonitorHttpConfiguration HttpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "httpConfiguration")] + public ConnectionMonitorHttpConfiguration HttpConfiguration {get; set; } /// - /// Gets or sets the parameters used to perform test evaluation over - /// TCP. + /// Gets or sets the parameters used to perform test evaluation over TCP. /// - [JsonProperty(PropertyName = "tcpConfiguration")] - public ConnectionMonitorTcpConfiguration TcpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tcpConfiguration")] + public ConnectionMonitorTcpConfiguration TcpConfiguration {get; set; } /// - /// Gets or sets the parameters used to perform test evaluation over - /// ICMP. + /// Gets or sets the parameters used to perform test evaluation over ICMP. /// - [JsonProperty(PropertyName = "icmpConfiguration")] - public ConnectionMonitorIcmpConfiguration IcmpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "icmpConfiguration")] + public ConnectionMonitorIcmpConfiguration IcmpConfiguration {get; set; } /// /// Gets or sets the threshold for declaring a test successful. /// - [JsonProperty(PropertyName = "successThreshold")] - public ConnectionMonitorSuccessThreshold SuccessThreshold { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "successThreshold")] + public ConnectionMonitorSuccessThreshold SuccessThreshold {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Protocol == null) + if (this.Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } - if (HttpConfiguration != null) + + + + if (this.HttpConfiguration != null) { - HttpConfiguration.Validate(); + this.HttpConfiguration.Validate(); } - if (TcpConfiguration != null) + if (this.TcpConfiguration != null) { - TcpConfiguration.Validate(); + this.TcpConfiguration.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfigurationProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfigurationProtocol.cs index e932e55cfd02..6d236b7ebe92 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfigurationProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestConfigurationProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionMonitorTestConfigurationProtocol. /// + + public static class ConnectionMonitorTestConfigurationProtocol { public const string Tcp = "Tcp"; public const string Http = "Http"; public const string Icmp = "Icmp"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestGroup.cs index 7665e1cc4275..0afcfa369627 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorTestGroup.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,22 +23,29 @@ public ConnectionMonitorTestGroup() /// /// Initializes a new instance of the ConnectionMonitorTestGroup class. /// - /// The name of the connection monitor test - /// group. - /// List of test configuration - /// names. - /// List of source endpoint names. - /// List of destination endpoint - /// names. - /// Value indicating whether test group is - /// disabled. - public ConnectionMonitorTestGroup(string name, IList testConfigurations, IList sources, IList destinations, bool? disable = default(bool?)) + + /// The name of the connection monitor test group. + /// + + /// Value indicating whether test group is disabled. + /// + + /// List of test configuration names. + /// + + /// List of source endpoint names. + /// + + /// List of destination endpoint names. + /// + public ConnectionMonitorTestGroup(string name, System.Collections.Generic.IList testConfigurations, System.Collections.Generic.IList sources, System.Collections.Generic.IList destinations, bool? disable = default(bool?)) + { - Name = name; - Disable = disable; - TestConfigurations = testConfigurations; - Sources = sources; - Destinations = destinations; + this.Name = name; + this.Disable = disable; + this.TestConfigurations = testConfigurations; + this.Sources = sources; + this.Destinations = destinations; CustomInit(); } @@ -56,60 +54,64 @@ public ConnectionMonitorTestGroup() /// partial void CustomInit(); + /// /// Gets or sets the name of the connection monitor test group. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets value indicating whether test group is disabled. /// - [JsonProperty(PropertyName = "disable")] - public bool? Disable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disable")] + public bool? Disable {get; set; } /// /// Gets or sets list of test configuration names. /// - [JsonProperty(PropertyName = "testConfigurations")] - public IList TestConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "testConfigurations")] + public System.Collections.Generic.IList TestConfigurations {get; set; } /// /// Gets or sets list of source endpoint names. /// - [JsonProperty(PropertyName = "sources")] - public IList Sources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sources")] + public System.Collections.Generic.IList Sources {get; set; } /// /// Gets or sets list of destination endpoint names. /// - [JsonProperty(PropertyName = "destinations")] - public IList Destinations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (TestConfigurations == null) + if (this.TestConfigurations == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TestConfigurations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TestConfigurations"); } - if (Sources == null) + if (this.Sources == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Sources"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Sources"); } - if (Destinations == null) + if (this.Destinations == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Destinations"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorType.cs index 61ac41f94821..f921391822ef 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionMonitorType. /// + + public static class ConnectionMonitorType { public const string MultiEndpoint = "MultiEndpoint"; public const string SingleSourceDestination = "SingleSourceDestination"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorWorkspaceSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorWorkspaceSettings.cs index 460f4e67b284..cdd4260a782d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorWorkspaceSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionMonitorWorkspaceSettings.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the settings for producing output into a log analytics - /// workspace. + /// Describes the settings for producing output into a log analytics workspace. /// public partial class ConnectionMonitorWorkspaceSettings { /// - /// Initializes a new instance of the - /// ConnectionMonitorWorkspaceSettings class. + /// Initializes a new instance of the ConnectionMonitorWorkspaceSettings class. /// public ConnectionMonitorWorkspaceSettings() { @@ -29,14 +21,15 @@ public ConnectionMonitorWorkspaceSettings() } /// - /// Initializes a new instance of the - /// ConnectionMonitorWorkspaceSettings class. + /// Initializes a new instance of the ConnectionMonitorWorkspaceSettings class. /// - /// Log analytics workspace resource - /// ID. + + /// Log analytics workspace resource ID. + /// public ConnectionMonitorWorkspaceSettings(string workspaceResourceId = default(string)) + { - WorkspaceResourceId = workspaceResourceId; + this.WorkspaceResourceId = workspaceResourceId; CustomInit(); } @@ -45,11 +38,11 @@ public ConnectionMonitorWorkspaceSettings() /// partial void CustomInit(); + /// /// Gets or sets log analytics workspace resource ID. /// - [JsonProperty(PropertyName = "workspaceResourceId")] - public string WorkspaceResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceResourceId")] + public string WorkspaceResourceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionResetSharedKey.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionResetSharedKey.cs index 57fe35f7f3a2..ecfd695b1874 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionResetSharedKey.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionResetSharedKey.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,11 +23,14 @@ public ConnectionResetSharedKey() /// /// Initializes a new instance of the ConnectionResetSharedKey class. /// - /// The virtual network connection reset shared - /// key length, should between 1 and 128. + + /// The virtual network connection reset shared key length, should between 1 + /// and 128. + /// public ConnectionResetSharedKey(int keyLength) + { - KeyLength = keyLength; + this.KeyLength = keyLength; CustomInit(); } @@ -43,29 +39,29 @@ public ConnectionResetSharedKey(int keyLength) /// partial void CustomInit(); + /// - /// Gets or sets the virtual network connection reset shared key - /// length, should between 1 and 128. + /// Gets or sets the virtual network connection reset shared key length, should + /// between 1 and 128. /// - [JsonProperty(PropertyName = "keyLength")] - public int KeyLength { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyLength")] + public int KeyLength {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (KeyLength > 128) + if (this.KeyLength > 128) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "KeyLength", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "KeyLength", 128); } - if (KeyLength < 1) + if (this.KeyLength < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "KeyLength", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "KeyLength", 1); } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionSharedKey.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionSharedKey.cs index 2be709df35e7..c405a3c3bc69 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionSharedKey.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionSharedKey.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,13 +23,17 @@ public ConnectionSharedKey() /// /// Initializes a new instance of the ConnectionSharedKey class. /// - /// The virtual network connection shared key - /// value. - /// Resource ID. + + /// Resource ID. + /// + + /// The virtual network connection shared key value. + /// public ConnectionSharedKey(string value, string id = default(string)) - : base(id) + + : base(id) { - Value = value; + this.Value = value; CustomInit(); } @@ -45,24 +42,25 @@ public ConnectionSharedKey() /// partial void CustomInit(); + /// /// Gets or sets the virtual network connection shared key value. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Value == null) + if (this.Value == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionState.cs index e59066cdcaae..9e03104fa89e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionState. /// + + public static class ConnectionState { public const string Reachable = "Reachable"; public const string Unreachable = "Unreachable"; public const string Unknown = "Unknown"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStateSnapshot.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStateSnapshot.cs index fb8bdc77ff24..8945a68c57cf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStateSnapshot.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStateSnapshot.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,34 +23,49 @@ public ConnectionStateSnapshot() /// /// Initializes a new instance of the ConnectionStateSnapshot class. /// - /// The connection state. Possible values - /// include: 'Reachable', 'Unreachable', 'Unknown' - /// The start time of the connection - /// snapshot. - /// The end time of the connection - /// snapshot. - /// Connectivity analysis evaluation - /// state. Possible values include: 'NotStarted', 'InProgress', - /// 'Completed' - /// Average latency in ms. - /// Minimum latency in ms. - /// Maximum latency in ms. - /// The number of sent probes. - /// The number of failed probes. - /// List of hops between the source and the - /// destination. - public ConnectionStateSnapshot(string connectionState = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string evaluationState = default(string), long? avgLatencyInMs = default(long?), long? minLatencyInMs = default(long?), long? maxLatencyInMs = default(long?), long? probesSent = default(long?), long? probesFailed = default(long?), IList hops = default(IList)) + + /// The connection state. + /// Possible values include: 'Reachable', 'Unreachable', 'Unknown' + + /// The start time of the connection snapshot. + /// + + /// The end time of the connection snapshot. + /// + + /// Connectivity analysis evaluation state. + /// Possible values include: 'NotStarted', 'InProgress', 'Completed' + + /// Average latency in ms. + /// + + /// Minimum latency in ms. + /// + + /// Maximum latency in ms. + /// + + /// The number of sent probes. + /// + + /// The number of failed probes. + /// + + /// List of hops between the source and the destination. + /// + public ConnectionStateSnapshot(string connectionState = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string evaluationState = default(string), long? avgLatencyInMS = default(long?), long? minLatencyInMS = default(long?), long? maxLatencyInMS = default(long?), long? probesSent = default(long?), long? probesFailed = default(long?), System.Collections.Generic.IList hops = default(System.Collections.Generic.IList)) + { - ConnectionState = connectionState; - StartTime = startTime; - EndTime = endTime; - EvaluationState = evaluationState; - AvgLatencyInMs = avgLatencyInMs; - MinLatencyInMs = minLatencyInMs; - MaxLatencyInMs = maxLatencyInMs; - ProbesSent = probesSent; - ProbesFailed = probesFailed; - Hops = hops; + this.ConnectionState = connectionState; + this.StartTime = startTime; + this.EndTime = endTime; + this.EvaluationState = evaluationState; + this.AvgLatencyInMS = avgLatencyInMS; + this.MinLatencyInMS = minLatencyInMS; + this.MaxLatencyInMS = maxLatencyInMS; + this.ProbesSent = probesSent; + this.ProbesFailed = probesFailed; + this.Hops = hops; CustomInit(); } @@ -68,131 +74,132 @@ public ConnectionStateSnapshot() /// partial void CustomInit(); + /// - /// Gets or sets the connection state. Possible values include: - /// 'Reachable', 'Unreachable', 'Unknown' + /// Gets or sets the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown' /// - [JsonProperty(PropertyName = "connectionState")] - public string ConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionState")] + public string ConnectionState {get; set; } /// /// Gets or sets the start time of the connection snapshot. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; set; } /// /// Gets or sets the end time of the connection snapshot. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime {get; set; } /// - /// Gets or sets connectivity analysis evaluation state. Possible - /// values include: 'NotStarted', 'InProgress', 'Completed' + /// Gets or sets connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed' /// - [JsonProperty(PropertyName = "evaluationState")] - public string EvaluationState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "evaluationState")] + public string EvaluationState {get; set; } /// /// Gets or sets average latency in ms. /// - [JsonProperty(PropertyName = "avgLatencyInMs")] - public long? AvgLatencyInMs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "avgLatencyInMs")] + public long? AvgLatencyInMS {get; set; } /// /// Gets or sets minimum latency in ms. /// - [JsonProperty(PropertyName = "minLatencyInMs")] - public long? MinLatencyInMs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minLatencyInMs")] + public long? MinLatencyInMS {get; set; } /// /// Gets or sets maximum latency in ms. /// - [JsonProperty(PropertyName = "maxLatencyInMs")] - public long? MaxLatencyInMs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxLatencyInMs")] + public long? MaxLatencyInMS {get; set; } /// /// Gets or sets the number of sent probes. /// - [JsonProperty(PropertyName = "probesSent")] - public long? ProbesSent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "probesSent")] + public long? ProbesSent {get; set; } /// /// Gets or sets the number of failed probes. /// - [JsonProperty(PropertyName = "probesFailed")] - public long? ProbesFailed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "probesFailed")] + public long? ProbesFailed {get; set; } /// /// Gets list of hops between the source and the destination. /// - [JsonProperty(PropertyName = "hops")] - public IList Hops { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hops")] + public System.Collections.Generic.IList Hops {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (AvgLatencyInMs != null) + + + if (this.AvgLatencyInMS != null) { - if (AvgLatencyInMs > 4294967295) + if (this.AvgLatencyInMS > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "AvgLatencyInMs", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "AvgLatencyInMS", 4294967295); } - if (AvgLatencyInMs < 0) + if (this.AvgLatencyInMS < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "AvgLatencyInMs", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "AvgLatencyInMS", 0); } } - if (MinLatencyInMs != null) + if (this.MinLatencyInMS != null) { - if (MinLatencyInMs > 4294967295) + if (this.MinLatencyInMS > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MinLatencyInMs", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MinLatencyInMS", 4294967295); } - if (MinLatencyInMs < 0) + if (this.MinLatencyInMS < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MinLatencyInMs", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MinLatencyInMS", 0); } } - if (MaxLatencyInMs != null) + if (this.MaxLatencyInMS != null) { - if (MaxLatencyInMs > 4294967295) + if (this.MaxLatencyInMS > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxLatencyInMs", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MaxLatencyInMS", 4294967295); } - if (MaxLatencyInMs < 0) + if (this.MaxLatencyInMS < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxLatencyInMs", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxLatencyInMS", 0); } } - if (ProbesSent != null) + if (this.ProbesSent != null) { - if (ProbesSent > 4294967295) + if (this.ProbesSent > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ProbesSent", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "ProbesSent", 4294967295); } - if (ProbesSent < 0) + if (this.ProbesSent < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ProbesSent", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ProbesSent", 0); } } - if (ProbesFailed != null) + if (this.ProbesFailed != null) { - if (ProbesFailed > 4294967295) + if (this.ProbesFailed > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ProbesFailed", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "ProbesFailed", 4294967295); } - if (ProbesFailed < 0) + if (this.ProbesFailed < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ProbesFailed", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ProbesFailed", 0); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStatus.cs index 3eb77c814f3c..7531fbb55c58 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectionStatus. /// + + public static class ConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class ConnectionStatus public const string Disconnected = "Disconnected"; public const string Degraded = "Degraded"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfiguration.cs index f9b945c5a296..3a0e5121ef4a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfiguration.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The network manager connectivity configuration resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ConnectivityConfiguration : ChildResource { /// @@ -34,40 +24,58 @@ public ConnectivityConfiguration() /// /// Initializes a new instance of the ConnectivityConfiguration class. /// + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + /// Connectivity topology type. - /// Possible values include: 'HubAndSpoke', 'Mesh' - /// Groups for configuration - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A description of the connectivity - /// configuration. - /// List of hubItems - /// Flag if global mesh is supported. Possible - /// values include: 'False', 'True' - /// The provisioning state of the - /// connectivity configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Flag if need to remove current - /// existing peerings. Possible values include: 'False', 'True' - /// Unique identifier for this - /// resource. - /// The system metadata related to this - /// resource. - public ConnectivityConfiguration(string connectivityTopology, IList appliesToGroups, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), string resourceGuid = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + /// Possible values include: 'HubAndSpoke', 'Mesh' + + /// Flag if global mesh is supported. + /// Possible values include: 'False', 'True' + + /// The provisioning state of the connectivity configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the connectivity configuration. + /// + + /// List of hubItems + /// + + /// Groups for configuration + /// + + /// Flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + + /// Unique identifier for this resource. + /// + public ConnectivityConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string connectivityTopology = default(string), string isGlobal = default(string), string provisioningState = default(string), string description = default(string), System.Collections.Generic.IList hubs = default(System.Collections.Generic.IList), System.Collections.Generic.IList appliesToGroups = default(System.Collections.Generic.IList), string deleteExistingPeering = default(string), string resourceGuid = default(string)) + + : base(id, name, type, etag) { - Description = description; - ConnectivityTopology = connectivityTopology; - Hubs = hubs; - IsGlobal = isGlobal; - AppliesToGroups = appliesToGroups; - ProvisioningState = provisioningState; - DeleteExistingPeering = deleteExistingPeering; - ResourceGuid = resourceGuid; - SystemData = systemData; + this.SystemData = systemData; + this.ConnectivityTopology = connectivityTopology; + this.IsGlobal = isGlobal; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Hubs = hubs; + this.AppliesToGroups = appliesToGroups; + this.DeleteExistingPeering = deleteExistingPeering; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -76,91 +84,59 @@ public ConnectivityConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets a description of the connectivity configuration. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } /// - /// Gets or sets connectivity topology type. Possible values include: - /// 'HubAndSpoke', 'Mesh' + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.connectivityTopology")] - public string ConnectivityTopology { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets or sets list of hubItems + /// Gets or sets connectivity topology type. Possible values include: 'HubAndSpoke', 'Mesh' /// - [JsonProperty(PropertyName = "properties.hubs")] - public IList Hubs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectivityTopology")] + public string ConnectivityTopology {get; set; } /// - /// Gets or sets flag if global mesh is supported. Possible values - /// include: 'False', 'True' + /// Gets or sets flag if global mesh is supported. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "properties.isGlobal")] - public string IsGlobal { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isGlobal")] + public string IsGlobal {get; set; } /// - /// Gets or sets groups for configuration + /// Gets the provisioning state of the connectivity configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.appliesToGroups")] - public IList AppliesToGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the connectivity configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets a description of the connectivity configuration. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets flag if need to remove current existing peerings. - /// Possible values include: 'False', 'True' + /// Gets or sets list of hubItems /// - [JsonProperty(PropertyName = "properties.deleteExistingPeering")] - public string DeleteExistingPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hubs")] + public System.Collections.Generic.IList Hubs {get; set; } /// - /// Gets unique identifier for this resource. + /// Gets or sets groups for configuration /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.appliesToGroups")] + public System.Collections.Generic.IList AppliesToGroups {get; set; } /// - /// Gets the system metadata related to this resource. + /// Gets or sets flag if need to remove current existing peerings. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteExistingPeering")] + public string DeleteExistingPeering {get; set; } /// - /// Validate the object. + /// Gets unique identifier for this resource. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectivityTopology == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); - } - if (AppliesToGroups == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppliesToGroups"); - } - if (AppliesToGroups != null) - { - foreach (var element in AppliesToGroups) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationProperties.cs new file mode 100644 index 000000000000..e1303d44191f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationProperties.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of network manager connectivity configuration + /// + public partial class ConnectivityConfigurationProperties + { + /// + /// Initializes a new instance of the ConnectivityConfigurationProperties class. + /// + public ConnectivityConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectivityConfigurationProperties class. + /// + + /// A description of the connectivity configuration. + /// + + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + + /// List of hubItems + /// + + /// Flag if global mesh is supported. + /// Possible values include: 'False', 'True' + + /// Groups for configuration + /// + + /// The provisioning state of the connectivity configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + + /// Unique identifier for this resource. + /// + public ConnectivityConfigurationProperties(string connectivityTopology, System.Collections.Generic.IList appliesToGroups, string description = default(string), System.Collections.Generic.IList hubs = default(System.Collections.Generic.IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.ConnectivityTopology = connectivityTopology; + this.Hubs = hubs; + this.IsGlobal = isGlobal; + this.AppliesToGroups = appliesToGroups; + this.ProvisioningState = provisioningState; + this.DeleteExistingPeering = deleteExistingPeering; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description of the connectivity configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets connectivity topology type. Possible values include: 'HubAndSpoke', 'Mesh' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectivityTopology")] + public string ConnectivityTopology {get; set; } + + /// + /// Gets or sets list of hubItems + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hubs")] + public System.Collections.Generic.IList Hubs {get; set; } + + /// + /// Gets or sets flag if global mesh is supported. Possible values include: 'False', 'True' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isGlobal")] + public string IsGlobal {get; set; } + + /// + /// Gets or sets groups for configuration + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "appliesToGroups")] + public System.Collections.Generic.IList AppliesToGroups {get; set; } + + /// + /// Gets the provisioning state of the connectivity configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets flag if need to remove current existing peerings. Possible values include: 'False', 'True' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteExistingPeering")] + public string DeleteExistingPeering {get; set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ConnectivityTopology == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectivityTopology"); + } + if (this.AppliesToGroups == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AppliesToGroups"); + } + + + + + if (this.AppliesToGroups != null) + { + foreach (var element in this.AppliesToGroups) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationsDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationsDeleteHeaders.cs index 707fdcd4dc48..cb0ef0febe76 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationsDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityConfigurationsDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class ConnectivityConfigurationsDeleteHeaders { /// - /// Initializes a new instance of the - /// ConnectivityConfigurationsDeleteHeaders class. + /// Initializes a new instance of the ConnectivityConfigurationsDeleteHeaders class. /// public ConnectivityConfigurationsDeleteHeaders() { @@ -28,14 +18,15 @@ public ConnectivityConfigurationsDeleteHeaders() } /// - /// Initializes a new instance of the - /// ConnectivityConfigurationsDeleteHeaders class. + /// Initializes a new instance of the ConnectivityConfigurationsDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public ConnectivityConfigurationsDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public ConnectivityConfigurationsDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityDestination.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityDestination.cs index f6f519013db7..cd587f5477d0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityDestination.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityDestination.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,17 +23,22 @@ public ConnectivityDestination() /// /// Initializes a new instance of the ConnectivityDestination class. /// - /// The ID of the resource to which a - /// connection attempt will be made. - /// The IP address or URI the resource to which a - /// connection attempt will be made. - /// Port on which check connectivity will be - /// performed. + + /// The ID of the resource to which a connection attempt will be made. + /// + + /// The IP address or URI the resource to which a connection attempt will be + /// made. + /// + + /// Port on which check connectivity will be performed. + /// public ConnectivityDestination(string resourceId = default(string), string address = default(string), int? port = default(int?)) + { - ResourceId = resourceId; - Address = address; - Port = port; + this.ResourceId = resourceId; + this.Address = address; + this.Port = port; CustomInit(); } @@ -49,45 +47,47 @@ public ConnectivityDestination() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the resource to which a connection attempt - /// will be made. + /// Gets or sets the ID of the resource to which a connection attempt will be + /// made. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets the IP address or URI the resource to which a - /// connection attempt will be made. + /// Gets or sets the IP address or URI the resource to which a connection + /// attempt will be made. /// - [JsonProperty(PropertyName = "address")] - public string Address { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; set; } /// /// Gets or sets port on which check connectivity will be performed. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + + + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityGroupItem.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityGroupItem.cs index 251ab6927ad4..12d1a8a122f2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityGroupItem.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityGroupItem.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,19 +23,25 @@ public ConnectivityGroupItem() /// /// Initializes a new instance of the ConnectivityGroupItem class. /// - /// Network group Id. - /// Group connectivity type. Possible - /// values include: 'None', 'DirectlyConnected' + + /// Network group Id. + /// + /// Flag if need to use hub gateway. - /// Possible values include: 'False', 'True' - /// Flag if global is supported. Possible values - /// include: 'False', 'True' + /// Possible values include: 'False', 'True' + + /// Flag if global is supported. + /// Possible values include: 'False', 'True' + + /// Group connectivity type. + /// Possible values include: 'None', 'DirectlyConnected' public ConnectivityGroupItem(string networkGroupId, string groupConnectivity, string useHubGateway = default(string), string isGlobal = default(string)) + { - NetworkGroupId = networkGroupId; - UseHubGateway = useHubGateway; - IsGlobal = isGlobal; - GroupConnectivity = groupConnectivity; + this.NetworkGroupId = networkGroupId; + this.UseHubGateway = useHubGateway; + this.IsGlobal = isGlobal; + this.GroupConnectivity = groupConnectivity; CustomInit(); } @@ -51,49 +50,50 @@ public ConnectivityGroupItem() /// partial void CustomInit(); + /// /// Gets or sets network group Id. /// - [JsonProperty(PropertyName = "networkGroupId")] - public string NetworkGroupId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkGroupId")] + public string NetworkGroupId {get; set; } /// - /// Gets or sets flag if need to use hub gateway. Possible values - /// include: 'False', 'True' + /// Gets or sets flag if need to use hub gateway. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "useHubGateway")] - public string UseHubGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "useHubGateway")] + public string UseHubGateway {get; set; } /// - /// Gets or sets flag if global is supported. Possible values include: - /// 'False', 'True' + /// Gets or sets flag if global is supported. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "isGlobal")] - public string IsGlobal { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isGlobal")] + public string IsGlobal {get; set; } /// - /// Gets or sets group connectivity type. Possible values include: - /// 'None', 'DirectlyConnected' + /// Gets or sets group connectivity type. Possible values include: 'None', 'DirectlyConnected' /// - [JsonProperty(PropertyName = "groupConnectivity")] - public string GroupConnectivity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "groupConnectivity")] + public string GroupConnectivity {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (NetworkGroupId == null) + if (this.NetworkGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NetworkGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NetworkGroupId"); } - if (GroupConnectivity == null) + if (this.GroupConnectivity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "GroupConnectivity"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "GroupConnectivity"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityHop.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityHop.cs index 1538a4bd59f2..f56eef09f2c3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityHop.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityHop.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,28 +23,45 @@ public ConnectivityHop() /// /// Initializes a new instance of the ConnectivityHop class. /// - /// The type of the hop. - /// The ID of the hop. - /// The IP address of the hop. - /// The ID of the resource corresponding to - /// this hop. - /// List of next hop identifiers. - /// List of previous hop - /// identifiers. - /// List of hop links. - /// List of previous hop links. - /// List of issues. - public ConnectivityHop(string type = default(string), string id = default(string), string address = default(string), string resourceId = default(string), IList nextHopIds = default(IList), IList previousHopIds = default(IList), IList links = default(IList), IList previousLinks = default(IList), IList issues = default(IList)) + + /// The type of the hop. + /// + + /// The ID of the hop. + /// + + /// The IP address of the hop. + /// + + /// The ID of the resource corresponding to this hop. + /// + + /// List of next hop identifiers. + /// + + /// List of previous hop identifiers. + /// + + /// List of hop links. + /// + + /// List of previous hop links. + /// + + /// List of issues. + /// + public ConnectivityHop(string type = default(string), string id = default(string), string address = default(string), string resourceId = default(string), System.Collections.Generic.IList nextHopIds = default(System.Collections.Generic.IList), System.Collections.Generic.IList previousHopIds = default(System.Collections.Generic.IList), System.Collections.Generic.IList links = default(System.Collections.Generic.IList), System.Collections.Generic.IList previousLinks = default(System.Collections.Generic.IList), System.Collections.Generic.IList issues = default(System.Collections.Generic.IList)) + { - Type = type; - Id = id; - Address = address; - ResourceId = resourceId; - NextHopIds = nextHopIds; - PreviousHopIds = previousHopIds; - Links = links; - PreviousLinks = previousLinks; - Issues = issues; + this.Type = type; + this.Id = id; + this.Address = address; + this.ResourceId = resourceId; + this.NextHopIds = nextHopIds; + this.PreviousHopIds = previousHopIds; + this.Links = links; + this.PreviousLinks = previousLinks; + this.Issues = issues; CustomInit(); } @@ -61,59 +70,59 @@ public ConnectivityHop() /// partial void CustomInit(); + /// /// Gets the type of the hop. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the ID of the hop. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the IP address of the hop. /// - [JsonProperty(PropertyName = "address")] - public string Address { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; private set; } /// /// Gets the ID of the resource corresponding to this hop. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; private set; } /// /// Gets list of next hop identifiers. /// - [JsonProperty(PropertyName = "nextHopIds")] - public IList NextHopIds { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIds")] + public System.Collections.Generic.IList NextHopIds {get; private set; } /// /// Gets list of previous hop identifiers. /// - [JsonProperty(PropertyName = "previousHopIds")] - public IList PreviousHopIds { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "previousHopIds")] + public System.Collections.Generic.IList PreviousHopIds {get; private set; } /// /// Gets list of hop links. /// - [JsonProperty(PropertyName = "links")] - public IList Links { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "links")] + public System.Collections.Generic.IList Links {get; private set; } /// /// Gets list of previous hop links. /// - [JsonProperty(PropertyName = "previousLinks")] - public IList PreviousLinks { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "previousLinks")] + public System.Collections.Generic.IList PreviousLinks {get; private set; } /// /// Gets list of issues. /// - [JsonProperty(PropertyName = "issues")] - public IList Issues { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "issues")] + public System.Collections.Generic.IList Issues {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityInformation.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityInformation.cs index ea7a6bec6b96..cefd556b8140 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityInformation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityInformation.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,28 +23,37 @@ public ConnectivityInformation() /// /// Initializes a new instance of the ConnectivityInformation class. /// - /// List of hops between the source and the - /// destination. - /// The connection status. Possible - /// values include: 'Unknown', 'Connected', 'Disconnected', - /// 'Degraded' - /// Average latency in - /// milliseconds. - /// Minimum latency in - /// milliseconds. - /// Maximum latency in - /// milliseconds. - /// Total number of probes sent. - /// Number of failed probes. - public ConnectivityInformation(IList hops = default(IList), string connectionStatus = default(string), int? avgLatencyInMs = default(int?), int? minLatencyInMs = default(int?), int? maxLatencyInMs = default(int?), int? probesSent = default(int?), int? probesFailed = default(int?)) + + /// List of hops between the source and the destination. + /// + + /// The connection status. + /// Possible values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded' + + /// Average latency in milliseconds. + /// + + /// Minimum latency in milliseconds. + /// + + /// Maximum latency in milliseconds. + /// + + /// Total number of probes sent. + /// + + /// Number of failed probes. + /// + public ConnectivityInformation(System.Collections.Generic.IList hops = default(System.Collections.Generic.IList), string connectionStatus = default(string), int? avgLatencyInMS = default(int?), int? minLatencyInMS = default(int?), int? maxLatencyInMS = default(int?), int? probesSent = default(int?), int? probesFailed = default(int?)) + { - Hops = hops; - ConnectionStatus = connectionStatus; - AvgLatencyInMs = avgLatencyInMs; - MinLatencyInMs = minLatencyInMs; - MaxLatencyInMs = maxLatencyInMs; - ProbesSent = probesSent; - ProbesFailed = probesFailed; + this.Hops = hops; + this.ConnectionStatus = connectionStatus; + this.AvgLatencyInMS = avgLatencyInMS; + this.MinLatencyInMS = minLatencyInMS; + this.MaxLatencyInMS = maxLatencyInMS; + this.ProbesSent = probesSent; + this.ProbesFailed = probesFailed; CustomInit(); } @@ -61,48 +62,47 @@ public ConnectivityInformation() /// partial void CustomInit(); + /// /// Gets list of hops between the source and the destination. /// - [JsonProperty(PropertyName = "hops")] - public IList Hops { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hops")] + public System.Collections.Generic.IList Hops {get; private set; } /// - /// Gets the connection status. Possible values include: 'Unknown', - /// 'Connected', 'Disconnected', 'Degraded' + /// Gets the connection status. Possible values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded' /// - [JsonProperty(PropertyName = "connectionStatus")] - public string ConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } /// /// Gets average latency in milliseconds. /// - [JsonProperty(PropertyName = "avgLatencyInMs")] - public int? AvgLatencyInMs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "avgLatencyInMs")] + public int? AvgLatencyInMS {get; private set; } /// /// Gets minimum latency in milliseconds. /// - [JsonProperty(PropertyName = "minLatencyInMs")] - public int? MinLatencyInMs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minLatencyInMs")] + public int? MinLatencyInMS {get; private set; } /// /// Gets maximum latency in milliseconds. /// - [JsonProperty(PropertyName = "maxLatencyInMs")] - public int? MaxLatencyInMs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxLatencyInMs")] + public int? MaxLatencyInMS {get; private set; } /// /// Gets total number of probes sent. /// - [JsonProperty(PropertyName = "probesSent")] - public int? ProbesSent { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "probesSent")] + public int? ProbesSent {get; private set; } /// /// Gets number of failed probes. /// - [JsonProperty(PropertyName = "probesFailed")] - public int? ProbesFailed { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "probesFailed")] + public int? ProbesFailed {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityIssue.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityIssue.cs index 2c649d783074..84fc37201fa6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityIssue.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityIssue.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,22 +24,27 @@ public ConnectivityIssue() /// /// Initializes a new instance of the ConnectivityIssue class. /// - /// The origin of the issue. Possible values - /// include: 'Local', 'Inbound', 'Outbound' - /// The severity of the issue. Possible values - /// include: 'Error', 'Warning' - /// The type of issue. Possible values include: - /// 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', - /// 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', - /// 'PortThrottled', 'Platform' - /// Provides additional context on the - /// issue. - public ConnectivityIssue(string origin = default(string), string severity = default(string), string type = default(string), IList> context = default(IList>)) + + /// The origin of the issue. + /// Possible values include: 'Local', 'Inbound', 'Outbound' + + /// The severity of the issue. + /// Possible values include: 'Error', 'Warning' + + /// The type of issue. + /// Possible values include: 'Unknown', 'AgentStopped', 'GuestFirewall', + /// 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', + /// 'PortThrottled', 'Platform' + + /// Provides additional context on the issue. + /// + public ConnectivityIssue(string origin = default(string), string severity = default(string), string type = default(string), System.Collections.Generic.IList> context = default(System.Collections.Generic.IList>)) + { - Origin = origin; - Severity = severity; - Type = type; - Context = context; + this.Origin = origin; + this.Severity = severity; + this.Type = type; + this.Context = context; CustomInit(); } @@ -56,34 +53,29 @@ public ConnectivityIssue() /// partial void CustomInit(); + /// - /// Gets the origin of the issue. Possible values include: 'Local', - /// 'Inbound', 'Outbound' + /// Gets the origin of the issue. Possible values include: 'Local', 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; private set; } /// - /// Gets the severity of the issue. Possible values include: 'Error', - /// 'Warning' + /// Gets the severity of the issue. Possible values include: 'Error', 'Warning' /// - [JsonProperty(PropertyName = "severity")] - public string Severity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "severity")] + public string Severity {get; private set; } /// - /// Gets the type of issue. Possible values include: 'Unknown', - /// 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', - /// 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', - /// 'Platform' + /// Gets the type of issue. Possible values include: 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets provides additional context on the issue. /// - [JsonProperty(PropertyName = "context")] - public IList> Context { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "context")] + public System.Collections.Generic.IList> Context {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityParameters.cs index 0c8e2d55c9bd..97f77beb6c43 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,21 +23,29 @@ public ConnectivityParameters() /// /// Initializes a new instance of the ConnectivityParameters class. /// - /// The source of the connection. - /// The destination of connection. - /// Network protocol. Possible values include: - /// 'Tcp', 'Http', 'Https', 'Icmp' - /// Configuration of the - /// protocol. - /// Preferred IP version of the - /// connection. Possible values include: 'IPv4', 'IPv6' + + /// The source of the connection. + /// + + /// The destination of connection. + /// + + /// Network protocol. + /// Possible values include: 'Tcp', 'Http', 'Https', 'Icmp' + + /// Configuration of the protocol. + /// + + /// Preferred IP version of the connection. + /// Possible values include: 'IPv4', 'IPv6' public ConnectivityParameters(ConnectivitySource source, ConnectivityDestination destination, string protocol = default(string), ProtocolConfiguration protocolConfiguration = default(ProtocolConfiguration), string preferredIPVersion = default(string)) + { - Source = source; - Destination = destination; - Protocol = protocol; - ProtocolConfiguration = protocolConfiguration; - PreferredIPVersion = preferredIPVersion; + this.Source = source; + this.Destination = destination; + this.Protocol = protocol; + this.ProtocolConfiguration = protocolConfiguration; + this.PreferredIPVersion = preferredIPVersion; CustomInit(); } @@ -53,62 +54,63 @@ public ConnectivityParameters() /// partial void CustomInit(); + /// /// Gets or sets the source of the connection. /// - [JsonProperty(PropertyName = "source")] - public ConnectivitySource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public ConnectivitySource Source {get; set; } /// /// Gets or sets the destination of connection. /// - [JsonProperty(PropertyName = "destination")] - public ConnectivityDestination Destination { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destination")] + public ConnectivityDestination Destination {get; set; } /// - /// Gets or sets network protocol. Possible values include: 'Tcp', - /// 'Http', 'Https', 'Icmp' + /// Gets or sets network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// /// Gets or sets configuration of the protocol. /// - [JsonProperty(PropertyName = "protocolConfiguration")] - public ProtocolConfiguration ProtocolConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocolConfiguration")] + public ProtocolConfiguration ProtocolConfiguration {get; set; } /// - /// Gets or sets preferred IP version of the connection. Possible - /// values include: 'IPv4', 'IPv6' + /// Gets or sets preferred IP version of the connection. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "preferredIPVersion")] - public string PreferredIPVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "preferredIPVersion")] + public string PreferredIPVersion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Source == null) + if (this.Source == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Source"); } - if (Destination == null) + if (this.Destination == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Destination"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Destination"); } - if (Source != null) + if (this.Source != null) { - Source.Validate(); + this.Source.Validate(); } - if (Destination != null) + if (this.Destination != null) { - Destination.Validate(); + this.Destination.Validate(); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivitySource.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivitySource.cs index 9115d726b250..496875bac807 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivitySource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivitySource.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,17 @@ public ConnectivitySource() /// /// Initializes a new instance of the ConnectivitySource class. /// - /// The ID of the resource from which a - /// connectivity check will be initiated. - /// The source port from which a connectivity check - /// will be performed. + + /// The ID of the resource from which a connectivity check will be initiated. + /// + + /// The source port from which a connectivity check will be performed. + /// public ConnectivitySource(string resourceId, int? port = default(int?)) + { - ResourceId = resourceId; - Port = port; + this.ResourceId = resourceId; + this.Port = port; CustomInit(); } @@ -46,43 +42,44 @@ public ConnectivitySource() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the resource from which a connectivity check - /// will be initiated. + /// Gets or sets the ID of the resource from which a connectivity check will be + /// initiated. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets the source port from which a connectivity check will - /// be performed. + /// Gets or sets the source port from which a connectivity check will be + /// performed. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ResourceId == null) + if (this.ResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceId"); } - if (Port != null) + + if (this.Port != null) { - if (Port > 65535) + if (this.Port > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 65535); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityTopology.cs b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityTopology.cs index bc7499e64980..0290a1f3d5a6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityTopology.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ConnectivityTopology.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ConnectivityTopology. /// + + public static class ConnectivityTopology { public const string HubAndSpoke = "HubAndSpoke"; public const string Mesh = "Mesh"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Container.cs b/src/Network/Network.Management.Sdk/Generated/Models/Container.cs index ac61dd188196..de6bfb7c4dec 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Container.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Container.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -28,9 +23,12 @@ public Container() /// /// Initializes a new instance of the Container class. /// - /// Resource ID. + + /// Resource ID. + /// public Container(string id = default(string)) - : base(id) + + : base(id) { CustomInit(); } @@ -41,4 +39,4 @@ public Container() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterface.cs b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterface.cs index 17e5f180ca65..f90eb078cb56 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterface.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterface.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Container network interface child resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ContainerNetworkInterface : SubResource { /// @@ -34,32 +24,43 @@ public ContainerNetworkInterface() /// /// Initializes a new instance of the ContainerNetworkInterface class. /// - /// Resource ID. - /// Container - /// network interface configuration from which this container network - /// interface is created. - /// Reference to the container to which this - /// container network interface is attached. - /// Reference to the ip configuration on - /// this container nic. - /// The provisioning state of the - /// container network interface resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource. This name can be used - /// to access the resource. - /// Sub Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ContainerNetworkInterface(string id = default(string), ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration = default(ContainerNetworkInterfaceConfiguration), Container container = default(Container), IList ipConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource. This name can be used to access the resource. + /// + + /// Sub Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Reference to the container to which this container network interface is + /// attached. + /// + + /// The provisioning state of the container network interface resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Container network interface configuration from which this container network + /// interface is created. + /// + + /// Reference to the ip configuration on this container nic. + /// + public ContainerNetworkInterface(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), Container container = default(Container), string provisioningState = default(string), ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration = default(ContainerNetworkInterfaceConfiguration), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList)) + + : base(id) { - ContainerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration; - Container = container; - IpConfigurations = ipConfigurations; - ProvisioningState = provisioningState; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.Container = container; + this.ProvisioningState = provisioningState; + this.ContainerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration; + this.IPConfigurations = ipConfigurations; CustomInit(); } @@ -68,53 +69,51 @@ public ContainerNetworkInterface() /// partial void CustomInit(); + /// - /// Gets container network interface configuration from which this - /// container network interface is created. + /// Gets or sets the name of the resource. This name can be used to access the + /// resource. /// - [JsonProperty(PropertyName = "properties.containerNetworkInterfaceConfiguration")] - public ContainerNetworkInterfaceConfiguration ContainerNetworkInterfaceConfiguration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets reference to the container to which this container - /// network interface is attached. + /// Gets sub Resource type. /// - [JsonProperty(PropertyName = "properties.container")] - public Container Container { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets reference to the ip configuration on this container nic. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the container network interface - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets reference to the container to which this container network + /// interface is attached. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.container")] + public Container Container {get; set; } /// - /// Gets or sets the name of the resource. This name can be used to - /// access the resource. + /// Gets the provisioning state of the container network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets sub Resource type. + /// Gets container network interface configuration from which this container + /// network interface is created. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containerNetworkInterfaceConfiguration")] + public ContainerNetworkInterfaceConfiguration ContainerNetworkInterfaceConfiguration {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets reference to the ip configuration on this container nic. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfiguration.cs index fc0c80c88a4c..ed7ba0cb0d61 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Container network interface configuration child resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ContainerNetworkInterfaceConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ContainerNetworkInterfaceConfiguration class. + /// Initializes a new instance of the ContainerNetworkInterfaceConfiguration class. /// public ContainerNetworkInterfaceConfiguration() { @@ -33,32 +22,42 @@ public ContainerNetworkInterfaceConfiguration() } /// - /// Initializes a new instance of the - /// ContainerNetworkInterfaceConfiguration class. + /// Initializes a new instance of the ContainerNetworkInterfaceConfiguration class. /// - /// Resource ID. - /// A list of ip configurations of the - /// container network interface configuration. - /// A list of container - /// network interfaces created from this container network interface - /// configuration. - /// The provisioning state of the - /// container network interface configuration resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource. This name can be used - /// to access the resource. - /// Sub Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ContainerNetworkInterfaceConfiguration(string id = default(string), IList ipConfigurations = default(IList), IList containerNetworkInterfaces = default(IList), string provisioningState = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource. This name can be used to access the resource. + /// + + /// Sub Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the container network interface configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A list of ip configurations of the container network interface + /// configuration. + /// + + /// A list of container network interfaces created from this container network + /// interface configuration. + /// + public ContainerNetworkInterfaceConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList containerNetworkInterfaces = default(System.Collections.Generic.IList)) + + : base(id) { - IpConfigurations = ipConfigurations; - ContainerNetworkInterfaces = containerNetworkInterfaces; - ProvisioningState = provisioningState; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.IPConfigurations = ipConfigurations; + this.ContainerNetworkInterfaces = containerNetworkInterfaces; CustomInit(); } @@ -67,47 +66,46 @@ public ContainerNetworkInterfaceConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets a list of ip configurations of the container network - /// interface configuration. + /// Gets or sets the name of the resource. This name can be used to access the + /// resource. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets a list of container network interfaces created from - /// this container network interface configuration. + /// Gets sub Resource type. /// - [JsonProperty(PropertyName = "properties.containerNetworkInterfaces")] - public IList ContainerNetworkInterfaces { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the container network interface - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource. This name can be used to - /// access the resource. + /// Gets the provisioning state of the container network interface + /// configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets sub Resource type. + /// Gets or sets a list of ip configurations of the container network interface + /// configuration. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets a list of container network interfaces created from this + /// container network interface configuration. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containerNetworkInterfaces")] + public System.Collections.Generic.IList ContainerNetworkInterfaces {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..7e133638c5a8 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceConfigurationPropertiesFormat.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Container network interface configuration properties. + /// + public partial class ContainerNetworkInterfaceConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the ContainerNetworkInterfaceConfigurationPropertiesFormat class. + /// + public ContainerNetworkInterfaceConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerNetworkInterfaceConfigurationPropertiesFormat class. + /// + + /// A list of ip configurations of the container network interface + /// configuration. + /// + + /// A list of container network interfaces created from this container network + /// interface configuration. + /// + + /// The provisioning state of the container network interface configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ContainerNetworkInterfaceConfigurationPropertiesFormat(System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList containerNetworkInterfaces = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.IPConfigurations = ipConfigurations; + this.ContainerNetworkInterfaces = containerNetworkInterfaces; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a list of ip configurations of the container network interface + /// configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets or sets a list of container network interfaces created from this + /// container network interface configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerNetworkInterfaces")] + public System.Collections.Generic.IList ContainerNetworkInterfaces {get; set; } + + /// + /// Gets the provisioning state of the container network interface + /// configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs index 41984d7ecc0f..3ded5255e777 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The ip configuration for a container network interface. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ContainerNetworkInterfaceIpConfiguration { /// - /// Initializes a new instance of the - /// ContainerNetworkInterfaceIpConfiguration class. + /// Initializes a new instance of the ContainerNetworkInterfaceIpConfiguration class. /// public ContainerNetworkInterfaceIpConfiguration() { @@ -31,24 +22,28 @@ public ContainerNetworkInterfaceIpConfiguration() } /// - /// Initializes a new instance of the - /// ContainerNetworkInterfaceIpConfiguration class. + /// Initializes a new instance of the ContainerNetworkInterfaceIpConfiguration class. /// - /// The provisioning state of the - /// container network interface IP configuration resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// The name of the resource. This name can be used - /// to access the resource. - /// Sub Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ContainerNetworkInterfaceIpConfiguration(string provisioningState = default(string), string name = default(string), string type = default(string), string etag = default(string)) + + /// The name of the resource. This name can be used to access the resource. + /// + + /// Sub Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the container network interface IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ContainerNetworkInterfaceIpConfiguration(string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string)) + { - ProvisioningState = provisioningState; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -57,33 +52,32 @@ public ContainerNetworkInterfaceIpConfiguration() /// partial void CustomInit(); - /// - /// Gets the provisioning state of the container network interface IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } /// - /// Gets or sets the name of the resource. This name can be used to - /// access the resource. + /// Gets or sets the name of the resource. This name can be used to access the + /// resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets sub Resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + /// + /// Gets the provisioning state of the container network interface IP + /// configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..47c9ab8bd496 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the container network interface IP configuration. + /// + public partial class ContainerNetworkInterfaceIpConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the ContainerNetworkInterfaceIpConfigurationPropertiesFormat class. + /// + public ContainerNetworkInterfaceIpConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerNetworkInterfaceIpConfigurationPropertiesFormat class. + /// + + /// The provisioning state of the container network interface IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ContainerNetworkInterfaceIpConfigurationPropertiesFormat(string provisioningState = default(string)) + + { + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the container network interface IP + /// configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfacePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfacePropertiesFormat.cs new file mode 100644 index 000000000000..6abafb7e2cd7 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ContainerNetworkInterfacePropertiesFormat.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of container network interface. + /// + public partial class ContainerNetworkInterfacePropertiesFormat + { + /// + /// Initializes a new instance of the ContainerNetworkInterfacePropertiesFormat class. + /// + public ContainerNetworkInterfacePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerNetworkInterfacePropertiesFormat class. + /// + + /// Container network interface configuration from which this container network + /// interface is created. + /// + + /// Reference to the container to which this container network interface is + /// attached. + /// + + /// Reference to the ip configuration on this container nic. + /// + + /// The provisioning state of the container network interface resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ContainerNetworkInterfacePropertiesFormat(ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration = default(ContainerNetworkInterfaceConfiguration), Container container = default(Container), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.ContainerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration; + this.Container = container; + this.IPConfigurations = ipConfigurations; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets container network interface configuration from which this container + /// network interface is created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerNetworkInterfaceConfiguration")] + public ContainerNetworkInterfaceConfiguration ContainerNetworkInterfaceConfiguration {get; private set; } + + /// + /// Gets or sets reference to the container to which this container network + /// interface is attached. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "container")] + public Container Container {get; set; } + + /// + /// Gets reference to the ip configuration on this container nic. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } + + /// + /// Gets the provisioning state of the container network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CoverageLevel.cs b/src/Network/Network.Management.Sdk/Generated/Models/CoverageLevel.cs index 47aaf660d4ad..472686e679b3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CoverageLevel.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CoverageLevel.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for CoverageLevel. /// + + public static class CoverageLevel { public const string Default = "Default"; @@ -23,4 +20,4 @@ public static class CoverageLevel public const string AboveAverage = "AboveAverage"; public const string Full = "Full"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CreatedByType.cs b/src/Network/Network.Management.Sdk/Generated/Models/CreatedByType.cs index f360566a259f..f900e5e74341 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CreatedByType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CreatedByType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for CreatedByType. /// + + public static class CreatedByType { public const string User = "User"; @@ -21,4 +18,4 @@ public static class CreatedByType public const string ManagedIdentity = "ManagedIdentity"; public const string Key = "Key"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Criterion.cs b/src/Network/Network.Management.Sdk/Generated/Models/Criterion.cs index 0b9a0037d423..1948405b01da 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Criterion.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Criterion.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// A matching criteria which matches routes based on route prefix, - /// community, and AS path. + /// A matching criteria which matches routes based on route prefix, community, + /// and AS path. /// public partial class Criterion { @@ -32,21 +24,26 @@ public Criterion() /// /// Initializes a new instance of the Criterion class. /// - /// List of route prefixes which this - /// criteria matches. - /// List of BGP communities which this criteria - /// matches. - /// List of AS paths which this criteria - /// matches. - /// Match condition to apply RouteMap - /// rules. Possible values include: 'Unknown', 'Contains', 'Equals', - /// 'NotContains', 'NotEquals' - public Criterion(IList routePrefix = default(IList), IList community = default(IList), IList asPath = default(IList), string matchCondition = default(string)) + + /// List of route prefixes which this criteria matches. + /// + + /// List of BGP communities which this criteria matches. + /// + + /// List of AS paths which this criteria matches. + /// + + /// Match condition to apply RouteMap rules. + /// Possible values include: 'Unknown', 'Contains', 'Equals', 'NotContains', + /// 'NotEquals' + public Criterion(System.Collections.Generic.IList routePrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList community = default(System.Collections.Generic.IList), System.Collections.Generic.IList asPath = default(System.Collections.Generic.IList), string matchCondition = default(string)) + { - RoutePrefix = routePrefix; - Community = community; - AsPath = asPath; - MatchCondition = matchCondition; + this.RoutePrefix = routePrefix; + this.Community = community; + this.AsPath = asPath; + this.MatchCondition = matchCondition; CustomInit(); } @@ -55,31 +52,29 @@ public Criterion() /// partial void CustomInit(); + /// /// Gets or sets list of route prefixes which this criteria matches. /// - [JsonProperty(PropertyName = "routePrefix")] - public IList RoutePrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "routePrefix")] + public System.Collections.Generic.IList RoutePrefix {get; set; } /// /// Gets or sets list of BGP communities which this criteria matches. /// - [JsonProperty(PropertyName = "community")] - public IList Community { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "community")] + public System.Collections.Generic.IList Community {get; set; } /// /// Gets or sets list of AS paths which this criteria matches. /// - [JsonProperty(PropertyName = "asPath")] - public IList AsPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asPath")] + public System.Collections.Generic.IList AsPath {get; set; } /// - /// Gets or sets match condition to apply RouteMap rules. Possible - /// values include: 'Unknown', 'Contains', 'Equals', 'NotContains', - /// 'NotEquals' + /// Gets or sets match condition to apply RouteMap rules. Possible values include: 'Unknown', 'Contains', 'Equals', 'NotContains', 'NotEquals' /// - [JsonProperty(PropertyName = "matchCondition")] - public string MatchCondition { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "matchCondition")] + public string MatchCondition {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CrossTenantScopes.cs b/src/Network/Network.Management.Sdk/Generated/Models/CrossTenantScopes.cs index df59ba9d22d8..7fb9c724d30c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CrossTenantScopes.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CrossTenantScopes.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,21 @@ public CrossTenantScopes() /// /// Initializes a new instance of the CrossTenantScopes class. /// - /// Tenant ID. - /// List of management groups. - /// List of subscriptions. - public CrossTenantScopes(string tenantId = default(string), IList managementGroups = default(IList), IList subscriptions = default(IList)) + + /// Tenant ID. + /// + + /// List of management groups. + /// + + /// List of subscriptions. + /// + public CrossTenantScopes(string tenantId = default(string), System.Collections.Generic.IList managementGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList subscriptions = default(System.Collections.Generic.IList)) + { - TenantId = tenantId; - ManagementGroups = managementGroups; - Subscriptions = subscriptions; + this.TenantId = tenantId; + this.ManagementGroups = managementGroups; + this.Subscriptions = subscriptions; CustomInit(); } @@ -47,23 +46,23 @@ public CrossTenantScopes() /// partial void CustomInit(); + /// /// Gets tenant ID. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// /// Gets list of management groups. /// - [JsonProperty(PropertyName = "managementGroups")] - public IList ManagementGroups { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managementGroups")] + public System.Collections.Generic.IList ManagementGroups {get; private set; } /// /// Gets list of subscriptions. /// - [JsonProperty(PropertyName = "subscriptions")] - public IList Subscriptions { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptions")] + public System.Collections.Generic.IList Subscriptions {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CustomDnsConfigPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/CustomDnsConfigPropertiesFormat.cs index 9975f44c6ac1..ed12af13ba63 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CustomDnsConfigPropertiesFormat.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CustomDnsConfigPropertiesFormat.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class CustomDnsConfigPropertiesFormat { /// - /// Initializes a new instance of the CustomDnsConfigPropertiesFormat - /// class. + /// Initializes a new instance of the CustomDnsConfigPropertiesFormat class. /// public CustomDnsConfigPropertiesFormat() { @@ -30,17 +21,19 @@ public CustomDnsConfigPropertiesFormat() } /// - /// Initializes a new instance of the CustomDnsConfigPropertiesFormat - /// class. + /// Initializes a new instance of the CustomDnsConfigPropertiesFormat class. /// - /// Fqdn that resolves to private endpoint ip - /// address. - /// A list of private ip addresses of the - /// private endpoint. - public CustomDnsConfigPropertiesFormat(string fqdn = default(string), IList ipAddresses = default(IList)) + + /// Fqdn that resolves to private endpoint ip address. + /// + + /// A list of private ip addresses of the private endpoint. + /// + public CustomDnsConfigPropertiesFormat(string fqdn = default(string), System.Collections.Generic.IList ipAddresses = default(System.Collections.Generic.IList)) + { - Fqdn = fqdn; - IpAddresses = ipAddresses; + this.Fqdn = fqdn; + this.IPAddresses = ipAddresses; CustomInit(); } @@ -49,18 +42,17 @@ public CustomDnsConfigPropertiesFormat() /// partial void CustomInit(); + /// /// Gets or sets fqdn that resolves to private endpoint ip address. /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } /// - /// Gets or sets a list of private ip addresses of the private - /// endpoint. + /// Gets or sets a list of private ip addresses of the private endpoint. /// - [JsonProperty(PropertyName = "ipAddresses")] - public IList IpAddresses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddresses")] + public System.Collections.Generic.IList IPAddresses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefix.cs b/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefix.cs index cca5410f2913..1f89b4042f4c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefix.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefix.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Custom IP prefix resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CustomIpPrefix : Resource { /// @@ -34,74 +24,102 @@ public CustomIpPrefix() /// /// Initializes a new instance of the CustomIpPrefix class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the custom - /// IP prefix. - /// The ASN for CIDR advertising. Should be an - /// integer as string. - /// The prefix range in CIDR notation. Should - /// include the start address and the prefix length. - /// Signed message for WAN - /// validation. - /// Authorization message for WAN - /// validation. - /// The Parent CustomIpPrefix for - /// IPv6 /64 CustomIpPrefix. - /// The list of all Children for - /// IPv6 /48 CustomIpPrefix. - /// The commissioned state of the - /// Custom IP Prefix. Possible values include: 'Provisioning', - /// 'Provisioned', 'Commissioning', 'CommissionedNoInternetAdvertise', - /// 'Commissioned', 'Decommissioning', 'Deprovisioning', - /// 'Deprovisioned' - /// Whether to do express route - /// advertise. - /// The Geo for CIDR advertising. Should be an Geo - /// code. Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', - /// 'LATAM', 'NAM', 'ME', 'OCEANIA', 'AQ' - /// Whether to Advertise the range to - /// Internet. - /// Type of custom IP prefix. Should be - /// Singular, Parent, or Child. Possible values include: 'Singular', - /// 'Parent', 'Child' - /// The list of all referenced - /// PublicIpPrefixes. - /// The resource GUID property of the custom - /// IP prefix resource. - /// The reason why resource is in failed - /// state. - /// The provisioning state of the - /// custom IP prefix resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A list of availability zones denoting the IP - /// allocated for the resource needs to come from. - public CustomIpPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string asn = default(string), string cidr = default(string), string signedMessage = default(string), string authorizationMessage = default(string), SubResource customIpPrefixParent = default(SubResource), IList childCustomIpPrefixes = default(IList), string commissionedState = default(string), bool? expressRouteAdvertise = default(bool?), string geo = default(string), bool? noInternetAdvertise = default(bool?), string prefixType = default(string), IList publicIpPrefixes = default(IList), string resourceGuid = default(string), string failedReason = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the custom IP prefix. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// A list of availability zones denoting the IP allocated for the resource + /// needs to come from. + /// + + /// The commissioned state of the Custom IP Prefix. + /// Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', + /// 'CommissionedNoInternetAdvertise', 'Commissioned', 'Decommissioning', + /// 'Deprovisioning', 'Deprovisioned' + + /// The Geo for CIDR advertising. Should be an Geo code. + /// Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', 'NAM', + /// 'ME', 'OCEANIA', 'AQ' + + /// The provisioning state of the custom IP prefix resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The ASN for CIDR advertising. Should be an integer as string. + /// + + /// The prefix range in CIDR notation. Should include the start address and the + /// prefix length. + /// + + /// Signed message for WAN validation. + /// + + /// Authorization message for WAN validation. + /// + + /// The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + /// + + /// The list of all Children for IPv6 /48 CustomIpPrefix. + /// + + /// Whether to do express route advertise. + /// + + /// Whether to Advertise the range to Internet. + /// + + /// Type of custom IP prefix. Should be Singular, Parent, or Child. + /// Possible values include: 'Singular', 'Parent', 'Child' + + /// The list of all referenced PublicIpPrefixes. + /// + + /// The resource GUID property of the custom IP prefix resource. + /// + + /// The reason why resource is in failed state. + /// + public CustomIpPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string commissionedState = default(string), string geo = default(string), string provisioningState = default(string), string asn = default(string), string cidr = default(string), string signedMessage = default(string), string authorizationMessage = default(string), SubResource customIPPrefixParent = default(SubResource), System.Collections.Generic.IList childCustomIPPrefixes = default(System.Collections.Generic.IList), bool? expressRouteAdvertise = default(bool?), bool? noInternetAdvertise = default(bool?), string prefixType = default(string), System.Collections.Generic.IList publicIPPrefixes = default(System.Collections.Generic.IList), string resourceGuid = default(string), string failedReason = default(string)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - Asn = asn; - Cidr = cidr; - SignedMessage = signedMessage; - AuthorizationMessage = authorizationMessage; - CustomIpPrefixParent = customIpPrefixParent; - ChildCustomIpPrefixes = childCustomIpPrefixes; - CommissionedState = commissionedState; - ExpressRouteAdvertise = expressRouteAdvertise; - Geo = geo; - NoInternetAdvertise = noInternetAdvertise; - PrefixType = prefixType; - PublicIpPrefixes = publicIpPrefixes; - ResourceGuid = resourceGuid; - FailedReason = failedReason; - ProvisioningState = provisioningState; - Etag = etag; - Zones = zones; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.Zones = zones; + this.CommissionedState = commissionedState; + this.Geo = geo; + this.ProvisioningState = provisioningState; + this.Asn = asn; + this.Cidr = cidr; + this.SignedMessage = signedMessage; + this.AuthorizationMessage = authorizationMessage; + this.CustomIPPrefixParent = customIPPrefixParent; + this.ChildCustomIPPrefixes = childCustomIPPrefixes; + this.ExpressRouteAdvertise = expressRouteAdvertise; + this.NoInternetAdvertise = noInternetAdvertise; + this.PrefixType = prefixType; + this.PublicIPPrefixes = publicIPPrefixes; + this.ResourceGuid = resourceGuid; + this.FailedReason = failedReason; CustomInit(); } @@ -110,125 +128,117 @@ public CustomIpPrefix() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the custom IP prefix. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets the ASN for CIDR advertising. Should be an integer as - /// string. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.asn")] - public string Asn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the prefix range in CIDR notation. Should include the - /// start address and the prefix length. + /// Gets or sets a list of availability zones denoting the IP allocated for the + /// resource needs to come from. /// - [JsonProperty(PropertyName = "properties.cidr")] - public string Cidr { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets signed message for WAN validation. + /// Gets or sets the commissioned state of the Custom IP Prefix. Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', 'CommissionedNoInternetAdvertise', 'Commissioned', 'Decommissioning', 'Deprovisioning', 'Deprovisioned' /// - [JsonProperty(PropertyName = "properties.signedMessage")] - public string SignedMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.commissionedState")] + public string CommissionedState {get; set; } /// - /// Gets or sets authorization message for WAN validation. + /// Gets or sets the Geo for CIDR advertising. Should be an Geo code. Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', 'NAM', 'ME', 'OCEANIA', 'AQ' /// - [JsonProperty(PropertyName = "properties.authorizationMessage")] - public string AuthorizationMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.geo")] + public string Geo {get; set; } /// - /// Gets or sets the Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + /// Gets the provisioning state of the custom IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.customIpPrefixParent")] - public SubResource CustomIpPrefixParent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the list of all Children for IPv6 /48 CustomIpPrefix. + /// Gets or sets the ASN for CIDR advertising. Should be an integer as string. /// - [JsonProperty(PropertyName = "properties.childCustomIpPrefixes")] - public IList ChildCustomIpPrefixes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.asn")] + public string Asn {get; set; } /// - /// Gets or sets the commissioned state of the Custom IP Prefix. - /// Possible values include: 'Provisioning', 'Provisioned', - /// 'Commissioning', 'CommissionedNoInternetAdvertise', 'Commissioned', - /// 'Decommissioning', 'Deprovisioning', 'Deprovisioned' + /// Gets or sets the prefix range in CIDR notation. Should include the start + /// address and the prefix length. /// - [JsonProperty(PropertyName = "properties.commissionedState")] - public string CommissionedState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cidr")] + public string Cidr {get; set; } /// - /// Gets or sets whether to do express route advertise. + /// Gets or sets signed message for WAN validation. /// - [JsonProperty(PropertyName = "properties.expressRouteAdvertise")] - public bool? ExpressRouteAdvertise { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.signedMessage")] + public string SignedMessage {get; set; } /// - /// Gets or sets the Geo for CIDR advertising. Should be an Geo code. - /// Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', - /// 'NAM', 'ME', 'OCEANIA', 'AQ' + /// Gets or sets authorization message for WAN validation. /// - [JsonProperty(PropertyName = "properties.geo")] - public string Geo { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationMessage")] + public string AuthorizationMessage {get; set; } /// - /// Gets or sets whether to Advertise the range to Internet. + /// Gets or sets the Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. /// - [JsonProperty(PropertyName = "properties.noInternetAdvertise")] - public bool? NoInternetAdvertise { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customIpPrefixParent")] + public SubResource CustomIPPrefixParent {get; set; } /// - /// Gets or sets type of custom IP prefix. Should be Singular, Parent, - /// or Child. Possible values include: 'Singular', 'Parent', 'Child' + /// Gets the list of all Children for IPv6 /48 CustomIpPrefix. /// - [JsonProperty(PropertyName = "properties.prefixType")] - public string PrefixType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.childCustomIpPrefixes")] + public System.Collections.Generic.IList ChildCustomIPPrefixes {get; private set; } /// - /// Gets the list of all referenced PublicIpPrefixes. + /// Gets or sets whether to do express route advertise. /// - [JsonProperty(PropertyName = "properties.publicIpPrefixes")] - public IList PublicIpPrefixes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteAdvertise")] + public bool? ExpressRouteAdvertise {get; set; } /// - /// Gets the resource GUID property of the custom IP prefix resource. + /// Gets or sets whether to Advertise the range to Internet. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.noInternetAdvertise")] + public bool? NoInternetAdvertise {get; set; } /// - /// Gets the reason why resource is in failed state. + /// Gets or sets type of custom IP prefix. Should be Singular, Parent, or + /// Child. Possible values include: 'Singular', 'Parent', 'Child' /// - [JsonProperty(PropertyName = "properties.failedReason")] - public string FailedReason { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.prefixType")] + public string PrefixType {get; set; } /// - /// Gets the provisioning state of the custom IP prefix resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the list of all referenced PublicIpPrefixes. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIpPrefixes")] + public System.Collections.Generic.IList PublicIPPrefixes {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the custom IP prefix resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets a list of availability zones denoting the IP allocated - /// for the resource needs to come from. + /// Gets the reason why resource is in failed state. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.failedReason")] + public string FailedReason {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixPropertiesFormat.cs new file mode 100644 index 000000000000..f8f9448d4235 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixPropertiesFormat.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Custom IP prefix properties. + /// + public partial class CustomIpPrefixPropertiesFormat + { + /// + /// Initializes a new instance of the CustomIpPrefixPropertiesFormat class. + /// + public CustomIpPrefixPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomIpPrefixPropertiesFormat class. + /// + + /// The ASN for CIDR advertising. Should be an integer as string. + /// + + /// The prefix range in CIDR notation. Should include the start address and the + /// prefix length. + /// + + /// Signed message for WAN validation. + /// + + /// Authorization message for WAN validation. + /// + + /// The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + /// + + /// The list of all Children for IPv6 /48 CustomIpPrefix. + /// + + /// The commissioned state of the Custom IP Prefix. + /// Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', + /// 'CommissionedNoInternetAdvertise', 'Commissioned', 'Decommissioning', + /// 'Deprovisioning', 'Deprovisioned' + + /// Whether to do express route advertise. + /// + + /// The Geo for CIDR advertising. Should be an Geo code. + /// Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', 'NAM', + /// 'ME', 'OCEANIA', 'AQ' + + /// Whether to Advertise the range to Internet. + /// + + /// Type of custom IP prefix. Should be Singular, Parent, or Child. + /// Possible values include: 'Singular', 'Parent', 'Child' + + /// The list of all referenced PublicIpPrefixes. + /// + + /// The resource GUID property of the custom IP prefix resource. + /// + + /// The reason why resource is in failed state. + /// + + /// The provisioning state of the custom IP prefix resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public CustomIpPrefixPropertiesFormat(string asn = default(string), string cidr = default(string), string signedMessage = default(string), string authorizationMessage = default(string), SubResource customIPPrefixParent = default(SubResource), System.Collections.Generic.IList childCustomIPPrefixes = default(System.Collections.Generic.IList), string commissionedState = default(string), bool? expressRouteAdvertise = default(bool?), string geo = default(string), bool? noInternetAdvertise = default(bool?), string prefixType = default(string), System.Collections.Generic.IList publicIPPrefixes = default(System.Collections.Generic.IList), string resourceGuid = default(string), string failedReason = default(string), string provisioningState = default(string)) + + { + this.Asn = asn; + this.Cidr = cidr; + this.SignedMessage = signedMessage; + this.AuthorizationMessage = authorizationMessage; + this.CustomIPPrefixParent = customIPPrefixParent; + this.ChildCustomIPPrefixes = childCustomIPPrefixes; + this.CommissionedState = commissionedState; + this.ExpressRouteAdvertise = expressRouteAdvertise; + this.Geo = geo; + this.NoInternetAdvertise = noInternetAdvertise; + this.PrefixType = prefixType; + this.PublicIPPrefixes = publicIPPrefixes; + this.ResourceGuid = resourceGuid; + this.FailedReason = failedReason; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the ASN for CIDR advertising. Should be an integer as string. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + public string Asn {get; set; } + + /// + /// Gets or sets the prefix range in CIDR notation. Should include the start + /// address and the prefix length. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cidr")] + public string Cidr {get; set; } + + /// + /// Gets or sets signed message for WAN validation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "signedMessage")] + public string SignedMessage {get; set; } + + /// + /// Gets or sets authorization message for WAN validation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationMessage")] + public string AuthorizationMessage {get; set; } + + /// + /// Gets or sets the Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customIpPrefixParent")] + public SubResource CustomIPPrefixParent {get; set; } + + /// + /// Gets the list of all Children for IPv6 /48 CustomIpPrefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "childCustomIpPrefixes")] + public System.Collections.Generic.IList ChildCustomIPPrefixes {get; private set; } + + /// + /// Gets or sets the commissioned state of the Custom IP Prefix. Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', 'CommissionedNoInternetAdvertise', 'Commissioned', 'Decommissioning', 'Deprovisioning', 'Deprovisioned' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "commissionedState")] + public string CommissionedState {get; set; } + + /// + /// Gets or sets whether to do express route advertise. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteAdvertise")] + public bool? ExpressRouteAdvertise {get; set; } + + /// + /// Gets or sets the Geo for CIDR advertising. Should be an Geo code. Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', 'NAM', 'ME', 'OCEANIA', 'AQ' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "geo")] + public string Geo {get; set; } + + /// + /// Gets or sets whether to Advertise the range to Internet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "noInternetAdvertise")] + public bool? NoInternetAdvertise {get; set; } + + /// + /// Gets or sets type of custom IP prefix. Should be Singular, Parent, or + /// Child. Possible values include: 'Singular', 'Parent', 'Child' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "prefixType")] + public string PrefixType {get; set; } + + /// + /// Gets the list of all referenced PublicIpPrefixes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpPrefixes")] + public System.Collections.Generic.IList PublicIPPrefixes {get; private set; } + + /// + /// Gets the resource GUID property of the custom IP prefix resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the reason why resource is in failed state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "failedReason")] + public string FailedReason {get; private set; } + + /// + /// Gets the provisioning state of the custom IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixType.cs b/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixType.cs index 9b29fd9f7776..7678b291f963 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/CustomIpPrefixType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for CustomIpPrefixType. /// + + public static class CustomIpPrefixType { public const string Singular = "Singular"; public const string Parent = "Parent"; public const string Child = "Child"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPoliciesDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPoliciesDeleteHeaders.cs index ff9afda624af..402128ace054 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPoliciesDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPoliciesDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class DdosCustomPoliciesDeleteHeaders { /// - /// Initializes a new instance of the DdosCustomPoliciesDeleteHeaders - /// class. + /// Initializes a new instance of the DdosCustomPoliciesDeleteHeaders class. /// public DdosCustomPoliciesDeleteHeaders() { @@ -28,14 +18,15 @@ public DdosCustomPoliciesDeleteHeaders() } /// - /// Initializes a new instance of the DdosCustomPoliciesDeleteHeaders - /// class. + /// Initializes a new instance of the DdosCustomPoliciesDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public DdosCustomPoliciesDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public DdosCustomPoliciesDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicy.cs index f865bd023e31..044f9731a54e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicy.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A DDoS custom policy in a resource group. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DdosCustomPolicy : Resource { /// @@ -34,26 +24,39 @@ public DdosCustomPolicy() /// /// Initializes a new instance of the DdosCustomPolicy class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The resource GUID property of the DDoS - /// custom policy resource. It uniquely identifies the resource, even - /// if the user changes its name or migrate the resource across - /// subscriptions or resource groups. - /// The provisioning state of the DDoS - /// custom policy resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public DdosCustomPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the DDoS custom policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The resource GUID property of the DDoS custom policy resource. It uniquely + /// identifies the resource, even if the user changes its name or migrate the + /// resource across subscriptions or resource groups. + /// + public DdosCustomPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -62,29 +65,26 @@ public DdosCustomPolicy() /// partial void CustomInit(); + /// - /// Gets the resource GUID property of the DDoS custom policy resource. - /// It uniquely identifies the resource, even if the user changes its - /// name or migrate the resource across subscriptions or resource - /// groups. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the DDoS custom policy resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the DDoS custom policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the DDoS custom policy resource. It + /// uniquely identifies the resource, even if the user changes its name or + /// migrate the resource across subscriptions or resource groups. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicyPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicyPropertiesFormat.cs new file mode 100644 index 000000000000..a92c6b072aae --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosCustomPolicyPropertiesFormat.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// DDoS custom policy properties. + /// + public partial class DdosCustomPolicyPropertiesFormat + { + /// + /// Initializes a new instance of the DdosCustomPolicyPropertiesFormat class. + /// + public DdosCustomPolicyPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DdosCustomPolicyPropertiesFormat class. + /// + + /// The resource GUID property of the DDoS custom policy resource. It uniquely + /// identifies the resource, even if the user changes its name or migrate the + /// resource across subscriptions or resource groups. + /// + + /// The provisioning state of the DDoS custom policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public DdosCustomPolicyPropertiesFormat(string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the resource GUID property of the DDoS custom policy resource. It + /// uniquely identifies the resource, even if the user changes its name or + /// migrate the resource across subscriptions or resource groups. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the DDoS custom policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlan.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlan.cs index 38bb4993e5d7..477584db55e0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlan.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlan.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A DDoS protection plan in a resource group. /// - [Rest.Serialization.JsonTransformation] - public partial class DdosProtectionPlan : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DdosProtectionPlan : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the DdosProtectionPlan class. @@ -35,38 +24,53 @@ public DdosProtectionPlan() /// /// Initializes a new instance of the DdosProtectionPlan class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// 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. - /// The provisioning state of the DDoS - /// protection plan resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The list of public IPs associated - /// with the DDoS protection plan resource. This list is - /// read-only. - /// The list of virtual networks - /// associated with the DDoS protection plan resource. This list is - /// read-only. - /// A unique read-only string that changes whenever - /// the resource is updated. - public DdosProtectionPlan(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string resourceGuid = default(string), string provisioningState = default(string), IList publicIPAddresses = default(IList), IList virtualNetworks = default(IList), string etag = default(string)) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the DDoS protection plan resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// 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. + /// + + /// The list of public IPs associated with the DDoS protection plan resource. + /// This list is read-only. + /// + + /// The list of virtual networks associated with the DDoS protection plan + /// resource. This list is read-only. + /// + public DdosProtectionPlan(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string resourceGuid = default(string), System.Collections.Generic.IList publicIPAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworks = default(System.Collections.Generic.IList)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - PublicIPAddresses = publicIPAddresses; - VirtualNetworks = virtualNetworks; - Etag = etag; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Tags = tags; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + this.PublicIPAddresses = publicIPAddresses; + this.VirtualNetworks = virtualNetworks; CustomInit(); } @@ -75,73 +79,70 @@ public DdosProtectionPlan() /// partial void CustomInit(); + /// /// Gets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets 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. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the DDoS protection plan resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the DDoS protection plan resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the list of public IPs associated with the DDoS protection - /// plan resource. This list is read-only. + /// Gets 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. /// - [JsonProperty(PropertyName = "properties.publicIPAddresses")] - public IList PublicIPAddresses { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets the list of virtual networks associated with the DDoS - /// protection plan resource. This list is read-only. + /// Gets the list of public IPs associated with the DDoS protection plan + /// resource. This list is read-only. /// - [JsonProperty(PropertyName = "properties.virtualNetworks")] - public IList VirtualNetworks { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddresses")] + public System.Collections.Generic.IList PublicIPAddresses {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the list of virtual networks associated with the DDoS protection plan + /// resource. This list is read-only. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworks")] + public System.Collections.Generic.IList VirtualNetworks {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlanPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlanPropertiesFormat.cs new file mode 100644 index 000000000000..1c59981fa035 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlanPropertiesFormat.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// DDoS protection plan properties. + /// + public partial class DdosProtectionPlanPropertiesFormat + { + /// + /// Initializes a new instance of the DdosProtectionPlanPropertiesFormat class. + /// + public DdosProtectionPlanPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DdosProtectionPlanPropertiesFormat class. + /// + + /// 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. + /// + + /// The provisioning state of the DDoS protection plan resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The list of public IPs associated with the DDoS protection plan resource. + /// This list is read-only. + /// + + /// The list of virtual networks associated with the DDoS protection plan + /// resource. This list is read-only. + /// + public DdosProtectionPlanPropertiesFormat(string resourceGuid = default(string), string provisioningState = default(string), System.Collections.Generic.IList publicIPAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworks = default(System.Collections.Generic.IList)) + + { + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.PublicIPAddresses = publicIPAddresses; + this.VirtualNetworks = virtualNetworks; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the DDoS protection plan resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the list of public IPs associated with the DDoS protection plan + /// resource. This list is read-only. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddresses")] + public System.Collections.Generic.IList PublicIPAddresses {get; private set; } + + /// + /// Gets the list of virtual networks associated with the DDoS protection plan + /// resource. This list is read-only. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworks")] + public System.Collections.Generic.IList VirtualNetworks {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlansDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlansDeleteHeaders.cs index ba99a7ccfc96..e66b3d34d0fc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlansDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosProtectionPlansDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class DdosProtectionPlansDeleteHeaders { /// - /// Initializes a new instance of the DdosProtectionPlansDeleteHeaders - /// class. + /// Initializes a new instance of the DdosProtectionPlansDeleteHeaders class. /// public DdosProtectionPlansDeleteHeaders() { @@ -28,14 +18,15 @@ public DdosProtectionPlansDeleteHeaders() } /// - /// Initializes a new instance of the DdosProtectionPlansDeleteHeaders - /// class. + /// Initializes a new instance of the DdosProtectionPlansDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public DdosProtectionPlansDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public DdosProtectionPlansDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosSettings.cs index 6f17b42187c8..a881864c09ac 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DdosSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,18 @@ public DdosSettings() /// /// Initializes a new instance of the DdosSettings class. /// - /// The DDoS protection mode of the public - /// IP. Possible values include: 'VirtualNetworkInherited', 'Enabled', - /// 'Disabled' - /// The DDoS protection plan - /// associated with the public IP. Can only be set if ProtectionMode is - /// Enabled + + /// The DDoS protection mode of the public IP + /// Possible values include: 'VirtualNetworkInherited', 'Enabled', 'Disabled' + + /// The DDoS protection plan associated with the public IP. Can only be set if + /// ProtectionMode is Enabled + /// public DdosSettings(string protectionMode = default(string), SubResource ddosProtectionPlan = default(SubResource)) + { - ProtectionMode = protectionMode; - DdosProtectionPlan = ddosProtectionPlan; + this.ProtectionMode = protectionMode; + this.DdosProtectionPlan = ddosProtectionPlan; CustomInit(); } @@ -47,19 +43,18 @@ public DdosSettings() /// partial void CustomInit(); + /// - /// Gets or sets the DDoS protection mode of the public IP. Possible - /// values include: 'VirtualNetworkInherited', 'Enabled', 'Disabled' + /// Gets or sets the DDoS protection mode of the public IP Possible values include: 'VirtualNetworkInherited', 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "protectionMode")] - public string ProtectionMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protectionMode")] + public string ProtectionMode {get; set; } /// - /// Gets or sets the DDoS protection plan associated with the public - /// IP. Can only be set if ProtectionMode is Enabled + /// Gets or sets the DDoS protection plan associated with the public IP. Can + /// only be set if ProtectionMode is Enabled /// - [JsonProperty(PropertyName = "ddosProtectionPlan")] - public SubResource DdosProtectionPlan { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ddosProtectionPlan")] + public SubResource DdosProtectionPlan {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DdosSettingsProtectionMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/DdosSettingsProtectionMode.cs index 49f0e8fdc02a..64d7038edafb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DdosSettingsProtectionMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DdosSettingsProtectionMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for DdosSettingsProtectionMode. /// + + public static class DdosSettingsProtectionMode { public const string VirtualNetworkInherited = "VirtualNetworkInherited"; public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminPropertiesFormat.cs new file mode 100644 index 000000000000..6a19ff1ca27e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminPropertiesFormat.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Security default admin rule resource. + /// + public partial class DefaultAdminPropertiesFormat + { + /// + /// Initializes a new instance of the DefaultAdminPropertiesFormat class. + /// + public DefaultAdminPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultAdminPropertiesFormat class. + /// + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Default rule flag. + /// + + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Unique identifier for this resource. + /// + public DefaultAdminPropertiesFormat(string description = default(string), string flag = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.Flag = flag; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; private set; } + + /// + /// Gets or sets default rule flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flag")] + public string Flag {get; set; } + + /// + /// Gets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; private set; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sources")] + public System.Collections.Generic.IList Sources {get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; private set; } + + /// + /// Gets the source port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; private set; } + + /// + /// Gets the destination port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; private set; } + + /// + /// Gets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; private set; } + + /// + /// Gets the priority of the rule. The value can be between 1 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; private set; } + + /// + /// Gets indicates if the traffic matched against the rule in inbound or + /// outbound. Possible values include: 'Inbound', 'Outbound' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public string Direction {get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminRule.cs index d3743541ff9b..5cd2e56dad90 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DefaultAdminRule.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network default admin rule. /// [Newtonsoft.Json.JsonObject("Default")] - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DefaultAdminRule : BaseAdminRule { /// @@ -35,55 +25,75 @@ public DefaultAdminRule() /// /// Initializes a new instance of the DefaultAdminRule class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The system metadata related to this - /// resource. - /// A description for this rule. Restricted - /// to 140 chars. - /// Default rule flag. + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Default rule flag. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// The CIDR or source IP ranges. - /// The destination address prefixes. CIDR - /// or destination IP ranges. - /// The source port ranges. - /// The destination port - /// ranges. - /// Indicates the access allowed for this - /// particular rule. Possible values include: 'Allow', 'Deny', - /// 'AlwaysAllow' - /// The priority of the rule. The value can be - /// between 1 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. - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public DefaultAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string), string resourceGuid = default(string)) - : base(id, name, type, etag, systemData) + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// Unique identifier for this resource. + /// + public DefaultAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), string flag = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string resourceGuid = default(string)) + + : base(id, name, type, etag, systemData) { - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Flag = flag; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -92,84 +102,80 @@ public DefaultAdminRule() /// partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; private set; } /// /// Gets or sets default rule flag. /// - [JsonProperty(PropertyName = "properties.flag")] - public string Flag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flag")] + public string Flag {get; set; } /// - /// Gets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// Gets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; private set; } /// /// Gets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sources")] + public System.Collections.Generic.IList Sources {get; private set; } /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. + /// Gets the destination address prefixes. CIDR or destination IP ranges. /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinations")] + public System.Collections.Generic.IList Destinations {get; private set; } /// /// Gets the source port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; private set; } /// /// Gets the destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; private set; } - - /// - /// Gets indicates the access allowed for this particular rule. - /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' - /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; private set; } /// - /// Gets the priority of the rule. The value can be between 1 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. + /// Gets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; private set; } /// - /// Gets indicates if the traffic matched against the rule in inbound - /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// Gets the priority of the rule. The value can be between 1 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. /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets indicates if the traffic matched against the rule in inbound or + /// outbound. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; private set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DefaultRuleSetPropertyFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/DefaultRuleSetPropertyFormat.cs new file mode 100644 index 000000000000..f8a086e7fe67 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/DefaultRuleSetPropertyFormat.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// the default web application firewall rule set. + /// + public partial class DefaultRuleSetPropertyFormat + { + /// + /// Initializes a new instance of the DefaultRuleSetPropertyFormat class. + /// + public DefaultRuleSetPropertyFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultRuleSetPropertyFormat class. + /// + + /// The type of the web application firewall rule set. + /// + + /// The version of the web application firewall rule set type. + /// + public DefaultRuleSetPropertyFormat(string ruleSetType = default(string), string ruleSetVersion = default(string)) + + { + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the type of the web application firewall rule set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetType")] + public string RuleSetType {get; set; } + + /// + /// Gets or sets the version of the web application firewall rule set type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetVersion")] + public string RuleSetVersion {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Delegation.cs b/src/Network/Network.Management.Sdk/Generated/Models/Delegation.cs index f83b63c774aa..7381ce42d0b4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Delegation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Delegation.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Details the service to which the subnet is delegated. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Delegation : SubResource { /// @@ -34,28 +24,39 @@ public Delegation() /// /// Initializes a new instance of the Delegation class. /// - /// Resource ID. - /// The name of the service to whom the - /// subnet should be delegated (e.g. Microsoft.Sql/servers). - /// The actions permitted to the service upon - /// delegation. - /// The provisioning state of the - /// service delegation resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// subnet. This name can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public Delegation(string id = default(string), string serviceName = default(string), IList actions = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a subnet. This name can be + /// used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the service delegation resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The name of the service to whom the subnet should be delegated (e.g. + /// Microsoft.Sql/servers). + /// + + /// The actions permitted to the service upon delegation. + /// + public Delegation(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string serviceName = default(string), System.Collections.Generic.IList actions = default(System.Collections.Generic.IList)) + + : base(id) { - ServiceName = serviceName; - Actions = actions; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.ServiceName = serviceName; + this.Actions = actions; CustomInit(); } @@ -64,46 +65,44 @@ public Delegation() /// partial void CustomInit(); + /// - /// Gets or sets the name of the service to whom the subnet should be - /// delegated (e.g. Microsoft.Sql/servers). + /// Gets or sets the name of the resource that is unique within a subnet. This + /// name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.serviceName")] - public string ServiceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the actions permitted to the service upon delegation. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the service delegation resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets resource type. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// subnet. This name can be used to access the resource. + /// Gets the provisioning state of the service delegation resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the name of the service to whom the subnet should be delegated + /// (e.g. Microsoft.Sql/servers). /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceName")] + public string ServiceName {get; set; } /// - /// Gets or sets resource type. + /// Gets the actions permitted to the service upon delegation. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actions")] + public System.Collections.Generic.IList Actions {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DelegationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/DelegationProperties.cs index 72e9b9b84c3c..b9fcfaf2549e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DelegationProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DelegationProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public DelegationProperties() /// /// Initializes a new instance of the DelegationProperties class. /// - /// The service name to which the NVA is - /// delegated. - /// Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The service name to which the NVA is delegated. + /// + + /// The current provisioning state. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' public DelegationProperties(string serviceName = default(string), string provisioningState = default(string)) + { - ServiceName = serviceName; - ProvisioningState = provisioningState; + this.ServiceName = serviceName; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -45,18 +42,17 @@ public DelegationProperties() /// partial void CustomInit(); + /// /// Gets or sets the service name to which the NVA is delegated. /// - [JsonProperty(PropertyName = "serviceName")] - public string ServiceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } /// - /// Gets possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the current provisioning state. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DeleteBastionShareableLinkByTokenHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/DeleteBastionShareableLinkByTokenHeaders.cs index 73ad2ac608de..ff2dd9c1d54e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DeleteBastionShareableLinkByTokenHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DeleteBastionShareableLinkByTokenHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for DeleteBastionShareableLinkByToken operation. - /// public partial class DeleteBastionShareableLinkByTokenHeaders { /// - /// Initializes a new instance of the - /// DeleteBastionShareableLinkByTokenHeaders class. + /// Initializes a new instance of the DeleteBastionShareableLinkByTokenHeaders class. /// public DeleteBastionShareableLinkByTokenHeaders() { @@ -28,12 +18,15 @@ public DeleteBastionShareableLinkByTokenHeaders() } /// - /// Initializes a new instance of the - /// DeleteBastionShareableLinkByTokenHeaders class. + /// Initializes a new instance of the DeleteBastionShareableLinkByTokenHeaders class. /// + + /// + /// public DeleteBastionShareableLinkByTokenHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public DeleteBastionShareableLinkByTokenHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DeleteExistingPeering.cs b/src/Network/Network.Management.Sdk/Generated/Models/DeleteExistingPeering.cs index c9466027f998..562bd47b626f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DeleteExistingPeering.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DeleteExistingPeering.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for DeleteExistingPeering. /// + + public static class DeleteExistingPeering { public const string False = "False"; public const string True = "True"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DeleteOptions.cs b/src/Network/Network.Management.Sdk/Generated/Models/DeleteOptions.cs index 79c56e63572b..713a33822a7f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DeleteOptions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DeleteOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for DeleteOptions. /// + + public static class DeleteOptions { public const string Delete = "Delete"; public const string Detach = "Detach"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DeploymentStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/DeploymentStatus.cs index 6386ef465c95..4c13c97acc57 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DeploymentStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DeploymentStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for DeploymentStatus. /// + + public static class DeploymentStatus { public const string NotStarted = "NotStarted"; @@ -21,4 +18,4 @@ public static class DeploymentStatus public const string Deployed = "Deployed"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DestinationPortBehavior.cs b/src/Network/Network.Management.Sdk/Generated/Models/DestinationPortBehavior.cs index 70212ba85a10..e442f9b34fe4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DestinationPortBehavior.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DestinationPortBehavior.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for DestinationPortBehavior. /// + + public static class DestinationPortBehavior { public const string None = "None"; public const string ListenIfAvailable = "ListenIfAvailable"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DeviceProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/DeviceProperties.cs index af2ee831ee28..2c75aeed0dac 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DeviceProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DeviceProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public DeviceProperties() /// /// Initializes a new instance of the DeviceProperties class. /// - /// Name of the device Vendor. - /// Model of the device. - /// Link speed. + + /// Name of the device Vendor. + /// + + /// Model of the device. + /// + + /// Link speed. + /// public DeviceProperties(string deviceVendor = default(string), string deviceModel = default(string), int? linkSpeedInMbps = default(int?)) + { - DeviceVendor = deviceVendor; - DeviceModel = deviceModel; - LinkSpeedInMbps = linkSpeedInMbps; + this.DeviceVendor = deviceVendor; + this.DeviceModel = deviceModel; + this.LinkSpeedInMbps = linkSpeedInMbps; CustomInit(); } @@ -45,23 +46,23 @@ public DeviceProperties() /// partial void CustomInit(); + /// /// Gets or sets name of the device Vendor. /// - [JsonProperty(PropertyName = "deviceVendor")] - public string DeviceVendor { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deviceVendor")] + public string DeviceVendor {get; set; } /// /// Gets or sets model of the device. /// - [JsonProperty(PropertyName = "deviceModel")] - public string DeviceModel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deviceModel")] + public string DeviceModel {get; set; } /// /// Gets or sets link speed. /// - [JsonProperty(PropertyName = "linkSpeedInMbps")] - public int? LinkSpeedInMbps { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linkSpeedInMbps")] + public int? LinkSpeedInMbps {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DhGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/DhGroup.cs index b2950fe5844a..756353d21223 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DhGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DhGroup.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for DhGroup. /// + + public static class DhGroup { public const string None = "None"; @@ -25,4 +22,4 @@ public static class DhGroup public const string ECP384 = "ECP384"; public const string DHGroup24 = "DHGroup24"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DhcpOptions.cs b/src/Network/Network.Management.Sdk/Generated/Models/DhcpOptions.cs index 34108c150fc3..abb6707d1a5c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DhcpOptions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DhcpOptions.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// 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. + /// 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. /// public partial class DhcpOptions { @@ -33,11 +25,13 @@ public DhcpOptions() /// /// Initializes a new instance of the DhcpOptions class. /// - /// The list of DNS servers IP - /// addresses. - public DhcpOptions(IList dnsServers = default(IList)) + + /// The list of DNS servers IP addresses. + /// + public DhcpOptions(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList)) + { - DnsServers = dnsServers; + this.DnsServers = dnsServers; CustomInit(); } @@ -46,11 +40,11 @@ public DhcpOptions() /// partial void CustomInit(); + /// /// Gets or sets the list of DNS servers IP addresses. /// - [JsonProperty(PropertyName = "dnsServers")] - public IList DnsServers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] + public System.Collections.Generic.IList DnsServers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Dimension.cs b/src/Network/Network.Management.Sdk/Generated/Models/Dimension.cs index e08af2700f38..d1e8a5ed2206 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Dimension.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Dimension.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public Dimension() /// /// Initializes a new instance of the Dimension class. /// - /// The name of the dimension. - /// The display name of the - /// dimension. - /// The internal name of the - /// dimension. + + /// The name of the dimension. + /// + + /// The display name of the dimension. + /// + + /// The internal name of the dimension. + /// public Dimension(string name = default(string), string displayName = default(string), string internalName = default(string)) + { - Name = name; - DisplayName = displayName; - InternalName = internalName; + this.Name = name; + this.DisplayName = displayName; + this.InternalName = internalName; CustomInit(); } @@ -47,23 +46,23 @@ public Dimension() /// partial void CustomInit(); + /// /// Gets or sets the name of the dimension. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the display name of the dimension. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets the internal name of the dimension. /// - [JsonProperty(PropertyName = "internalName")] - public string InternalName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "internalName")] + public string InternalName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Direction.cs b/src/Network/Network.Management.Sdk/Generated/Models/Direction.cs index 30a67f7d9345..0bbcdfb6e4a0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Direction.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Direction.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for Direction. /// + + public static class Direction { public const string Inbound = "Inbound"; public const string Outbound = "Outbound"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DnsNameAvailabilityResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/DnsNameAvailabilityResult.cs index 53f29753874f..e2ddbbafbf1b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DnsNameAvailabilityResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DnsNameAvailabilityResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public DnsNameAvailabilityResult() /// /// Initializes a new instance of the DnsNameAvailabilityResult class. /// - /// Domain availability (True/False). + + /// Domain availability (True/False). + /// public DnsNameAvailabilityResult(bool? available = default(bool?)) + { - Available = available; + this.Available = available; CustomInit(); } @@ -41,11 +38,11 @@ public DnsNameAvailabilityResult() /// partial void CustomInit(); + /// /// Gets or sets domain availability (True/False). /// - [JsonProperty(PropertyName = "available")] - public bool? Available { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "available")] + public bool? Available {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DnsSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/DnsSettings.cs index 129bf62ed108..057abe8b85cd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DnsSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DnsSettings.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,21 @@ public DnsSettings() /// /// Initializes a new instance of the DnsSettings class. /// - /// List of Custom DNS Servers. - /// Enable DNS Proxy on Firewalls attached to - /// the Firewall Policy. - /// FQDNs in Network Rules - /// are supported when set to true. - public DnsSettings(IList servers = default(IList), bool? enableProxy = default(bool?), bool? requireProxyForNetworkRules = default(bool?)) + + /// List of Custom DNS Servers. + /// + + /// Enable DNS Proxy on Firewalls attached to the Firewall Policy. + /// + + /// FQDNs in Network Rules are supported when set to true. + /// + public DnsSettings(System.Collections.Generic.IList servers = default(System.Collections.Generic.IList), bool? enableProxy = default(bool?), bool? requireProxyForNetworkRules = default(bool?)) + { - Servers = servers; - EnableProxy = enableProxy; - RequireProxyForNetworkRules = requireProxyForNetworkRules; + this.Servers = servers; + this.EnableProxy = enableProxy; + this.RequireProxyForNetworkRules = requireProxyForNetworkRules; CustomInit(); } @@ -49,24 +46,23 @@ public DnsSettings() /// partial void CustomInit(); + /// /// Gets or sets list of Custom DNS Servers. /// - [JsonProperty(PropertyName = "servers")] - public IList Servers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "servers")] + public System.Collections.Generic.IList Servers {get; set; } /// - /// Gets or sets enable DNS Proxy on Firewalls attached to the Firewall - /// Policy. + /// Gets or sets enable DNS Proxy on Firewalls attached to the Firewall Policy. /// - [JsonProperty(PropertyName = "enableProxy")] - public bool? EnableProxy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableProxy")] + public bool? EnableProxy {get; set; } /// /// Gets or sets fQDNs in Network Rules are supported when set to true. /// - [JsonProperty(PropertyName = "requireProxyForNetworkRules")] - public bool? RequireProxyForNetworkRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "requireProxyForNetworkRules")] + public bool? RequireProxyForNetworkRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DscpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/DscpConfiguration.cs index 44da270fbc15..5442aefc02bf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/DscpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/DscpConfiguration.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Differentiated Services Code Point configuration for any given network /// interface /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DscpConfiguration : Resource { /// @@ -35,49 +25,74 @@ public DscpConfiguration() /// /// Initializes a new instance of the DscpConfiguration class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// List of markings to be used in the - /// configuration. - /// Source IP ranges. - /// Destination IP ranges. - /// Sources port ranges. - /// Destination port - /// ranges. - /// RNM supported protocol types. Possible - /// values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', - /// 'Ah', 'Vxlan', 'All' - /// QoS object - /// definitions - /// Qos Collection ID generated by - /// RNM. - /// Associated Network - /// Interfaces to the DSCP Configuration. - /// The resource GUID property of the DSCP - /// Configuration resource. - /// The provisioning state of the DSCP - /// Configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public DscpConfiguration(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList markings = default(IList), IList sourceIpRanges = default(IList), IList destinationIpRanges = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string protocol = default(string), IList qosDefinitionCollection = default(IList), string qosCollectionId = default(string), IList associatedNetworkInterfaces = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the DSCP Configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of markings to be used in the configuration. + /// + + /// Source IP ranges. + /// + + /// Destination IP ranges. + /// + + /// Sources port ranges. + /// + + /// Destination port ranges. + /// + + /// RNM supported protocol types. + /// Possible values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', + /// 'Ah', 'Vxlan', 'All' + + /// QoS object definitions + /// + + /// Qos Collection ID generated by RNM. + /// + + /// Associated Network Interfaces to the DSCP Configuration. + /// + + /// The resource GUID property of the DSCP Configuration resource. + /// + public DscpConfiguration(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList markings = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationIPRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string protocol = default(string), System.Collections.Generic.IList qosDefinitionCollection = default(System.Collections.Generic.IList), string qosCollectionId = default(string), System.Collections.Generic.IList associatedNetworkInterfaces = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - Markings = markings; - SourceIpRanges = sourceIpRanges; - DestinationIpRanges = destinationIpRanges; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Protocol = protocol; - QosDefinitionCollection = qosDefinitionCollection; - QosCollectionId = qosCollectionId; - AssociatedNetworkInterfaces = associatedNetworkInterfaces; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Markings = markings; + this.SourceIPRanges = sourceIPRanges; + this.DestinationIPRanges = destinationIPRanges; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Protocol = protocol; + this.QosDefinitionCollection = qosDefinitionCollection; + this.QosCollectionId = qosCollectionId; + this.AssociatedNetworkInterfaces = associatedNetworkInterfaces; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -86,82 +101,78 @@ public DscpConfiguration() /// partial void CustomInit(); + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the DSCP Configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets list of markings to be used in the configuration. /// - [JsonProperty(PropertyName = "properties.markings")] - public IList Markings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.markings")] + public System.Collections.Generic.IList Markings {get; set; } /// /// Gets or sets source IP ranges. /// - [JsonProperty(PropertyName = "properties.sourceIpRanges")] - public IList SourceIpRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceIpRanges")] + public System.Collections.Generic.IList SourceIPRanges {get; set; } /// /// Gets or sets destination IP ranges. /// - [JsonProperty(PropertyName = "properties.destinationIpRanges")] - public IList DestinationIpRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationIpRanges")] + public System.Collections.Generic.IList DestinationIPRanges {get; set; } /// /// Gets or sets sources port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// /// Gets or sets destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// - /// Gets or sets RNM supported protocol types. Possible values include: - /// 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', 'Ah', 'Vxlan', - /// 'All' + /// Gets or sets rNM supported protocol types. Possible values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', 'Ah', 'Vxlan', 'All' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// /// Gets or sets qoS object definitions /// - [JsonProperty(PropertyName = "properties.qosDefinitionCollection")] - public IList QosDefinitionCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.qosDefinitionCollection")] + public System.Collections.Generic.IList QosDefinitionCollection {get; set; } /// /// Gets qos Collection ID generated by RNM. /// - [JsonProperty(PropertyName = "properties.qosCollectionId")] - public string QosCollectionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.qosCollectionId")] + public string QosCollectionId {get; private set; } /// /// Gets associated Network Interfaces to the DSCP Configuration. /// - [JsonProperty(PropertyName = "properties.associatedNetworkInterfaces")] - public IList AssociatedNetworkInterfaces { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.associatedNetworkInterfaces")] + public System.Collections.Generic.IList AssociatedNetworkInterfaces {get; private set; } /// /// Gets the resource GUID property of the DSCP Configuration resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - - /// - /// Gets the provisioning state of the DSCP Configuration resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/DscpConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/DscpConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..66cead24de41 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/DscpConfigurationPropertiesFormat.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Differentiated Services Code Point configuration properties. + /// + public partial class DscpConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the DscpConfigurationPropertiesFormat class. + /// + public DscpConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DscpConfigurationPropertiesFormat class. + /// + + /// List of markings to be used in the configuration. + /// + + /// Source IP ranges. + /// + + /// Destination IP ranges. + /// + + /// Sources port ranges. + /// + + /// Destination port ranges. + /// + + /// RNM supported protocol types. + /// Possible values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', + /// 'Ah', 'Vxlan', 'All' + + /// QoS object definitions + /// + + /// Qos Collection ID generated by RNM. + /// + + /// Associated Network Interfaces to the DSCP Configuration. + /// + + /// The resource GUID property of the DSCP Configuration resource. + /// + + /// The provisioning state of the DSCP Configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public DscpConfigurationPropertiesFormat(System.Collections.Generic.IList markings = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationIPRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string protocol = default(string), System.Collections.Generic.IList qosDefinitionCollection = default(System.Collections.Generic.IList), string qosCollectionId = default(string), System.Collections.Generic.IList associatedNetworkInterfaces = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.Markings = markings; + this.SourceIPRanges = sourceIPRanges; + this.DestinationIPRanges = destinationIPRanges; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Protocol = protocol; + this.QosDefinitionCollection = qosDefinitionCollection; + this.QosCollectionId = qosCollectionId; + this.AssociatedNetworkInterfaces = associatedNetworkInterfaces; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of markings to be used in the configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "markings")] + public System.Collections.Generic.IList Markings {get; set; } + + /// + /// Gets or sets source IP ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpRanges")] + public System.Collections.Generic.IList SourceIPRanges {get; set; } + + /// + /// Gets or sets destination IP ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationIpRanges")] + public System.Collections.Generic.IList DestinationIPRanges {get; set; } + + /// + /// Gets or sets sources port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } + + /// + /// Gets or sets destination port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } + + /// + /// Gets or sets rNM supported protocol types. Possible values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', 'Ah', 'Vxlan', 'All' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets qoS object definitions + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "qosDefinitionCollection")] + public System.Collections.Generic.IList QosDefinitionCollection {get; set; } + + /// + /// Gets qos Collection ID generated by RNM. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "qosCollectionId")] + public string QosCollectionId {get; private set; } + + /// + /// Gets associated Network Interfaces to the DSCP Configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedNetworkInterfaces")] + public System.Collections.Generic.IList AssociatedNetworkInterfaces {get; private set; } + + /// + /// Gets the resource GUID property of the DSCP Configuration resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the DSCP Configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveAdminRuleKind.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveAdminRuleKind.cs new file mode 100644 index 000000000000..8cbbd9655e35 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveAdminRuleKind.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for EffectiveAdminRuleKind. + /// + + + public static class EffectiveAdminRuleKind + { + public const string Custom = "Custom"; + public const string Default = "Default"; + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveBaseSecurityAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveBaseSecurityAdminRule.cs index c78dc023790e..1a042196e525 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveBaseSecurityAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveBaseSecurityAdminRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class EffectiveBaseSecurityAdminRule { /// - /// Initializes a new instance of the EffectiveBaseSecurityAdminRule - /// class. + /// Initializes a new instance of the EffectiveBaseSecurityAdminRule class. /// public EffectiveBaseSecurityAdminRule() { @@ -31,24 +22,31 @@ public EffectiveBaseSecurityAdminRule() } /// - /// Initializes a new instance of the EffectiveBaseSecurityAdminRule - /// class. + /// Initializes a new instance of the EffectiveBaseSecurityAdminRule class. /// - /// Resource ID. - /// A description of the - /// security admin configuration. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - public EffectiveBaseSecurityAdminRule(string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + + /// Resource ID. + /// + + /// A description of the security admin configuration. + /// + + /// A description of the rule collection. + /// + + /// Groups for rule collection + /// + + /// Effective configuration groups. + /// + public EffectiveBaseSecurityAdminRule(string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), System.Collections.Generic.IList ruleCollectionAppliesToGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList)) + { - Id = id; - ConfigurationDescription = configurationDescription; - RuleCollectionDescription = ruleCollectionDescription; - RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; - RuleGroups = ruleGroups; + this.Id = id; + this.ConfigurationDescription = configurationDescription; + this.RuleCollectionDescription = ruleCollectionDescription; + this.RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + this.RuleGroups = ruleGroups; CustomInit(); } @@ -57,35 +55,35 @@ public EffectiveBaseSecurityAdminRule() /// partial void CustomInit(); + /// /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets a description of the security admin configuration. /// - [JsonProperty(PropertyName = "configurationDescription")] - public string ConfigurationDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription {get; set; } /// /// Gets or sets a description of the rule collection. /// - [JsonProperty(PropertyName = "ruleCollectionDescription")] - public string RuleCollectionDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription {get; set; } /// /// Gets or sets groups for rule collection /// - [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] - public IList RuleCollectionAppliesToGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public System.Collections.Generic.IList RuleCollectionAppliesToGroups {get; set; } /// /// Gets or sets effective configuration groups. /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroups")] + public System.Collections.Generic.IList RuleGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveConnectivityConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveConnectivityConfiguration.cs index e1835086ee29..e8cdb4b92082 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveConnectivityConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveConnectivityConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The network manager effective connectivity configuration /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class EffectiveConnectivityConfiguration { /// - /// Initializes a new instance of the - /// EffectiveConnectivityConfiguration class. + /// Initializes a new instance of the EffectiveConnectivityConfiguration class. /// public EffectiveConnectivityConfiguration() { @@ -33,39 +22,51 @@ public EffectiveConnectivityConfiguration() } /// - /// Initializes a new instance of the - /// EffectiveConnectivityConfiguration class. + /// Initializes a new instance of the EffectiveConnectivityConfiguration class. /// + + /// Connectivity configuration ID. + /// + + /// Effective configuration groups. + /// + /// Connectivity topology type. - /// Possible values include: 'HubAndSpoke', 'Mesh' - /// Groups for configuration - /// Connectivity configuration ID. - /// A description of the connectivity - /// configuration. - /// List of hubItems - /// Flag if global mesh is supported. Possible - /// values include: 'False', 'True' - /// The provisioning state of the - /// connectivity configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Flag if need to remove current - /// existing peerings. Possible values include: 'False', 'True' - /// Unique identifier for this - /// resource. - /// Effective configuration - /// groups. - public EffectiveConnectivityConfiguration(string connectivityTopology, IList appliesToGroups, string id = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), string resourceGuid = default(string), IList configurationGroups = default(IList)) + /// Possible values include: 'HubAndSpoke', 'Mesh' + + /// Flag if global mesh is supported. + /// Possible values include: 'False', 'True' + + /// The provisioning state of the connectivity configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the connectivity configuration. + /// + + /// List of hubItems + /// + + /// Groups for configuration + /// + + /// Flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + + /// Unique identifier for this resource. + /// + public EffectiveConnectivityConfiguration(string id = default(string), System.Collections.Generic.IList configurationGroups = default(System.Collections.Generic.IList), string connectivityTopology = default(string), string isGlobal = default(string), string provisioningState = default(string), string description = default(string), System.Collections.Generic.IList hubs = default(System.Collections.Generic.IList), System.Collections.Generic.IList appliesToGroups = default(System.Collections.Generic.IList), string deleteExistingPeering = default(string), string resourceGuid = default(string)) + { - Id = id; - Description = description; - ConnectivityTopology = connectivityTopology; - Hubs = hubs; - IsGlobal = isGlobal; - AppliesToGroups = appliesToGroups; - ProvisioningState = provisioningState; - DeleteExistingPeering = deleteExistingPeering; - ResourceGuid = resourceGuid; - ConfigurationGroups = configurationGroups; + this.Id = id; + this.ConfigurationGroups = configurationGroups; + this.ConnectivityTopology = connectivityTopology; + this.IsGlobal = isGlobal; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Hubs = hubs; + this.AppliesToGroups = appliesToGroups; + this.DeleteExistingPeering = deleteExistingPeering; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -74,97 +75,65 @@ public EffectiveConnectivityConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets connectivity configuration ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } /// - /// Gets or sets a description of the connectivity configuration. + /// Gets or sets connectivity configuration ID. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets connectivity topology type. Possible values include: - /// 'HubAndSpoke', 'Mesh' + /// Gets or sets effective configuration groups. /// - [JsonProperty(PropertyName = "properties.connectivityTopology")] - public string ConnectivityTopology { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationGroups")] + public System.Collections.Generic.IList ConfigurationGroups {get; set; } /// - /// Gets or sets list of hubItems + /// Gets or sets connectivity topology type. Possible values include: 'HubAndSpoke', 'Mesh' /// - [JsonProperty(PropertyName = "properties.hubs")] - public IList Hubs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectivityTopology")] + public string ConnectivityTopology {get; set; } /// - /// Gets or sets flag if global mesh is supported. Possible values - /// include: 'False', 'True' + /// Gets or sets flag if global mesh is supported. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "properties.isGlobal")] - public string IsGlobal { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isGlobal")] + public string IsGlobal {get; set; } /// - /// Gets or sets groups for configuration + /// Gets the provisioning state of the connectivity configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.appliesToGroups")] - public IList AppliesToGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the connectivity configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets a description of the connectivity configuration. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets flag if need to remove current existing peerings. - /// Possible values include: 'False', 'True' + /// Gets or sets list of hubItems /// - [JsonProperty(PropertyName = "properties.deleteExistingPeering")] - public string DeleteExistingPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hubs")] + public System.Collections.Generic.IList Hubs {get; set; } /// - /// Gets unique identifier for this resource. + /// Gets or sets groups for configuration /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.appliesToGroups")] + public System.Collections.Generic.IList AppliesToGroups {get; set; } /// - /// Gets or sets effective configuration groups. + /// Gets or sets flag if need to remove current existing peerings. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "configurationGroups")] - public IList ConfigurationGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteExistingPeering")] + public string DeleteExistingPeering {get; set; } /// - /// Validate the object. + /// Gets unique identifier for this resource. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectivityTopology == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); - } - if (AppliesToGroups == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppliesToGroups"); - } - if (AppliesToGroups != null) - { - foreach (var element in AppliesToGroups) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveDefaultSecurityAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveDefaultSecurityAdminRule.cs index 18aa8b04253d..e58cf8438352 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveDefaultSecurityAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveDefaultSecurityAdminRule.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network default admin rule. /// [Newtonsoft.Json.JsonObject("Default")] - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class EffectiveDefaultSecurityAdminRule : EffectiveBaseSecurityAdminRule { /// - /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule - /// class. + /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule class. /// public EffectiveDefaultSecurityAdminRule() { @@ -34,59 +23,77 @@ public EffectiveDefaultSecurityAdminRule() } /// - /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule - /// class. + /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule class. /// - /// Resource ID. - /// A description of the - /// security admin configuration. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A description for this rule. Restricted - /// to 140 chars. - /// Default rule flag. + + /// Resource ID. + /// + + /// A description of the security admin configuration. + /// + + /// A description of the rule collection. + /// + + /// Groups for rule collection + /// + + /// Effective configuration groups. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Default rule flag. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// The CIDR or source IP ranges. - /// The destination address prefixes. CIDR - /// or destination IP ranges. - /// The source port ranges. - /// The destination port - /// ranges. - /// Indicates the access allowed for this - /// particular rule. Possible values include: 'Allow', 'Deny', - /// 'AlwaysAllow' - /// The priority of the rule. The value can be - /// between 1 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. - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public EffectiveDefaultSecurityAdminRule(string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string), string resourceGuid = default(string)) - : base(id, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// Unique identifier for this resource. + /// + public EffectiveDefaultSecurityAdminRule(string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), System.Collections.Generic.IList ruleCollectionAppliesToGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList), string provisioningState = default(string), string description = default(string), string flag = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string resourceGuid = default(string)) + + : base(id, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) { - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Flag = flag; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -95,84 +102,80 @@ public EffectiveDefaultSecurityAdminRule() /// partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; private set; } /// /// Gets or sets default rule flag. /// - [JsonProperty(PropertyName = "properties.flag")] - public string Flag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flag")] + public string Flag {get; set; } /// - /// Gets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// Gets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; private set; } /// /// Gets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sources")] + public System.Collections.Generic.IList Sources {get; private set; } /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. + /// Gets the destination address prefixes. CIDR or destination IP ranges. /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinations")] + public System.Collections.Generic.IList Destinations {get; private set; } /// /// Gets the source port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; private set; } /// /// Gets the destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; private set; } - - /// - /// Gets indicates the access allowed for this particular rule. - /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' - /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; private set; } /// - /// Gets the priority of the rule. The value can be between 1 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. + /// Gets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; private set; } /// - /// Gets indicates if the traffic matched against the rule in inbound - /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// Gets the priority of the rule. The value can be between 1 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. /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets indicates if the traffic matched against the rule in inbound or + /// outbound. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; private set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroup.cs index f72dbcf66bdb..4da23265d523 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroup.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class EffectiveNetworkSecurityGroup { /// - /// Initializes a new instance of the EffectiveNetworkSecurityGroup - /// class. + /// Initializes a new instance of the EffectiveNetworkSecurityGroup class. /// public EffectiveNetworkSecurityGroup() { @@ -30,22 +21,27 @@ public EffectiveNetworkSecurityGroup() } /// - /// Initializes a new instance of the EffectiveNetworkSecurityGroup - /// class. + /// Initializes a new instance of the EffectiveNetworkSecurityGroup class. /// - /// The ID of network security group - /// that is applied. - /// Associated resources. - /// A collection of effective - /// security rules. - /// Mapping of tags to list of IP Addresses - /// included within the tag. - public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), IList effectiveSecurityRules = default(IList), IDictionary> tagMap = default(IDictionary>)) + + /// The ID of network security group that is applied. + /// + + /// Associated resources. + /// + + /// A collection of effective security rules. + /// + + /// Mapping of tags to list of IP Addresses included within the tag. + /// + public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), System.Collections.Generic.IList effectiveSecurityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary> tagMap = default(System.Collections.Generic.IDictionary>)) + { - NetworkSecurityGroup = networkSecurityGroup; - Association = association; - EffectiveSecurityRules = effectiveSecurityRules; - TagMap = tagMap; + this.NetworkSecurityGroup = networkSecurityGroup; + this.Association = association; + this.EffectiveSecurityRules = effectiveSecurityRules; + this.TagMap = tagMap; CustomInit(); } @@ -54,30 +50,30 @@ public EffectiveNetworkSecurityGroup() /// partial void CustomInit(); + /// /// Gets or sets the ID of network security group that is applied. /// - [JsonProperty(PropertyName = "networkSecurityGroup")] - public SubResource NetworkSecurityGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } /// /// Gets or sets associated resources. /// - [JsonProperty(PropertyName = "association")] - public EffectiveNetworkSecurityGroupAssociation Association { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "association")] + public EffectiveNetworkSecurityGroupAssociation Association {get; set; } /// /// Gets or sets a collection of effective security rules. /// - [JsonProperty(PropertyName = "effectiveSecurityRules")] - public IList EffectiveSecurityRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "effectiveSecurityRules")] + public System.Collections.Generic.IList EffectiveSecurityRules {get; set; } /// - /// Gets or sets mapping of tags to list of IP Addresses included - /// within the tag. + /// Gets or sets mapping of tags to list of IP Addresses included within the + /// tag. /// - [JsonProperty(PropertyName = "tagMap")] - public IDictionary> TagMap { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tagMap")] + public System.Collections.Generic.IDictionary> TagMap {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 69143cd10cdb..baecbb87924e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class EffectiveNetworkSecurityGroupAssociation { /// - /// Initializes a new instance of the - /// EffectiveNetworkSecurityGroupAssociation class. + /// Initializes a new instance of the EffectiveNetworkSecurityGroupAssociation class. /// public EffectiveNetworkSecurityGroupAssociation() { @@ -28,19 +21,23 @@ public EffectiveNetworkSecurityGroupAssociation() } /// - /// Initializes a new instance of the - /// EffectiveNetworkSecurityGroupAssociation class. + /// Initializes a new instance of the EffectiveNetworkSecurityGroupAssociation class. /// - /// The ID of the Azure network manager if - /// assigned. - /// The ID of the subnet if assigned. - /// The ID of the network interface if - /// assigned. + + /// The ID of the Azure network manager if assigned. + /// + + /// The ID of the subnet if assigned. + /// + + /// The ID of the network interface if assigned. + /// public EffectiveNetworkSecurityGroupAssociation(SubResource networkManager = default(SubResource), SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) + { - NetworkManager = networkManager; - Subnet = subnet; - NetworkInterface = networkInterface; + this.NetworkManager = networkManager; + this.Subnet = subnet; + this.NetworkInterface = networkInterface; CustomInit(); } @@ -49,23 +46,23 @@ public EffectiveNetworkSecurityGroupAssociation() /// partial void CustomInit(); + /// /// Gets or sets the ID of the Azure network manager if assigned. /// - [JsonProperty(PropertyName = "networkManager")] - public SubResource NetworkManager { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkManager")] + public SubResource NetworkManager {get; set; } /// /// Gets or sets the ID of the subnet if assigned. /// - [JsonProperty(PropertyName = "subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } /// /// Gets or sets the ID of the network interface if assigned. /// - [JsonProperty(PropertyName = "networkInterface")] - public SubResource NetworkInterface { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterface")] + public SubResource NetworkInterface {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs index d17af4bb3d0f..f56091142511 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class EffectiveNetworkSecurityGroupListResult { /// - /// Initializes a new instance of the - /// EffectiveNetworkSecurityGroupListResult class. + /// Initializes a new instance of the EffectiveNetworkSecurityGroupListResult class. /// public EffectiveNetworkSecurityGroupListResult() { @@ -30,17 +21,19 @@ public EffectiveNetworkSecurityGroupListResult() } /// - /// Initializes a new instance of the - /// EffectiveNetworkSecurityGroupListResult class. + /// Initializes a new instance of the EffectiveNetworkSecurityGroupListResult class. /// - /// A list of effective network security - /// groups. - /// The URL to get the next set of - /// results. - public EffectiveNetworkSecurityGroupListResult(IList value = default(IList), string nextLink = default(string)) + + /// A list of effective network security groups. + /// + + /// The URL to get the next set of results. + /// + public EffectiveNetworkSecurityGroupListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +42,17 @@ public EffectiveNetworkSecurityGroupListResult() /// partial void CustomInit(); + /// /// Gets or sets a list of effective network security groups. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityRule.cs index 7e25fa2ff5f1..68924b2de7c7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveNetworkSecurityRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class EffectiveNetworkSecurityRule { /// - /// Initializes a new instance of the EffectiveNetworkSecurityRule - /// class. + /// Initializes a new instance of the EffectiveNetworkSecurityRule class. /// public EffectiveNetworkSecurityRule() { @@ -30,61 +21,80 @@ public EffectiveNetworkSecurityRule() } /// - /// Initializes a new instance of the EffectiveNetworkSecurityRule - /// class. + /// Initializes a new instance of the EffectiveNetworkSecurityRule class. /// - /// The name of the security rule specified by the - /// user (if created by the user). + + /// The name of the security rule specified by the user (if created by the + /// user). + /// + /// The network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'All' - /// The source port or range. - /// The destination port or - /// range. - /// The source port ranges. Expected - /// values include a single integer between 0 and 65535, a range using - /// '-' as separator (e.g. 100-400), or an asterisk (*). - /// The destination port ranges. - /// Expected values include a single integer between 0 and 65535, a - /// range using '-' as separator (e.g. 100-400), or an asterisk - /// (*). - /// The source address - /// prefix. - /// The destination address - /// prefix. - /// The source address prefixes. - /// Expected values include CIDR IP ranges, Default Tags - /// (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the - /// asterisk (*). - /// The destination address - /// prefixes. Expected values include CIDR IP ranges, Default Tags - /// (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the - /// asterisk (*). - /// The expanded source - /// address prefix. - /// Expanded destination - /// address prefix. + /// Possible values include: 'Tcp', 'Udp', 'All' + + /// The source port or range. + /// + + /// The destination port or range. + /// + + /// The source port ranges. Expected values include a single integer between 0 + /// and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk + /// (*). + /// + + /// The destination port ranges. Expected values include a single integer + /// between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an + /// asterisk (*). + /// + + /// The source address prefix. + /// + + /// The destination address prefix. + /// + + /// The source address prefixes. Expected values include CIDR IP ranges, + /// Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, + /// and the asterisk (*). + /// + + /// The destination address prefixes. Expected values include CIDR IP ranges, + /// Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, + /// and the asterisk (*). + /// + + /// The expanded source address prefix. + /// + + /// Expanded destination address prefix. + /// + /// Whether network traffic is allowed or denied. - /// Possible values include: 'Allow', 'Deny' - /// The priority of the rule. - /// The direction of the rule. Possible values - /// include: 'Inbound', 'Outbound' - public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), IList sourceAddressPrefixes = default(IList), IList destinationAddressPrefixes = default(IList), IList expandedSourceAddressPrefix = default(IList), IList expandedDestinationAddressPrefix = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string)) + /// Possible values include: 'Allow', 'Deny' + + /// The priority of the rule. + /// + + /// The direction of the rule. + /// Possible values include: 'Inbound', 'Outbound' + public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), System.Collections.Generic.IList sourceAddressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList expandedSourceAddressPrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList expandedDestinationAddressPrefix = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string)) + { - Name = name; - Protocol = protocol; - SourcePortRange = sourcePortRange; - DestinationPortRange = destinationPortRange; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - SourceAddressPrefix = sourceAddressPrefix; - DestinationAddressPrefix = destinationAddressPrefix; - SourceAddressPrefixes = sourceAddressPrefixes; - DestinationAddressPrefixes = destinationAddressPrefixes; - ExpandedSourceAddressPrefix = expandedSourceAddressPrefix; - ExpandedDestinationAddressPrefix = expandedDestinationAddressPrefix; - Access = access; - Priority = priority; - Direction = direction; + this.Name = name; + this.Protocol = protocol; + this.SourcePortRange = sourcePortRange; + this.DestinationPortRange = destinationPortRange; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.SourceAddressPrefix = sourceAddressPrefix; + this.DestinationAddressPrefix = destinationAddressPrefix; + this.SourceAddressPrefixes = sourceAddressPrefixes; + this.DestinationAddressPrefixes = destinationAddressPrefixes; + this.ExpandedSourceAddressPrefix = expandedSourceAddressPrefix; + this.ExpandedDestinationAddressPrefix = expandedDestinationAddressPrefix; + this.Access = access; + this.Priority = priority; + this.Direction = direction; CustomInit(); } @@ -93,107 +103,104 @@ public EffectiveNetworkSecurityRule() /// partial void CustomInit(); + /// - /// Gets or sets the name of the security rule specified by the user - /// (if created by the user). + /// Gets or sets the name of the security rule specified by the user (if + /// created by the user). /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the network protocol this rule applies to. Possible - /// values include: 'Tcp', 'Udp', 'All' + /// Gets or sets the network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'All' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// /// Gets or sets the source port or range. /// - [JsonProperty(PropertyName = "sourcePortRange")] - public string SourcePortRange { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRange")] + public string SourcePortRange {get; set; } /// /// Gets or sets the destination port or range. /// - [JsonProperty(PropertyName = "destinationPortRange")] - public string DestinationPortRange { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRange")] + public string DestinationPortRange {get; set; } /// - /// Gets or sets the source port ranges. Expected values include a - /// single integer between 0 and 65535, a range using '-' as separator - /// (e.g. 100-400), or an asterisk (*). + /// Gets or sets the source port ranges. Expected values include a single + /// integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), + /// or an asterisk (*). /// - [JsonProperty(PropertyName = "sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// - /// Gets or sets the destination port ranges. Expected values include a - /// single integer between 0 and 65535, a range using '-' as separator - /// (e.g. 100-400), or an asterisk (*). + /// Gets or sets the destination port ranges. Expected values include a single + /// integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), + /// or an asterisk (*). /// - [JsonProperty(PropertyName = "destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// /// Gets or sets the source address prefix. /// - [JsonProperty(PropertyName = "sourceAddressPrefix")] - public string SourceAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefix")] + public string SourceAddressPrefix {get; set; } /// /// Gets or sets the destination address prefix. /// - [JsonProperty(PropertyName = "destinationAddressPrefix")] - public string DestinationAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddressPrefix")] + public string DestinationAddressPrefix {get; set; } /// - /// Gets or sets the source address prefixes. Expected values include - /// CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, - /// Internet), System Tags, and the asterisk (*). + /// Gets or sets the source address prefixes. Expected values include CIDR IP + /// ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System + /// Tags, and the asterisk (*). /// - [JsonProperty(PropertyName = "sourceAddressPrefixes")] - public IList SourceAddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefixes")] + public System.Collections.Generic.IList SourceAddressPrefixes {get; set; } /// - /// Gets or sets the destination address prefixes. Expected values - /// include CIDR IP ranges, Default Tags (VirtualNetwork, - /// AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + /// Gets or sets the destination address prefixes. Expected values include CIDR + /// IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), + /// System Tags, and the asterisk (*). /// - [JsonProperty(PropertyName = "destinationAddressPrefixes")] - public IList DestinationAddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddressPrefixes")] + public System.Collections.Generic.IList DestinationAddressPrefixes {get; set; } /// /// Gets or sets the expanded source address prefix. /// - [JsonProperty(PropertyName = "expandedSourceAddressPrefix")] - public IList ExpandedSourceAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "expandedSourceAddressPrefix")] + public System.Collections.Generic.IList ExpandedSourceAddressPrefix {get; set; } /// /// Gets or sets expanded destination address prefix. /// - [JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] - public IList ExpandedDestinationAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] + public System.Collections.Generic.IList ExpandedDestinationAddressPrefix {get; set; } /// - /// Gets or sets whether network traffic is allowed or denied. Possible - /// values include: 'Allow', 'Deny' + /// Gets or sets whether network traffic is allowed or denied. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; set; } /// /// Gets or sets the priority of the rule. /// - [JsonProperty(PropertyName = "priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } /// - /// Gets or sets the direction of the rule. Possible values include: - /// 'Inbound', 'Outbound' + /// Gets or sets the direction of the rule. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "direction")] - public string Direction { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public string Direction {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoute.cs index 4d6d5c325397..16c28970e10f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoute.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,32 +23,40 @@ public EffectiveRoute() /// /// Initializes a new instance of the EffectiveRoute class. /// - /// The name of the user defined route. This is - /// optional. - /// If true, on-premises - /// routes are not propagated to the network interfaces in the - /// subnet. - /// Who created the route. Possible values - /// include: 'Unknown', 'User', 'VirtualNetworkGateway', - /// 'Default' - /// The value of effective route. Possible values - /// include: 'Active', 'Invalid' - /// The address prefixes of the effective - /// routes in CIDR notation. - /// The IP address of the next hop of - /// the effective route. - /// The type of Azure hop the packet should - /// be sent to. Possible values include: 'VirtualNetworkGateway', - /// 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' - public EffectiveRoute(string name = default(string), bool? disableBgpRoutePropagation = default(bool?), string source = default(string), string state = default(string), IList addressPrefix = default(IList), IList nextHopIpAddress = default(IList), string nextHopType = default(string)) + + /// The name of the user defined route. This is optional. + /// + + /// If true, on-premises routes are not propagated to the network interfaces in + /// the subnet. + /// + + /// Who created the route. + /// Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', + /// 'Default' + + /// The value of effective route. + /// Possible values include: 'Active', 'Invalid' + + /// The address prefixes of the effective routes in CIDR notation. + /// + + /// The IP address of the next hop of the effective route. + /// + + /// The type of Azure hop the packet should be sent to. + /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' + public EffectiveRoute(string name = default(string), bool? disableBgpRoutePropagation = default(bool?), string source = default(string), string state = default(string), System.Collections.Generic.IList addressPrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList nextHopIPAddress = default(System.Collections.Generic.IList), string nextHopType = default(string)) + { - Name = name; - DisableBgpRoutePropagation = disableBgpRoutePropagation; - Source = source; - State = state; - AddressPrefix = addressPrefix; - NextHopIpAddress = nextHopIpAddress; - NextHopType = nextHopType; + this.Name = name; + this.DisableBgpRoutePropagation = disableBgpRoutePropagation; + this.Source = source; + this.State = state; + this.AddressPrefix = addressPrefix; + this.NextHopIPAddress = nextHopIPAddress; + this.NextHopType = nextHopType; CustomInit(); } @@ -65,53 +65,48 @@ public EffectiveRoute() /// partial void CustomInit(); + /// /// Gets or sets the name of the user defined route. This is optional. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets if true, on-premises routes are not propagated to the - /// network interfaces in the subnet. + /// Gets or sets if true, on-premises routes are not propagated to the network + /// interfaces in the subnet. /// - [JsonProperty(PropertyName = "disableBgpRoutePropagation")] - public bool? DisableBgpRoutePropagation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disableBgpRoutePropagation")] + public bool? DisableBgpRoutePropagation {get; set; } /// - /// Gets or sets who created the route. Possible values include: - /// 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + /// Gets or sets who created the route. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' /// - [JsonProperty(PropertyName = "source")] - public string Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public string Source {get; set; } /// - /// Gets or sets the value of effective route. Possible values include: - /// 'Active', 'Invalid' + /// Gets or sets the value of effective route. Possible values include: 'Active', 'Invalid' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// - /// Gets or sets the address prefixes of the effective routes in CIDR - /// notation. + /// Gets or sets the address prefixes of the effective routes in CIDR notation. /// - [JsonProperty(PropertyName = "addressPrefix")] - public IList AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public System.Collections.Generic.IList AddressPrefix {get; set; } /// /// Gets or sets the IP address of the next hop of the effective route. /// - [JsonProperty(PropertyName = "nextHopIpAddress")] - public IList NextHopIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] + public System.Collections.Generic.IList NextHopIPAddress {get; set; } /// - /// Gets or sets the type of Azure hop the packet should be sent to. - /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', - /// 'Internet', 'VirtualAppliance', 'None' + /// Gets or sets the type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' /// - [JsonProperty(PropertyName = "nextHopType")] - public string NextHopType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + public string NextHopType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteListResult.cs index ee0a212e965f..29806ca61421 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public EffectiveRouteListResult() /// /// Initializes a new instance of the EffectiveRouteListResult class. /// - /// A list of effective routes. - /// The URL to get the next set of - /// results. - public EffectiveRouteListResult(IList value = default(IList), string nextLink = default(string)) + + /// A list of effective routes. + /// + + /// The URL to get the next set of results. + /// + public EffectiveRouteListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -46,17 +42,17 @@ public EffectiveRouteListResult() /// partial void CustomInit(); + /// /// Gets or sets a list of effective routes. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRoute.cs index c9270c480209..d5f2bb39fcd7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRoute.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public EffectiveRouteMapRoute() /// /// Initializes a new instance of the EffectiveRouteMapRoute class. /// - /// The address prefix of the route. - /// BGP communities of the route. - /// The ASPath of this route. + + /// The address prefix of the route. + /// + + /// BGP communities of the route. + /// + + /// The ASPath of this route. + /// public EffectiveRouteMapRoute(string prefix = default(string), string bgpCommunities = default(string), string asPath = default(string)) + { - Prefix = prefix; - BgpCommunities = bgpCommunities; - AsPath = asPath; + this.Prefix = prefix; + this.BgpCommunities = bgpCommunities; + this.AsPath = asPath; CustomInit(); } @@ -45,23 +46,23 @@ public EffectiveRouteMapRoute() /// partial void CustomInit(); + /// /// Gets or sets the address prefix of the route. /// - [JsonProperty(PropertyName = "prefix")] - public string Prefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "prefix")] + public string Prefix {get; set; } /// - /// Gets or sets BGP communities of the route. + /// Gets or sets bGP communities of the route. /// - [JsonProperty(PropertyName = "bgpCommunities")] - public string BgpCommunities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpCommunities")] + public string BgpCommunities {get; set; } /// /// Gets or sets the ASPath of this route. /// - [JsonProperty(PropertyName = "asPath")] - public string AsPath { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "asPath")] + public string AsPath {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRouteList.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRouteList.cs index de9b4ccd18a0..901157a647ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRouteList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteMapRouteList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,14 @@ public EffectiveRouteMapRouteList() /// /// Initializes a new instance of the EffectiveRouteMapRouteList class. /// - /// The list of Effective RouteMap Routes - /// configured on the connection resource. - public EffectiveRouteMapRouteList(IList value = default(IList)) + + /// The list of Effective RouteMap Routes configured on the connection + /// resource. + /// + public EffectiveRouteMapRouteList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -44,12 +39,12 @@ public EffectiveRouteMapRouteList() /// partial void CustomInit(); + /// - /// Gets or sets the list of Effective RouteMap Routes configured on - /// the connection resource. + /// Gets or sets the list of Effective RouteMap Routes configured on the + /// connection resource. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteSource.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteSource.cs index a9433a4cc5d8..d7c1c1ad1a1b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteSource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteSource.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for EffectiveRouteSource. /// + + public static class EffectiveRouteSource { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class EffectiveRouteSource public const string VirtualNetworkGateway = "VirtualNetworkGateway"; public const string Default = "Default"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteState.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteState.cs index a38e596d3240..e8d9c485dcce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRouteState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for EffectiveRouteState. /// + + public static class EffectiveRouteState { public const string Active = "Active"; public const string Invalid = "Invalid"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoutesParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoutesParameters.cs index 5d909dbbcce0..d1602515f612 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoutesParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveRoutesParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,16 +24,18 @@ public EffectiveRoutesParameters() /// /// Initializes a new instance of the EffectiveRoutesParameters class. /// - /// The resource whose effective routes are - /// being requested. - /// The type of the specified - /// resource like RouteTable, ExpressRouteConnection, - /// HubVirtualNetworkConnection, VpnConnection and - /// P2SConnection. + + /// The resource whose effective routes are being requested. + /// + + /// The type of the specified resource like RouteTable, ExpressRouteConnection, + /// HubVirtualNetworkConnection, VpnConnection and P2SConnection. + /// public EffectiveRoutesParameters(string resourceId = default(string), string virtualWanResourceType = default(string)) + { - ResourceId = resourceId; - VirtualWanResourceType = virtualWanResourceType; + this.ResourceId = resourceId; + this.VirtualWanResourceType = virtualWanResourceType; CustomInit(); } @@ -48,20 +44,19 @@ public EffectiveRoutesParameters() /// partial void CustomInit(); + /// - /// Gets or sets the resource whose effective routes are being - /// requested. + /// Gets or sets the resource whose effective routes are being requested. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the type of the specified resource like RouteTable, - /// ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection - /// and P2SConnection. + /// ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + /// P2SConnection. /// - [JsonProperty(PropertyName = "virtualWanResourceType")] - public string VirtualWanResourceType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualWanResourceType")] + public string VirtualWanResourceType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityAdminRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityAdminRule.cs index 716d7e11c630..279c8ae6ff89 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityAdminRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityAdminRule.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network admin rule. /// [Newtonsoft.Json.JsonObject("Custom")] - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class EffectiveSecurityAdminRule : EffectiveBaseSecurityAdminRule { /// @@ -35,54 +25,71 @@ public EffectiveSecurityAdminRule() /// /// Initializes a new instance of the EffectiveSecurityAdminRule class. /// + + /// Resource ID. + /// + + /// A description of the security admin configuration. + /// + + /// A description of the rule collection. + /// + + /// Groups for rule collection + /// + + /// Effective configuration groups. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// Indicates the access allowed for this - /// particular rule. Possible values include: 'Allow', 'Deny', - /// 'AlwaysAllow' - /// The priority of the rule. The value can be - /// between 1 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. - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// Resource ID. - /// A description of the - /// security admin configuration. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A description for this rule. Restricted - /// to 140 chars. - /// The CIDR or source IP ranges. - /// The destination address prefixes. CIDR - /// or destination IP ranges. - /// The source port ranges. - /// The destination port - /// ranges. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - public EffectiveSecurityAdminRule(string protocol, string access, int priority, string direction, string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string), string resourceGuid = default(string)) - : base(id, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + + /// The CIDR or source IP ranges. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// Indicates the access allowed for this particular rule + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + + /// The priority of the rule. The value can be between 1 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. + /// + + /// Indicates if the traffic matched against the rule in inbound or outbound. + /// Possible values include: 'Inbound', 'Outbound' + + /// Unique identifier for this resource. + /// + public EffectiveSecurityAdminRule(string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), System.Collections.Generic.IList ruleCollectionAppliesToGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList), string provisioningState = default(string), string description = default(string), string protocol = default(string), System.Collections.Generic.IList sources = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string), string resourceGuid = default(string)) + + : base(id, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) { - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Protocol = protocol; + this.Sources = sources; + this.Destinations = destinations; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -91,108 +98,105 @@ public EffectiveSecurityAdminRule() /// partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// Gets or sets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// /// Gets or sets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sources")] + public System.Collections.Generic.IList Sources {get; set; } /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. + /// Gets or sets the destination address prefixes. CIDR or destination IP + /// ranges. /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Gets or sets the source port ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// /// Gets or sets the destination port ranges. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// - /// Gets or sets indicates the access allowed for this particular rule. - /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// Gets or sets indicates the access allowed for this particular rule Possible values include: 'Allow', 'Deny', 'AlwaysAllow' /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; set; } /// - /// Gets or sets the priority of the rule. The value can be between 1 - /// 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. + /// Gets or sets the priority of the rule. The value can be between 1 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. /// - [JsonProperty(PropertyName = "properties.priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets indicates if the traffic matched against the rule in - /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// Gets or sets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; set; } - - /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; set; } /// /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - if (Access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); - } - if (Direction == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); - } - if (Priority > 4096) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 4096); - } - if (Priority < 1) + + + + + + + + + if (this.Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + if (this.Priority > 4096) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (this.Priority < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 1); + } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityRuleProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityRuleProtocol.cs index 925dcec4a99f..d453b5fccc05 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityRuleProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EffectiveSecurityRuleProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for EffectiveSecurityRuleProtocol. /// + + public static class EffectiveSecurityRuleProtocol { public const string Tcp = "Tcp"; public const string Udp = "Udp"; public const string All = "All"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EndpointServiceResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/EndpointServiceResult.cs index 18bd26b20ad2..925eea1a9f02 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EndpointServiceResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EndpointServiceResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public EndpointServiceResult() /// /// Initializes a new instance of the EndpointServiceResult class. /// - /// Resource ID. - /// Name of the endpoint service. - /// Type of the endpoint service. + + /// Resource ID. + /// + + /// Name of the endpoint service. + /// + + /// Type of the endpoint service. + /// public EndpointServiceResult(string id = default(string), string name = default(string), string type = default(string)) - : base(id) + + : base(id) { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -45,17 +46,17 @@ public EndpointServiceResult() /// partial void CustomInit(); + /// /// Gets name of the endpoint service. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets type of the endpoint service. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EndpointType.cs b/src/Network/Network.Management.Sdk/Generated/Models/EndpointType.cs index afa465a9df97..db661263e71e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EndpointType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EndpointType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for EndpointType. /// + + public static class EndpointType { public const string AzureVM = "AzureVM"; @@ -23,6 +20,6 @@ public static class EndpointType public const string MMAWorkspaceMachine = "MMAWorkspaceMachine"; public const string MMAWorkspaceNetwork = "MMAWorkspaceNetwork"; public const string AzureArcVM = "AzureArcVM"; - public const string AzureVMSS = "AzureVMSS"; + public const string AzureVmss = "AzureVMSS"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Error.cs b/src/Network/Network.Management.Sdk/Generated/Models/Error.cs index 2504e8570db4..a4f079007921 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Error.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Error.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,29 @@ public Error() /// /// Initializes a new instance of the Error class. /// - /// Error code. - /// Error message. - /// Error target. - /// Error details. - /// Inner error message. - public Error(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), string innerError = default(string)) + + /// Error code. + /// + + /// Error message. + /// + + /// Error target. + /// + + /// Error details. + /// + + /// Inner error message. + /// + public Error(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), string innerError = default(string)) + { - Code = code; - Message = message; - Target = target; - Details = details; - InnerError = innerError; + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.InnerError = innerError; CustomInit(); } @@ -51,35 +54,35 @@ public Error() /// partial void CustomInit(); + /// /// Gets or sets error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } /// /// Gets or sets error target. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// /// Gets or sets error details. /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } /// /// Gets or sets inner error message. /// - [JsonProperty(PropertyName = "innerError")] - public string InnerError { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "innerError")] + public string InnerError {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ErrorDetails.cs b/src/Network/Network.Management.Sdk/Generated/Models/ErrorDetails.cs index d3b45eb8e496..74177dc9e6ff 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ErrorDetails.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ErrorDetails.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public ErrorDetails() /// /// Initializes a new instance of the ErrorDetails class. /// - /// Error code. - /// Error target. - /// Error message. + + /// Error code. + /// + + /// Error target. + /// + + /// Error message. + /// public ErrorDetails(string code = default(string), string target = default(string), string message = default(string)) + { - Code = code; - Target = target; - Message = message; + this.Code = code; + this.Target = target; + this.Message = message; CustomInit(); } @@ -45,23 +46,23 @@ public ErrorDetails() /// partial void CustomInit(); + /// /// Gets or sets error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets error target. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// /// Gets or sets error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ErrorException.cs b/src/Network/Network.Management.Sdk/Generated/Models/ErrorException.cs index fd739d2bbe60..b2c82e243ba2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ErrorException.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ErrorException.cs @@ -1,31 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; /// /// Exception thrown for an invalid response with Error information. /// - public partial class ErrorException : RestException + public partial class ErrorException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -40,7 +34,7 @@ public ErrorException() } /// - /// Initializes a new instance of the ErrorException class. + /// Initializes a new instance of the Error class. /// /// The exception message. public ErrorException(string message) @@ -49,7 +43,7 @@ public ErrorException(string message) } /// - /// Initializes a new instance of the ErrorException class. + /// Initializes a new instance of the Error class. /// /// The exception message. /// Inner exception. @@ -58,4 +52,4 @@ public ErrorException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponse.cs index 8d0354d71d92..037f8047e300 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Error + + /// The error details object. + /// public ErrorResponse(ErrorDetails error = default(ErrorDetails)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -41,14 +38,11 @@ public ErrorResponse() /// partial void CustomInit(); + /// - /// Gets or sets error + /// Gets or sets the error details object. /// - /// - /// The error details object. - /// - [JsonProperty(PropertyName = "error")] - public ErrorDetails Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetails Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponseException.cs index 3a2e49202240..bf4b5963d6e6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EvaluatedNetworkSecurityGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/EvaluatedNetworkSecurityGroup.cs index 38ba5bfc647a..55cf5d761366 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EvaluatedNetworkSecurityGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EvaluatedNetworkSecurityGroup.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class EvaluatedNetworkSecurityGroup { /// - /// Initializes a new instance of the EvaluatedNetworkSecurityGroup - /// class. + /// Initializes a new instance of the EvaluatedNetworkSecurityGroup class. /// public EvaluatedNetworkSecurityGroup() { @@ -30,22 +21,27 @@ public EvaluatedNetworkSecurityGroup() } /// - /// Initializes a new instance of the EvaluatedNetworkSecurityGroup - /// class. + /// Initializes a new instance of the EvaluatedNetworkSecurityGroup class. /// - /// Network security group - /// ID. - /// Resource ID of nic or subnet to which - /// network security group is applied. - /// Matched network security rule. - /// List of network security rules - /// evaluation results. - public EvaluatedNetworkSecurityGroup(string networkSecurityGroupId = default(string), string appliedTo = default(string), MatchedRule matchedRule = default(MatchedRule), IList rulesEvaluationResult = default(IList)) + + /// Network security group ID. + /// + + /// Resource ID of nic or subnet to which network security group is applied. + /// + + /// Matched network security rule. + /// + + /// List of network security rules evaluation results. + /// + public EvaluatedNetworkSecurityGroup(string networkSecurityGroupId = default(string), string appliedTo = default(string), MatchedRule matchedRule = default(MatchedRule), System.Collections.Generic.IList rulesEvaluationResult = default(System.Collections.Generic.IList)) + { - NetworkSecurityGroupId = networkSecurityGroupId; - AppliedTo = appliedTo; - MatchedRule = matchedRule; - RulesEvaluationResult = rulesEvaluationResult; + this.NetworkSecurityGroupId = networkSecurityGroupId; + this.AppliedTo = appliedTo; + this.MatchedRule = matchedRule; + this.RulesEvaluationResult = rulesEvaluationResult; CustomInit(); } @@ -54,30 +50,30 @@ public EvaluatedNetworkSecurityGroup() /// partial void CustomInit(); + /// /// Gets or sets network security group ID. /// - [JsonProperty(PropertyName = "networkSecurityGroupId")] - public string NetworkSecurityGroupId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroupId")] + public string NetworkSecurityGroupId {get; set; } /// - /// Gets or sets resource ID of nic or subnet to which network security - /// group is applied. + /// Gets or sets resource ID of nic or subnet to which network security group + /// is applied. /// - [JsonProperty(PropertyName = "appliedTo")] - public string AppliedTo { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "appliedTo")] + public string AppliedTo {get; set; } /// /// Gets or sets matched network security rule. /// - [JsonProperty(PropertyName = "matchedRule")] - public MatchedRule MatchedRule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchedRule")] + public MatchedRule MatchedRule {get; set; } /// /// Gets list of network security rules evaluation results. /// - [JsonProperty(PropertyName = "rulesEvaluationResult")] - public IList RulesEvaluationResult { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rulesEvaluationResult")] + public System.Collections.Generic.IList RulesEvaluationResult {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/EvaluationState.cs b/src/Network/Network.Management.Sdk/Generated/Models/EvaluationState.cs index 0871510b6bb7..13ab7c8bfa98 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/EvaluationState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/EvaluationState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for EvaluationState. /// + + public static class EvaluationState { public const string NotStarted = "NotStarted"; public const string InProgress = "InProgress"; public const string Completed = "Completed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRule.cs index 44c785ebe94d..bc1bbc759371 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRule.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,10 +23,13 @@ public ExclusionManagedRule() /// /// Initializes a new instance of the ExclusionManagedRule class. /// - /// Identifier for the managed rule. + + /// Identifier for the managed rule. + /// public ExclusionManagedRule(string ruleId) + { - RuleId = ruleId; + this.RuleId = ruleId; CustomInit(); } @@ -42,24 +38,25 @@ public ExclusionManagedRule(string ruleId) /// partial void CustomInit(); + /// /// Gets or sets identifier for the managed rule. /// - [JsonProperty(PropertyName = "ruleId")] - public string RuleId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleId")] + public string RuleId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleId == null) + if (this.RuleId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleId"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleGroup.cs index 7155f79dfb6a..a4e2f6ce2146 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleGroup.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,14 +23,18 @@ public ExclusionManagedRuleGroup() /// /// Initializes a new instance of the ExclusionManagedRuleGroup class. /// - /// The managed rule group for - /// exclusion. - /// List of rules that will be excluded. If none - /// specified, all rules in the group will be excluded. - public ExclusionManagedRuleGroup(string ruleGroupName, IList rules = default(IList)) + + /// The managed rule group for exclusion. + /// + + /// List of rules that will be excluded. If none specified, all rules in the + /// group will be excluded. + /// + public ExclusionManagedRuleGroup(string ruleGroupName, System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + { - RuleGroupName = ruleGroupName; - Rules = rules; + this.RuleGroupName = ruleGroupName; + this.Rules = rules; CustomInit(); } @@ -48,34 +43,35 @@ public ExclusionManagedRuleGroup() /// partial void CustomInit(); + /// /// Gets or sets the managed rule group for exclusion. /// - [JsonProperty(PropertyName = "ruleGroupName")] - public string RuleGroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroupName")] + public string RuleGroupName {get; set; } /// - /// Gets or sets list of rules that will be excluded. If none - /// specified, all rules in the group will be excluded. + /// Gets or sets list of rules that will be excluded. If none specified, all + /// rules in the group will be excluded. /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleGroupName == null) + if (this.RuleGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleGroupName"); } - if (Rules != null) + + if (this.Rules != null) { - foreach (var element in Rules) + foreach (var element in this.Rules) { if (element != null) { @@ -85,4 +81,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleSet.cs index 827a42b1b747..c33babafa52c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExclusionManagedRuleSet.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,16 +23,21 @@ public ExclusionManagedRuleSet() /// /// Initializes a new instance of the ExclusionManagedRuleSet class. /// - /// Defines the rule set type to use. - /// Defines the version of the rule set to - /// use. - /// Defines the rule groups to apply to the - /// rule set. - public ExclusionManagedRuleSet(string ruleSetType, string ruleSetVersion, IList ruleGroups = default(IList)) + + /// Defines the rule set type to use. + /// + + /// Defines the version of the rule set to use. + /// + + /// Defines the rule groups to apply to the rule set. + /// + public ExclusionManagedRuleSet(string ruleSetType, string ruleSetVersion, System.Collections.Generic.IList ruleGroups = default(System.Collections.Generic.IList)) + { - RuleSetType = ruleSetType; - RuleSetVersion = ruleSetVersion; - RuleGroups = ruleGroups; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + this.RuleGroups = ruleGroups; CustomInit(); } @@ -50,43 +46,45 @@ public ExclusionManagedRuleSet() /// partial void CustomInit(); + /// /// Gets or sets defines the rule set type to use. /// - [JsonProperty(PropertyName = "ruleSetType")] - public string RuleSetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetType")] + public string RuleSetType {get; set; } /// /// Gets or sets defines the version of the rule set to use. /// - [JsonProperty(PropertyName = "ruleSetVersion")] - public string RuleSetVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetVersion")] + public string RuleSetVersion {get; set; } /// /// Gets or sets defines the rule groups to apply to the rule set. /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroups")] + public System.Collections.Generic.IList RuleGroups {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleSetType == null) + if (this.RuleSetType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetType"); } - if (RuleSetVersion == null) + if (this.RuleSetVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetVersion"); } - if (RuleGroups != null) + + + if (this.RuleGroups != null) { - foreach (var element in RuleGroups) + foreach (var element in this.RuleGroups) { if (element != null) { @@ -96,4 +94,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExplicitProxy.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExplicitProxy.cs index 289e024484b5..f756069e7bbd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExplicitProxy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExplicitProxy.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,25 +23,34 @@ public ExplicitProxy() /// /// Initializes a new instance of the ExplicitProxy class. /// - /// When set to true, explicit proxy - /// mode is enabled. - /// Port number for explicit proxy http - /// protocol, cannot be greater than 64000. - /// Port number for explicit proxy https - /// protocol, cannot be greater than 64000. - /// When set to true, pac file port and url - /// needs to be provided. - /// Port number for firewall to serve PAC - /// file. - /// SAS URL for PAC file. + + /// When set to true, explicit proxy mode is enabled. + /// + + /// Port number for explicit proxy http protocol, cannot be greater than 64000. + /// + + /// Port number for explicit proxy https protocol, cannot be greater than + /// 64000. + /// + + /// When set to true, pac file port and url needs to be provided. + /// + + /// Port number for firewall to serve PAC file. + /// + + /// SAS URL for PAC file. + /// public ExplicitProxy(bool? enableExplicitProxy = default(bool?), int? httpPort = default(int?), int? httpsPort = default(int?), bool? enablePacFile = default(bool?), int? pacFilePort = default(int?), string pacFile = default(string)) + { - EnableExplicitProxy = enableExplicitProxy; - HttpPort = httpPort; - HttpsPort = httpsPort; - EnablePacFile = enablePacFile; - PacFilePort = pacFilePort; - PacFile = pacFile; + this.EnableExplicitProxy = enableExplicitProxy; + this.HttpPort = httpPort; + this.HttpsPort = httpsPort; + this.EnablePacFile = enablePacFile; + this.PacFilePort = pacFilePort; + this.PacFile = pacFile; CustomInit(); } @@ -57,86 +59,86 @@ public ExplicitProxy() /// partial void CustomInit(); + /// /// Gets or sets when set to true, explicit proxy mode is enabled. /// - [JsonProperty(PropertyName = "enableExplicitProxy")] - public bool? EnableExplicitProxy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableExplicitProxy")] + public bool? EnableExplicitProxy {get; set; } /// - /// Gets or sets port number for explicit proxy http protocol, cannot - /// be greater than 64000. + /// Gets or sets port number for explicit proxy http protocol, cannot be + /// greater than 64000. /// - [JsonProperty(PropertyName = "httpPort")] - public int? HttpPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "httpPort")] + public int? HttpPort {get; set; } /// - /// Gets or sets port number for explicit proxy https protocol, cannot - /// be greater than 64000. + /// Gets or sets port number for explicit proxy https protocol, cannot be + /// greater than 64000. /// - [JsonProperty(PropertyName = "httpsPort")] - public int? HttpsPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "httpsPort")] + public int? HttpsPort {get; set; } /// - /// Gets or sets when set to true, pac file port and url needs to be - /// provided. + /// Gets or sets when set to true, pac file port and url needs to be provided. /// - [JsonProperty(PropertyName = "enablePacFile")] - public bool? EnablePacFile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePacFile")] + public bool? EnablePacFile {get; set; } /// /// Gets or sets port number for firewall to serve PAC file. /// - [JsonProperty(PropertyName = "pacFilePort")] - public int? PacFilePort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pacFilePort")] + public int? PacFilePort {get; set; } /// - /// Gets or sets SAS URL for PAC file. + /// Gets or sets sAS URL for PAC file. /// - [JsonProperty(PropertyName = "pacFile")] - public string PacFile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "pacFile")] + public string PacFile {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (HttpPort != null) + if (this.HttpPort != null) { - if (HttpPort > 64000) + if (this.HttpPort > 64000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "HttpPort", 64000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "HttpPort", 64000); } - if (HttpPort < 0) + if (this.HttpPort < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "HttpPort", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "HttpPort", 0); } } - if (HttpsPort != null) + if (this.HttpsPort != null) { - if (HttpsPort > 64000) + if (this.HttpsPort > 64000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "HttpsPort", 64000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "HttpsPort", 64000); } - if (HttpsPort < 0) + if (this.HttpsPort < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "HttpsPort", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "HttpsPort", 0); } } - if (PacFilePort != null) + if (this.PacFilePort != null) { - if (PacFilePort > 64000) + if (this.PacFilePort > 64000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PacFilePort", 64000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PacFilePort", 64000); } - if (PacFilePort < 0) + if (this.PacFilePort < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PacFilePort", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PacFilePort", 0); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuit.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuit.cs index 9412967626b8..98e6f4f9cea4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuit.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuit.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// ExpressRouteCircuit resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuit : Resource { /// @@ -34,66 +24,100 @@ public ExpressRouteCircuit() /// /// Initializes a new instance of the ExpressRouteCircuit class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The SKU. - /// Allow classic - /// operations. - /// The CircuitProvisioningState - /// state of the resource. - /// The - /// ServiceProviderProvisioningState state of the resource. Possible - /// values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - /// 'Deprovisioning' - /// The list of authorizations. - /// The list of peerings. - /// The ServiceKey. - /// The - /// ServiceProviderNotes. - /// The - /// ServiceProviderProperties. - /// The reference to the - /// ExpressRoutePort resource when the circuit is provisioned on an - /// ExpressRoutePort resource. - /// The bandwidth of the circuit when the - /// circuit is provisioned on an ExpressRoutePort resource. - /// The identifier of the circuit traffic. Outer tag - /// for QinQ encapsulation. - /// The provisioning state of the - /// express route circuit resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The GatewayManager Etag. - /// Flag denoting global reach - /// status. - /// The authorizationKey. - /// The authorization status of the - /// Circuit. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), IList authorizations = default(IList), IList peerings = default(IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), SubResource expressRoutePort = default(SubResource), double? bandwidthInGbps = default(double?), int? stag = default(int?), string provisioningState = default(string), string gatewayManagerEtag = default(string), bool? globalReachEnabled = default(bool?), string authorizationKey = default(string), string authorizationStatus = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The SKU. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the express route circuit resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Allow classic operations. + /// + + /// The CircuitProvisioningState state of the resource. + /// + + /// The ServiceProviderProvisioningState state of the resource. + /// Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + /// 'Deprovisioning' + + /// The list of authorizations. + /// + + /// The list of peerings. + /// + + /// The ServiceKey. + /// + + /// The ServiceProviderNotes. + /// + + /// The ServiceProviderProperties. + /// + + /// The reference to the ExpressRoutePort resource when the circuit is + /// provisioned on an ExpressRoutePort resource. + /// + + /// The bandwidth of the circuit when the circuit is provisioned on an + /// ExpressRoutePort resource. + /// + + /// The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + /// + + /// The GatewayManager Etag. + /// + + /// Flag denoting global reach status. + /// + + /// The authorizationKey. + /// + + /// The authorization status of the Circuit. + /// + public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), string etag = default(string), string provisioningState = default(string), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), System.Collections.Generic.IList authorizations = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), SubResource expressRoutePort = default(SubResource), double? bandwidthInGbps = default(double?), int? stag = default(int?), string gatewayManagerEtag = default(string), bool? globalReachEnabled = default(bool?), string authorizationKey = default(string), string authorizationStatus = default(string)) + + : base(id, name, type, location, tags) { - Sku = sku; - AllowClassicOperations = allowClassicOperations; - CircuitProvisioningState = circuitProvisioningState; - ServiceProviderProvisioningState = serviceProviderProvisioningState; - Authorizations = authorizations; - Peerings = peerings; - ServiceKey = serviceKey; - ServiceProviderNotes = serviceProviderNotes; - ServiceProviderProperties = serviceProviderProperties; - ExpressRoutePort = expressRoutePort; - BandwidthInGbps = bandwidthInGbps; - Stag = stag; - ProvisioningState = provisioningState; - GatewayManagerEtag = gatewayManagerEtag; - GlobalReachEnabled = globalReachEnabled; - AuthorizationKey = authorizationKey; - AuthorizationStatus = authorizationStatus; - Etag = etag; + this.Sku = sku; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.AllowClassicOperations = allowClassicOperations; + this.CircuitProvisioningState = circuitProvisioningState; + this.ServiceProviderProvisioningState = serviceProviderProvisioningState; + this.Authorizations = authorizations; + this.Peerings = peerings; + this.ServiceKey = serviceKey; + this.ServiceProviderNotes = serviceProviderNotes; + this.ServiceProviderProperties = serviceProviderProperties; + this.ExpressRoutePort = expressRoutePort; + this.BandwidthInGbps = bandwidthInGbps; + this.Stag = stag; + this.GatewayManagerEtag = gatewayManagerEtag; + this.GlobalReachEnabled = globalReachEnabled; + this.AuthorizationKey = authorizationKey; + this.AuthorizationStatus = authorizationStatus; CustomInit(); } @@ -102,121 +126,117 @@ public ExpressRouteCircuit() /// partial void CustomInit(); + /// /// Gets or sets the SKU. /// - [JsonProperty(PropertyName = "sku")] - public ExpressRouteCircuitSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ExpressRouteCircuitSku Sku {get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the express route circuit resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets allow classic operations. /// - [JsonProperty(PropertyName = "properties.allowClassicOperations")] - public bool? AllowClassicOperations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowClassicOperations")] + public bool? AllowClassicOperations {get; set; } /// /// Gets or sets the CircuitProvisioningState state of the resource. /// - [JsonProperty(PropertyName = "properties.circuitProvisioningState")] - public string CircuitProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuitProvisioningState")] + public string CircuitProvisioningState {get; set; } /// - /// Gets or sets the ServiceProviderProvisioningState state of the - /// resource. Possible values include: 'NotProvisioned', - /// 'Provisioning', 'Provisioned', 'Deprovisioning' + /// Gets or sets the ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' /// - [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] - public string ServiceProviderProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] + public string ServiceProviderProvisioningState {get; set; } /// /// Gets or sets the list of authorizations. /// - [JsonProperty(PropertyName = "properties.authorizations")] - public IList Authorizations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizations")] + public System.Collections.Generic.IList Authorizations {get; set; } /// /// Gets or sets the list of peerings. /// - [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] + public System.Collections.Generic.IList Peerings {get; set; } /// /// Gets or sets the ServiceKey. /// - [JsonProperty(PropertyName = "properties.serviceKey")] - public string ServiceKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceKey")] + public string ServiceKey {get; set; } /// /// Gets or sets the ServiceProviderNotes. /// - [JsonProperty(PropertyName = "properties.serviceProviderNotes")] - public string ServiceProviderNotes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderNotes")] + public string ServiceProviderNotes {get; set; } /// /// Gets or sets the ServiceProviderProperties. /// - [JsonProperty(PropertyName = "properties.serviceProviderProperties")] - public ExpressRouteCircuitServiceProviderProperties ServiceProviderProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProperties")] + public ExpressRouteCircuitServiceProviderProperties ServiceProviderProperties {get; set; } /// - /// Gets or sets the reference to the ExpressRoutePort resource when - /// the circuit is provisioned on an ExpressRoutePort resource. + /// Gets or sets the reference to the ExpressRoutePort resource when the + /// circuit is provisioned on an ExpressRoutePort resource. /// - [JsonProperty(PropertyName = "properties.expressRoutePort")] - public SubResource ExpressRoutePort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRoutePort")] + public SubResource ExpressRoutePort {get; set; } /// - /// Gets or sets the bandwidth of the circuit when the circuit is - /// provisioned on an ExpressRoutePort resource. + /// Gets or sets the bandwidth of the circuit when the circuit is provisioned + /// on an ExpressRoutePort resource. /// - [JsonProperty(PropertyName = "properties.bandwidthInGbps")] - public double? BandwidthInGbps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bandwidthInGbps")] + public double? BandwidthInGbps {get; set; } /// /// Gets the identifier of the circuit traffic. Outer tag for QinQ /// encapsulation. /// - [JsonProperty(PropertyName = "properties.stag")] - public int? Stag { get; private set; } - - /// - /// Gets the provisioning state of the express route circuit resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.stag")] + public int? Stag {get; private set; } /// /// Gets or sets the GatewayManager Etag. /// - [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] - public string GatewayManagerEtag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + public string GatewayManagerEtag {get; set; } /// /// Gets or sets flag denoting global reach status. /// - [JsonProperty(PropertyName = "properties.globalReachEnabled")] - public bool? GlobalReachEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.globalReachEnabled")] + public bool? GlobalReachEnabled {get; set; } /// /// Gets or sets the authorizationKey. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; set; } /// /// Gets the authorization status of the Circuit. /// - [JsonProperty(PropertyName = "properties.authorizationStatus")] - public string AuthorizationStatus { get; private set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationStatus")] + public string AuthorizationStatus {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitArpTable.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitArpTable.cs index ef308f69926f..73e27e545c02 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitArpTable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitArpTable.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitArpTable { /// - /// Initializes a new instance of the ExpressRouteCircuitArpTable - /// class. + /// Initializes a new instance of the ExpressRouteCircuitArpTable class. /// public ExpressRouteCircuitArpTable() { @@ -28,19 +21,27 @@ public ExpressRouteCircuitArpTable() } /// - /// Initializes a new instance of the ExpressRouteCircuitArpTable - /// class. + /// Initializes a new instance of the ExpressRouteCircuitArpTable class. /// - /// Entry age in minutes. - /// Interface address. - /// The IP address. - /// The MAC address. + + /// Entry age in minutes. + /// + + /// Interface address. + /// + + /// The IP address. + /// + + /// The MAC address. + /// public ExpressRouteCircuitArpTable(int? age = default(int?), string interfaceProperty = default(string), string ipAddress = default(string), string macAddress = default(string)) + { - Age = age; - InterfaceProperty = interfaceProperty; - IpAddress = ipAddress; - MacAddress = macAddress; + this.Age = age; + this.InterfaceProperty = interfaceProperty; + this.IPAddress = ipAddress; + this.MacAddress = macAddress; CustomInit(); } @@ -49,29 +50,29 @@ public ExpressRouteCircuitArpTable() /// partial void CustomInit(); + /// /// Gets or sets entry age in minutes. /// - [JsonProperty(PropertyName = "age")] - public int? Age { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "age")] + public int? Age {get; set; } /// /// Gets or sets interface address. /// - [JsonProperty(PropertyName = "interface")] - public string InterfaceProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "interface")] + public string InterfaceProperty {get; set; } /// /// Gets or sets the IP address. /// - [JsonProperty(PropertyName = "ipAddress")] - public string IpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } /// /// Gets or sets the MAC address. /// - [JsonProperty(PropertyName = "macAddress")] - public string MacAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "macAddress")] + public string MacAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitAuthorization.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitAuthorization.cs index ceeeee205138..8d30fb185121 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitAuthorization.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitAuthorization.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Authorization in an ExpressRouteCircuit resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuitAuthorization : SubResource { /// - /// Initializes a new instance of the ExpressRouteCircuitAuthorization - /// class. + /// Initializes a new instance of the ExpressRouteCircuitAuthorization class. /// public ExpressRouteCircuitAuthorization() { @@ -31,31 +22,40 @@ public ExpressRouteCircuitAuthorization() } /// - /// Initializes a new instance of the ExpressRouteCircuitAuthorization - /// class. + /// Initializes a new instance of the ExpressRouteCircuitAuthorization class. /// - /// Resource ID. - /// The authorization key. + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the authorization resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The authorization key. + /// + /// The authorization use status. - /// Possible values include: 'Available', 'InUse' - /// The provisioning state of the - /// authorization resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ExpressRouteCircuitAuthorization(string id = default(string), string authorizationKey = default(string), string authorizationUseStatus = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Possible values include: 'Available', 'InUse' + public ExpressRouteCircuitAuthorization(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string authorizationKey = default(string), string authorizationUseStatus = default(string)) + + : base(id) { - AuthorizationKey = authorizationKey; - AuthorizationUseStatus = authorizationUseStatus; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AuthorizationKey = authorizationKey; + this.AuthorizationUseStatus = authorizationUseStatus; CustomInit(); } @@ -64,45 +64,43 @@ public ExpressRouteCircuitAuthorization() /// partial void CustomInit(); + /// - /// Gets or sets the authorization key. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the authorization use status. Possible values include: - /// 'Available', 'InUse' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.authorizationUseStatus")] - public string AuthorizationUseStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the authorization resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets the provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the authorization key. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; set; } /// - /// Gets type of the resource. + /// Gets or sets the authorization use status. Possible values include: 'Available', 'InUse' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationUseStatus")] + public string AuthorizationUseStatus {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnection.cs index b6fbd0874385..9a48e6f52a77 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnection.cs @@ -1,30 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// - /// Express Route Circuit Connection in an ExpressRouteCircuitPeering - /// resource. + /// Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuitConnection : SubResource { /// - /// Initializes a new instance of the ExpressRouteCircuitConnection - /// class. + /// Initializes a new instance of the ExpressRouteCircuitConnection class. /// public ExpressRouteCircuitConnection() { @@ -32,46 +22,58 @@ public ExpressRouteCircuitConnection() } /// - /// Initializes a new instance of the ExpressRouteCircuitConnection - /// class. + /// Initializes a new instance of the ExpressRouteCircuitConnection class. /// - /// Resource ID. - /// Reference to Express Route - /// Circuit Private Peering Resource of the circuit initiating - /// connection. - /// Reference to Express - /// Route Circuit Private Peering Resource of the peered - /// circuit. - /// /29 IP address space to carve out - /// Customer addresses for tunnels. - /// The authorization key. - /// IPv6 Address - /// PrefixProperties of the express route circuit connection. - /// Express Route Circuit - /// connection state. Possible values include: 'Connected', - /// 'Connecting', 'Disconnected' - /// The provisioning state of the - /// express route circuit connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ExpressRouteCircuitConnection(string id = default(string), SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string authorizationKey = default(string), Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig = default(Ipv6CircuitConnectionConfig), string circuitConnectionStatus = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the express route circuit connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Reference to Express Route Circuit Private Peering Resource of the circuit + /// initiating connection. + /// + + /// Reference to Express Route Circuit Private Peering Resource of the peered + /// circuit. + /// + + /// /29 IP address space to carve out Customer addresses for tunnels. + /// + + /// The authorization key. + /// + + /// IPv6 Address PrefixProperties of the express route circuit connection. + /// + + /// Express Route Circuit connection state. + /// Possible values include: 'Connected', 'Connecting', 'Disconnected' + public ExpressRouteCircuitConnection(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string authorizationKey = default(string), Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig = default(Ipv6CircuitConnectionConfig), string circuitConnectionStatus = default(string)) + + : base(id) { - ExpressRouteCircuitPeering = expressRouteCircuitPeering; - PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; - AddressPrefix = addressPrefix; - AuthorizationKey = authorizationKey; - Ipv6CircuitConnectionConfig = ipv6CircuitConnectionConfig; - CircuitConnectionStatus = circuitConnectionStatus; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.ExpressRouteCircuitPeering = expressRouteCircuitPeering; + this.PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + this.AddressPrefix = addressPrefix; + this.AuthorizationKey = authorizationKey; + this.Ipv6CircuitConnectionConfig = ipv6CircuitConnectionConfig; + this.CircuitConnectionStatus = circuitConnectionStatus; CustomInit(); } @@ -80,74 +82,72 @@ public ExpressRouteCircuitConnection() /// partial void CustomInit(); + /// - /// Gets or sets reference to Express Route Circuit Private Peering - /// Resource of the circuit initiating connection. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] - public SubResource ExpressRouteCircuitPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets reference to Express Route Circuit Private Peering - /// Resource of the peered circuit. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.peerExpressRouteCircuitPeering")] - public SubResource PeerExpressRouteCircuitPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets /29 IP address space to carve out Customer addresses - /// for tunnels. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the authorization key. + /// Gets the provisioning state of the express route circuit connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets iPv6 Address PrefixProperties of the express route - /// circuit connection. + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the circuit initiating connection. /// - [JsonProperty(PropertyName = "properties.ipv6CircuitConnectionConfig")] - public Ipv6CircuitConnectionConfig Ipv6CircuitConnectionConfig { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] + public SubResource ExpressRouteCircuitPeering {get; set; } /// - /// Gets or sets express Route Circuit connection state. Possible - /// values include: 'Connected', 'Connecting', 'Disconnected' + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the peered circuit. /// - [JsonProperty(PropertyName = "properties.circuitConnectionStatus")] - public string CircuitConnectionStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerExpressRouteCircuitPeering")] + public SubResource PeerExpressRouteCircuitPeering {get; set; } /// - /// Gets the provisioning state of the express route circuit connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets /29 IP address space to carve out Customer addresses for + /// tunnels. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the authorization key. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets iPv6 Address PrefixProperties of the express route circuit + /// connection. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipv6CircuitConnectionConfig")] + public Ipv6CircuitConnectionConfig Ipv6CircuitConnectionConfig {get; set; } /// - /// Gets type of the resource. + /// Gets express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuitConnectionStatus")] + public string CircuitConnectionStatus {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnectionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnectionPropertiesFormat.cs new file mode 100644 index 000000000000..8c6bf48e908f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitConnectionPropertiesFormat.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the express route circuit connection. + /// + public partial class ExpressRouteCircuitConnectionPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRouteCircuitConnectionPropertiesFormat class. + /// + public ExpressRouteCircuitConnectionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitConnectionPropertiesFormat class. + /// + + /// Reference to Express Route Circuit Private Peering Resource of the circuit + /// initiating connection. + /// + + /// Reference to Express Route Circuit Private Peering Resource of the peered + /// circuit. + /// + + /// /29 IP address space to carve out Customer addresses for tunnels. + /// + + /// The authorization key. + /// + + /// IPv6 Address PrefixProperties of the express route circuit connection. + /// + + /// Express Route Circuit connection state. + /// Possible values include: 'Connected', 'Connecting', 'Disconnected' + + /// The provisioning state of the express route circuit connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ExpressRouteCircuitConnectionPropertiesFormat(SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string authorizationKey = default(string), Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig = default(Ipv6CircuitConnectionConfig), string circuitConnectionStatus = default(string), string provisioningState = default(string)) + + { + this.ExpressRouteCircuitPeering = expressRouteCircuitPeering; + this.PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + this.AddressPrefix = addressPrefix; + this.AuthorizationKey = authorizationKey; + this.Ipv6CircuitConnectionConfig = ipv6CircuitConnectionConfig; + this.CircuitConnectionStatus = circuitConnectionStatus; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the circuit initiating connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteCircuitPeering")] + public SubResource ExpressRouteCircuitPeering {get; set; } + + /// + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the peered circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerExpressRouteCircuitPeering")] + public SubResource PeerExpressRouteCircuitPeering {get; set; } + + /// + /// Gets or sets /29 IP address space to carve out Customer addresses for + /// tunnels. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } + + /// + /// Gets or sets the authorization key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; set; } + + /// + /// Gets or sets iPv6 Address PrefixProperties of the express route circuit + /// connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipv6CircuitConnectionConfig")] + public Ipv6CircuitConnectionConfig Ipv6CircuitConnectionConfig {get; set; } + + /// + /// Gets express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "circuitConnectionStatus")] + public string CircuitConnectionStatus {get; private set; } + + /// + /// Gets the provisioning state of the express route circuit connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeering.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeering.cs index 5a4692d55c50..01cfd2f889cb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeering.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Peering in an ExpressRouteCircuit resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuitPeering : SubResource { /// @@ -34,75 +24,109 @@ public ExpressRouteCircuitPeering() /// /// Initializes a new instance of the ExpressRouteCircuitPeering class. /// - /// Resource ID. - /// The peering type. Possible values - /// include: 'AzurePublicPeering', 'AzurePrivatePeering', - /// 'MicrosoftPeering' - /// The peering state. Possible values include: - /// 'Disabled', 'Enabled' - /// The Azure ASN. - /// The peer ASN. - /// The primary address - /// prefix. - /// The secondary address - /// prefix. - /// The primary port. - /// The secondary port. - /// The shared key. - /// The VLAN ID. - /// The Microsoft peering - /// configuration. - /// The peering stats of express route - /// circuit. - /// The provisioning state of the - /// express route circuit peering resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The GatewayManager Etag. - /// Who was the last to modify the - /// peering. - /// The reference to the RouteFilter - /// resource. - /// The IPv6 peering - /// configuration. - /// The ExpressRoute - /// connection. - /// The list of circuit connections - /// associated with Azure Private Peering for this circuit. - /// The list of peered circuit - /// connections associated with Azure Private Peering for this - /// circuit. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ExpressRouteCircuitPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), SubResource routeFilter = default(SubResource), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), ExpressRouteConnectionId expressRouteConnection = default(ExpressRouteConnectionId), IList connections = default(IList), IList peeredConnections = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the express route circuit peering resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The peering type. + /// Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + + /// The peering state. + /// Possible values include: 'Disabled', 'Enabled' + + /// The Azure ASN. + /// + + /// The peer ASN. + /// + + /// The primary address prefix. + /// + + /// The secondary address prefix. + /// + + /// The primary port. + /// + + /// The secondary port. + /// + + /// The shared key. + /// + + /// The VLAN ID. + /// + + /// The Microsoft peering configuration. + /// + + /// The peering stats of express route circuit. + /// + + /// The GatewayManager Etag. + /// + + /// Who was the last to modify the peering. + /// + + /// The reference to the RouteFilter resource. + /// + + /// The IPv6 peering configuration. + /// + + /// The ExpressRoute connection. + /// + + /// The list of circuit connections associated with Azure Private Peering for + /// this circuit. + /// + + /// The list of peered circuit connections associated with Azure Private + /// Peering for this circuit. + /// + public ExpressRouteCircuitPeering(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string peeringType = default(string), string state = default(string), int? azureAsn = default(int?), long? peerAsn = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), SubResource routeFilter = default(SubResource), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), ExpressRouteConnectionId expressRouteConnection = default(ExpressRouteConnectionId), System.Collections.Generic.IList connections = default(System.Collections.Generic.IList), System.Collections.Generic.IList peeredConnections = default(System.Collections.Generic.IList)) + + : base(id) { - PeeringType = peeringType; - State = state; - AzureASN = azureASN; - PeerASN = peerASN; - PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; - SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; - PrimaryAzurePort = primaryAzurePort; - SecondaryAzurePort = secondaryAzurePort; - SharedKey = sharedKey; - VlanId = vlanId; - MicrosoftPeeringConfig = microsoftPeeringConfig; - Stats = stats; - ProvisioningState = provisioningState; - GatewayManagerEtag = gatewayManagerEtag; - LastModifiedBy = lastModifiedBy; - RouteFilter = routeFilter; - Ipv6PeeringConfig = ipv6PeeringConfig; - ExpressRouteConnection = expressRouteConnection; - Connections = connections; - PeeredConnections = peeredConnections; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PeeringType = peeringType; + this.State = state; + this.AzureAsn = azureAsn; + this.PeerAsn = peerAsn; + this.PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + this.SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.SharedKey = sharedKey; + this.VlanId = vlanId; + this.MicrosoftPeeringConfig = microsoftPeeringConfig; + this.Stats = stats; + this.GatewayManagerEtag = gatewayManagerEtag; + this.LastModifiedBy = lastModifiedBy; + this.RouteFilter = routeFilter; + this.Ipv6PeeringConfig = ipv6PeeringConfig; + this.ExpressRouteConnection = expressRouteConnection; + this.Connections = connections; + this.PeeredConnections = peeredConnections; CustomInit(); } @@ -111,171 +135,187 @@ public ExpressRouteCircuitPeering() /// partial void CustomInit(); + + /// + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + /// - /// Gets or sets the peering type. Possible values include: - /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.peeringType")] - public string PeeringType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the peering state. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets the provisioning state of the express route circuit peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringType")] + public string PeeringType {get; set; } + + /// + /// Gets or sets the peering state. Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.state")] + public string State {get; set; } /// /// Gets or sets the Azure ASN. /// - [JsonProperty(PropertyName = "properties.azureASN")] - public int? AzureASN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azureASN")] + public int? AzureAsn {get; set; } /// /// Gets or sets the peer ASN. /// - [JsonProperty(PropertyName = "properties.peerASN")] - public long? PeerASN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerASN")] + public long? PeerAsn {get; set; } /// /// Gets or sets the primary address prefix. /// - [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] - public string PrimaryPeerAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix {get; set; } /// /// Gets or sets the secondary address prefix. /// - [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] - public string SecondaryPeerAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix {get; set; } /// /// Gets or sets the primary port. /// - [JsonProperty(PropertyName = "properties.primaryAzurePort")] - public string PrimaryAzurePort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort {get; set; } /// /// Gets or sets the secondary port. /// - [JsonProperty(PropertyName = "properties.secondaryAzurePort")] - public string SecondaryAzurePort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort {get; set; } /// /// Gets or sets the shared key. /// - [JsonProperty(PropertyName = "properties.sharedKey")] - public string SharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey {get; set; } /// /// Gets or sets the VLAN ID. /// - [JsonProperty(PropertyName = "properties.vlanId")] - public int? VlanId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vlanId")] + public int? VlanId {get; set; } /// /// Gets or sets the Microsoft peering configuration. /// - [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] - public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig {get; set; } /// /// Gets or sets the peering stats of express route circuit. /// - [JsonProperty(PropertyName = "properties.stats")] - public ExpressRouteCircuitStats Stats { get; set; } - - /// - /// Gets the provisioning state of the express route circuit peering - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.stats")] + public ExpressRouteCircuitStats Stats {get; set; } /// /// Gets or sets the GatewayManager Etag. /// - [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] - public string GatewayManagerEtag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + public string GatewayManagerEtag {get; set; } /// /// Gets who was the last to modify the peering. /// - [JsonProperty(PropertyName = "properties.lastModifiedBy")] - public string LastModifiedBy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedBy")] + public string LastModifiedBy {get; private set; } /// /// Gets or sets the reference to the RouteFilter resource. /// - [JsonProperty(PropertyName = "properties.routeFilter")] - public SubResource RouteFilter { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeFilter")] + public SubResource RouteFilter {get; set; } /// /// Gets or sets the IPv6 peering configuration. /// - [JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] - public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] + public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig {get; set; } /// /// Gets or sets the ExpressRoute connection. /// - [JsonProperty(PropertyName = "properties.expressRouteConnection")] - public ExpressRouteConnectionId ExpressRouteConnection { get; set; } - - /// - /// Gets or sets the list of circuit connections associated with Azure - /// Private Peering for this circuit. - /// - [JsonProperty(PropertyName = "properties.connections")] - public IList Connections { get; set; } - - /// - /// Gets the list of peered circuit connections associated with Azure - /// Private Peering for this circuit. - /// - [JsonProperty(PropertyName = "properties.peeredConnections")] - public IList PeeredConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteConnection")] + public ExpressRouteConnectionId ExpressRouteConnection {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the list of circuit connections associated with Azure Private + /// Peering for this circuit. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connections")] + public System.Collections.Generic.IList Connections {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the list of peered circuit connections associated with Azure Private + /// Peering for this circuit. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets type of the resource. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeredConnections")] + public System.Collections.Generic.IList PeeredConnections {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PeerASN != null) + + + + + + + if (this.PeerAsn != null) { - if (PeerASN > 4294967295) + if (this.PeerAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); } - if (PeerASN < 1) + if (this.PeerAsn < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 1); } } + + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs index 4db1df40269d..fd409dd9af99 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs @@ -1,20 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for - /// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + /// Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. /// + + public static class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { public const string NotConfigured = "NotConfigured"; @@ -22,4 +18,4 @@ public static class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState public const string Configured = "Configured"; public const string ValidationNeeded = "ValidationNeeded"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringConfig.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringConfig.cs index b75c407d7985..de1fa211d4b6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringConfig.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringConfig.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitPeeringConfig { /// - /// Initializes a new instance of the ExpressRouteCircuitPeeringConfig - /// class. + /// Initializes a new instance of the ExpressRouteCircuitPeeringConfig class. /// public ExpressRouteCircuitPeeringConfig() { @@ -30,29 +21,36 @@ public ExpressRouteCircuitPeeringConfig() } /// - /// Initializes a new instance of the ExpressRouteCircuitPeeringConfig - /// class. + /// Initializes a new instance of the ExpressRouteCircuitPeeringConfig class. /// - /// The reference to - /// AdvertisedPublicPrefixes. - /// The communities of bgp peering. - /// Specified for microsoft peering. - /// The advertised public - /// prefix state of the Peering resource. Possible values include: - /// 'NotConfigured', 'Configuring', 'Configured', - /// 'ValidationNeeded' - /// The legacy mode of the peering. - /// The CustomerASN of the peering. - /// The RoutingRegistryName of the - /// configuration. - public ExpressRouteCircuitPeeringConfig(IList advertisedPublicPrefixes = default(IList), IList advertisedCommunities = default(IList), string advertisedPublicPrefixesState = default(string), int? legacyMode = default(int?), int? customerASN = default(int?), string routingRegistryName = default(string)) + + /// The reference to AdvertisedPublicPrefixes. + /// + + /// The communities of bgp peering. Specified for microsoft peering. + /// + + /// The advertised public prefix state of the Peering resource. + /// Possible values include: 'NotConfigured', 'Configuring', 'Configured', + /// 'ValidationNeeded' + + /// The legacy mode of the peering. + /// + + /// The CustomerASN of the peering. + /// + + /// The RoutingRegistryName of the configuration. + /// + public ExpressRouteCircuitPeeringConfig(System.Collections.Generic.IList advertisedPublicPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList advertisedCommunities = default(System.Collections.Generic.IList), string advertisedPublicPrefixesState = default(string), int? legacyMode = default(int?), int? customerAsn = default(int?), string routingRegistryName = default(string)) + { - AdvertisedPublicPrefixes = advertisedPublicPrefixes; - AdvertisedCommunities = advertisedCommunities; - AdvertisedPublicPrefixesState = advertisedPublicPrefixesState; - LegacyMode = legacyMode; - CustomerASN = customerASN; - RoutingRegistryName = routingRegistryName; + this.AdvertisedPublicPrefixes = advertisedPublicPrefixes; + this.AdvertisedCommunities = advertisedCommunities; + this.AdvertisedPublicPrefixesState = advertisedPublicPrefixesState; + this.LegacyMode = legacyMode; + this.CustomerAsn = customerAsn; + this.RoutingRegistryName = routingRegistryName; CustomInit(); } @@ -61,44 +59,42 @@ public ExpressRouteCircuitPeeringConfig() /// partial void CustomInit(); + /// /// Gets or sets the reference to AdvertisedPublicPrefixes. /// - [JsonProperty(PropertyName = "advertisedPublicPrefixes")] - public IList AdvertisedPublicPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedPublicPrefixes")] + public System.Collections.Generic.IList AdvertisedPublicPrefixes {get; set; } /// - /// Gets or sets the communities of bgp peering. Specified for - /// microsoft peering. + /// Gets or sets the communities of bgp peering. Specified for microsoft + /// peering. /// - [JsonProperty(PropertyName = "advertisedCommunities")] - public IList AdvertisedCommunities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedCommunities")] + public System.Collections.Generic.IList AdvertisedCommunities {get; set; } /// - /// Gets the advertised public prefix state of the Peering resource. - /// Possible values include: 'NotConfigured', 'Configuring', - /// 'Configured', 'ValidationNeeded' + /// Gets the advertised public prefix state of the Peering resource. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' /// - [JsonProperty(PropertyName = "advertisedPublicPrefixesState")] - public string AdvertisedPublicPrefixesState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedPublicPrefixesState")] + public string AdvertisedPublicPrefixesState {get; private set; } /// /// Gets or sets the legacy mode of the peering. /// - [JsonProperty(PropertyName = "legacyMode")] - public int? LegacyMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "legacyMode")] + public int? LegacyMode {get; set; } /// /// Gets or sets the CustomerASN of the peering. /// - [JsonProperty(PropertyName = "customerASN")] - public int? CustomerASN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customerASN")] + public int? CustomerAsn {get; set; } /// /// Gets or sets the RoutingRegistryName of the configuration. /// - [JsonProperty(PropertyName = "routingRegistryName")] - public string RoutingRegistryName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "routingRegistryName")] + public string RoutingRegistryName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringId.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringId.cs index 510c71ba27e9..4dc7a96b1efb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringId.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringId.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitPeeringId { /// - /// Initializes a new instance of the ExpressRouteCircuitPeeringId - /// class. + /// Initializes a new instance of the ExpressRouteCircuitPeeringId class. /// public ExpressRouteCircuitPeeringId() { @@ -28,14 +21,15 @@ public ExpressRouteCircuitPeeringId() } /// - /// Initializes a new instance of the ExpressRouteCircuitPeeringId - /// class. + /// Initializes a new instance of the ExpressRouteCircuitPeeringId class. /// - /// The ID of the ExpressRoute circuit - /// peering. + + /// The ID of the ExpressRoute circuit peering. + /// public ExpressRouteCircuitPeeringId(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -44,11 +38,11 @@ public ExpressRouteCircuitPeeringId() /// partial void CustomInit(); + /// /// Gets or sets the ID of the ExpressRoute circuit peering. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringPropertiesFormat.cs new file mode 100644 index 000000000000..ff38e9c026c5 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringPropertiesFormat.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the express route circuit peering. + /// + public partial class ExpressRouteCircuitPeeringPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRouteCircuitPeeringPropertiesFormat class. + /// + public ExpressRouteCircuitPeeringPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitPeeringPropertiesFormat class. + /// + + /// The peering type. + /// Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + + /// The peering state. + /// Possible values include: 'Disabled', 'Enabled' + + /// The Azure ASN. + /// + + /// The peer ASN. + /// + + /// The primary address prefix. + /// + + /// The secondary address prefix. + /// + + /// The primary port. + /// + + /// The secondary port. + /// + + /// The shared key. + /// + + /// The VLAN ID. + /// + + /// The Microsoft peering configuration. + /// + + /// The peering stats of express route circuit. + /// + + /// The provisioning state of the express route circuit peering resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The GatewayManager Etag. + /// + + /// Who was the last to modify the peering. + /// + + /// The reference to the RouteFilter resource. + /// + + /// The IPv6 peering configuration. + /// + + /// The ExpressRoute connection. + /// + + /// The list of circuit connections associated with Azure Private Peering for + /// this circuit. + /// + + /// The list of peered circuit connections associated with Azure Private + /// Peering for this circuit. + /// + public ExpressRouteCircuitPeeringPropertiesFormat(string peeringType = default(string), string state = default(string), int? azureAsn = default(int?), long? peerAsn = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), SubResource routeFilter = default(SubResource), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), ExpressRouteConnectionId expressRouteConnection = default(ExpressRouteConnectionId), System.Collections.Generic.IList connections = default(System.Collections.Generic.IList), System.Collections.Generic.IList peeredConnections = default(System.Collections.Generic.IList)) + + { + this.PeeringType = peeringType; + this.State = state; + this.AzureAsn = azureAsn; + this.PeerAsn = peerAsn; + this.PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + this.SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.SharedKey = sharedKey; + this.VlanId = vlanId; + this.MicrosoftPeeringConfig = microsoftPeeringConfig; + this.Stats = stats; + this.ProvisioningState = provisioningState; + this.GatewayManagerEtag = gatewayManagerEtag; + this.LastModifiedBy = lastModifiedBy; + this.RouteFilter = routeFilter; + this.Ipv6PeeringConfig = ipv6PeeringConfig; + this.ExpressRouteConnection = expressRouteConnection; + this.Connections = connections; + this.PeeredConnections = peeredConnections; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringType")] + public string PeeringType {get; set; } + + /// + /// Gets or sets the peering state. Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } + + /// + /// Gets or sets the Azure ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "azureASN")] + public int? AzureAsn {get; set; } + + /// + /// Gets or sets the peer ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerASN")] + public long? PeerAsn {get; set; } + + /// + /// Gets or sets the primary address prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix {get; set; } + + /// + /// Gets or sets the secondary address prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix {get; set; } + + /// + /// Gets or sets the primary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAzurePort")] + public string PrimaryAzurePort {get; set; } + + /// + /// Gets or sets the secondary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryAzurePort")] + public string SecondaryAzurePort {get; set; } + + /// + /// Gets or sets the shared key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedKey")] + public string SharedKey {get; set; } + + /// + /// Gets or sets the VLAN ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vlanId")] + public int? VlanId {get; set; } + + /// + /// Gets or sets the Microsoft peering configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig {get; set; } + + /// + /// Gets or sets the peering stats of express route circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "stats")] + public ExpressRouteCircuitStats Stats {get; set; } + + /// + /// Gets the provisioning state of the express route circuit peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the GatewayManager Etag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayManagerEtag")] + public string GatewayManagerEtag {get; set; } + + /// + /// Gets who was the last to modify the peering. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; private set; } + + /// + /// Gets or sets the reference to the RouteFilter resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routeFilter")] + public SubResource RouteFilter {get; set; } + + /// + /// Gets or sets the IPv6 peering configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipv6PeeringConfig")] + public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig {get; set; } + + /// + /// Gets or sets the ExpressRoute connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteConnection")] + public ExpressRouteConnectionId ExpressRouteConnection {get; set; } + + /// + /// Gets or sets the list of circuit connections associated with Azure Private + /// Peering for this circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connections")] + public System.Collections.Generic.IList Connections {get; set; } + + /// + /// Gets the list of peered circuit connections associated with Azure Private + /// Peering for this circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeredConnections")] + public System.Collections.Generic.IList PeeredConnections {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.PeerAsn != null) + { + if (this.PeerAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + } + if (this.PeerAsn < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 1); + } + } + + + + + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringState.cs index 724012135d36..5795e6a184ee 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPeeringState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteCircuitPeeringState. /// + + public static class ExpressRouteCircuitPeeringState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPropertiesFormat.cs new file mode 100644 index 000000000000..d37c2bd2e5a5 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitPropertiesFormat.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ExpressRouteCircuit. + /// + public partial class ExpressRouteCircuitPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRouteCircuitPropertiesFormat class. + /// + public ExpressRouteCircuitPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitPropertiesFormat class. + /// + + /// Allow classic operations. + /// + + /// The CircuitProvisioningState state of the resource. + /// + + /// The ServiceProviderProvisioningState state of the resource. + /// Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + /// 'Deprovisioning' + + /// The list of authorizations. + /// + + /// The list of peerings. + /// + + /// The ServiceKey. + /// + + /// The ServiceProviderNotes. + /// + + /// The ServiceProviderProperties. + /// + + /// The reference to the ExpressRoutePort resource when the circuit is + /// provisioned on an ExpressRoutePort resource. + /// + + /// The bandwidth of the circuit when the circuit is provisioned on an + /// ExpressRoutePort resource. + /// + + /// The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + /// + + /// The provisioning state of the express route circuit resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The GatewayManager Etag. + /// + + /// Flag denoting global reach status. + /// + + /// The authorizationKey. + /// + + /// The authorization status of the Circuit. + /// + public ExpressRouteCircuitPropertiesFormat(bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), System.Collections.Generic.IList authorizations = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), SubResource expressRoutePort = default(SubResource), double? bandwidthInGbps = default(double?), int? stag = default(int?), string provisioningState = default(string), string gatewayManagerEtag = default(string), bool? globalReachEnabled = default(bool?), string authorizationKey = default(string), string authorizationStatus = default(string)) + + { + this.AllowClassicOperations = allowClassicOperations; + this.CircuitProvisioningState = circuitProvisioningState; + this.ServiceProviderProvisioningState = serviceProviderProvisioningState; + this.Authorizations = authorizations; + this.Peerings = peerings; + this.ServiceKey = serviceKey; + this.ServiceProviderNotes = serviceProviderNotes; + this.ServiceProviderProperties = serviceProviderProperties; + this.ExpressRoutePort = expressRoutePort; + this.BandwidthInGbps = bandwidthInGbps; + this.Stag = stag; + this.ProvisioningState = provisioningState; + this.GatewayManagerEtag = gatewayManagerEtag; + this.GlobalReachEnabled = globalReachEnabled; + this.AuthorizationKey = authorizationKey; + this.AuthorizationStatus = authorizationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets allow classic operations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowClassicOperations")] + public bool? AllowClassicOperations {get; set; } + + /// + /// Gets or sets the CircuitProvisioningState state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "circuitProvisioningState")] + public string CircuitProvisioningState {get; set; } + + /// + /// Gets or sets the ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderProvisioningState")] + public string ServiceProviderProvisioningState {get; set; } + + /// + /// Gets or sets the list of authorizations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizations")] + public System.Collections.Generic.IList Authorizations {get; set; } + + /// + /// Gets or sets the list of peerings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerings")] + public System.Collections.Generic.IList Peerings {get; set; } + + /// + /// Gets or sets the ServiceKey. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceKey")] + public string ServiceKey {get; set; } + + /// + /// Gets or sets the ServiceProviderNotes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderNotes")] + public string ServiceProviderNotes {get; set; } + + /// + /// Gets or sets the ServiceProviderProperties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderProperties")] + public ExpressRouteCircuitServiceProviderProperties ServiceProviderProperties {get; set; } + + /// + /// Gets or sets the reference to the ExpressRoutePort resource when the + /// circuit is provisioned on an ExpressRoutePort resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRoutePort")] + public SubResource ExpressRoutePort {get; set; } + + /// + /// Gets or sets the bandwidth of the circuit when the circuit is provisioned + /// on an ExpressRoutePort resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthInGbps")] + public double? BandwidthInGbps {get; set; } + + /// + /// Gets the identifier of the circuit traffic. Outer tag for QinQ + /// encapsulation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "stag")] + public int? Stag {get; private set; } + + /// + /// Gets the provisioning state of the express route circuit resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the GatewayManager Etag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayManagerEtag")] + public string GatewayManagerEtag {get; set; } + + /// + /// Gets or sets flag denoting global reach status. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "globalReachEnabled")] + public bool? GlobalReachEnabled {get; set; } + + /// + /// Gets or sets the authorizationKey. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; set; } + + /// + /// Gets the authorization status of the Circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationStatus")] + public string AuthorizationStatus {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitReference.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitReference.cs index 4c9efed61e34..cd08908cb769 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitReference.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitReference.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitReference { /// - /// Initializes a new instance of the ExpressRouteCircuitReference - /// class. + /// Initializes a new instance of the ExpressRouteCircuitReference class. /// public ExpressRouteCircuitReference() { @@ -28,13 +21,15 @@ public ExpressRouteCircuitReference() } /// - /// Initializes a new instance of the ExpressRouteCircuitReference - /// class. + /// Initializes a new instance of the ExpressRouteCircuitReference class. /// - /// Corresponding Express Route Circuit Id. + + /// Corresponding Express Route Circuit Id. + /// public ExpressRouteCircuitReference(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -43,11 +38,11 @@ public ExpressRouteCircuitReference() /// partial void CustomInit(); + /// /// Gets or sets corresponding Express Route Circuit Id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTable.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTable.cs index b55562569f1f..c290107f9182 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTable.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitRoutesTable { /// - /// Initializes a new instance of the ExpressRouteCircuitRoutesTable - /// class. + /// Initializes a new instance of the ExpressRouteCircuitRoutesTable class. /// public ExpressRouteCircuitRoutesTable() { @@ -28,23 +21,32 @@ public ExpressRouteCircuitRoutesTable() } /// - /// Initializes a new instance of the ExpressRouteCircuitRoutesTable - /// class. + /// Initializes a new instance of the ExpressRouteCircuitRoutesTable class. /// - /// IP address of a network entity. - /// NextHop address. - /// Local preference value as set with the set - /// local-preference route-map configuration command. - /// Route Weight. - /// Autonomous system paths to the destination - /// network. + + /// IP address of a network entity. + /// + + /// NextHop address. + /// + + /// Local preference value as set with the set local-preference route-map + /// configuration command. + /// + + /// Route Weight. + /// + + /// Autonomous system paths to the destination network. + /// public ExpressRouteCircuitRoutesTable(string network = default(string), string nextHop = default(string), string locPrf = default(string), int? weight = default(int?), string path = default(string)) + { - Network = network; - NextHop = nextHop; - LocPrf = locPrf; - Weight = weight; - Path = path; + this.Network = network; + this.NextHop = nextHop; + this.LocPrf = locPrf; + this.Weight = weight; + this.Path = path; CustomInit(); } @@ -53,36 +55,36 @@ public ExpressRouteCircuitRoutesTable() /// partial void CustomInit(); + /// - /// Gets or sets IP address of a network entity. + /// Gets or sets iP address of a network entity. /// - [JsonProperty(PropertyName = "network")] - public string Network { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "network")] + public string Network {get; set; } /// /// Gets or sets nextHop address. /// - [JsonProperty(PropertyName = "nextHop")] - public string NextHop { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] + public string NextHop {get; set; } /// - /// Gets or sets local preference value as set with the set - /// local-preference route-map configuration command. + /// Gets or sets local preference value as set with the set local-preference + /// route-map configuration command. /// - [JsonProperty(PropertyName = "locPrf")] - public string LocPrf { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "locPrf")] + public string LocPrf {get; set; } /// /// Gets or sets route Weight. /// - [JsonProperty(PropertyName = "weight")] - public int? Weight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "weight")] + public int? Weight {get; set; } /// /// Gets or sets autonomous system paths to the destination network. /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs index 12160d02a6c9..4128d4584bed 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitRoutesTableSummary { /// - /// Initializes a new instance of the - /// ExpressRouteCircuitRoutesTableSummary class. + /// Initializes a new instance of the ExpressRouteCircuitRoutesTableSummary class. /// public ExpressRouteCircuitRoutesTableSummary() { @@ -28,25 +21,33 @@ public ExpressRouteCircuitRoutesTableSummary() } /// - /// Initializes a new instance of the - /// ExpressRouteCircuitRoutesTableSummary class. + /// Initializes a new instance of the ExpressRouteCircuitRoutesTableSummary class. /// - /// IP address of the neighbor. - /// BGP version number spoken to the neighbor. - /// Autonomous system number. - /// The length of time that the BGP session has - /// been in the Established state, or the current status if not in the - /// Established state. - /// Current state of the BGP session, and the - /// number of prefixes that have been received from a neighbor or peer - /// group. + + /// IP address of the neighbor. + /// + + /// BGP version number spoken to the neighbor. + /// + + /// Autonomous system number. + /// + + /// The length of time that the BGP session has been in the Established state, + /// or the current status if not in the Established state. + /// + + /// Current state of the BGP session, and the number of prefixes that have been + /// received from a neighbor or peer group. + /// public ExpressRouteCircuitRoutesTableSummary(string neighbor = default(string), int? v = default(int?), int? asProperty = default(int?), string upDown = default(string), string statePfxRcd = default(string)) + { - Neighbor = neighbor; - V = v; - AsProperty = asProperty; - UpDown = upDown; - StatePfxRcd = statePfxRcd; + this.Neighbor = neighbor; + this.V = v; + this.AsProperty = asProperty; + this.UpDown = upDown; + this.StatePfxRcd = statePfxRcd; CustomInit(); } @@ -55,38 +56,37 @@ public ExpressRouteCircuitRoutesTableSummary() /// partial void CustomInit(); + /// - /// Gets or sets IP address of the neighbor. + /// Gets or sets iP address of the neighbor. /// - [JsonProperty(PropertyName = "neighbor")] - public string Neighbor { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "neighbor")] + public string Neighbor {get; set; } /// - /// Gets or sets BGP version number spoken to the neighbor. + /// Gets or sets bGP version number spoken to the neighbor. /// - [JsonProperty(PropertyName = "v")] - public int? V { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "v")] + public int? V {get; set; } /// /// Gets or sets autonomous system number. /// - [JsonProperty(PropertyName = "as")] - public int? AsProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "as")] + public int? AsProperty {get; set; } /// - /// Gets or sets the length of time that the BGP session has been in - /// the Established state, or the current status if not in the - /// Established state. + /// Gets or sets the length of time that the BGP session has been in the + /// Established state, or the current status if not in the Established state. /// - [JsonProperty(PropertyName = "upDown")] - public string UpDown { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "upDown")] + public string UpDown {get; set; } /// - /// Gets or sets current state of the BGP session, and the number of - /// prefixes that have been received from a neighbor or peer group. + /// Gets or sets current state of the BGP session, and the number of prefixes + /// that have been received from a neighbor or peer group. /// - [JsonProperty(PropertyName = "statePfxRcd")] - public string StatePfxRcd { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statePfxRcd")] + public string StatePfxRcd {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs index 834d74c14deb..6cd709dff343 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitServiceProviderProperties { /// - /// Initializes a new instance of the - /// ExpressRouteCircuitServiceProviderProperties class. + /// Initializes a new instance of the ExpressRouteCircuitServiceProviderProperties class. /// public ExpressRouteCircuitServiceProviderProperties() { @@ -28,17 +21,23 @@ public ExpressRouteCircuitServiceProviderProperties() } /// - /// Initializes a new instance of the - /// ExpressRouteCircuitServiceProviderProperties class. + /// Initializes a new instance of the ExpressRouteCircuitServiceProviderProperties class. /// - /// The serviceProviderName. - /// The peering location. - /// The BandwidthInMbps. + + /// The serviceProviderName. + /// + + /// The peering location. + /// + + /// The BandwidthInMbps. + /// public ExpressRouteCircuitServiceProviderProperties(string serviceProviderName = default(string), string peeringLocation = default(string), int? bandwidthInMbps = default(int?)) + { - ServiceProviderName = serviceProviderName; - PeeringLocation = peeringLocation; - BandwidthInMbps = bandwidthInMbps; + this.ServiceProviderName = serviceProviderName; + this.PeeringLocation = peeringLocation; + this.BandwidthInMbps = bandwidthInMbps; CustomInit(); } @@ -47,23 +46,23 @@ public ExpressRouteCircuitServiceProviderProperties() /// partial void CustomInit(); + /// /// Gets or sets the serviceProviderName. /// - [JsonProperty(PropertyName = "serviceProviderName")] - public string ServiceProviderName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderName")] + public string ServiceProviderName {get; set; } /// /// Gets or sets the peering location. /// - [JsonProperty(PropertyName = "peeringLocation")] - public string PeeringLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocation")] + public string PeeringLocation {get; set; } /// /// Gets or sets the BandwidthInMbps. /// - [JsonProperty(PropertyName = "bandwidthInMbps")] - public int? BandwidthInMbps { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthInMbps")] + public int? BandwidthInMbps {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSku.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSku.cs index e684429c3370..8e2e2e1f928f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public ExpressRouteCircuitSku() /// /// Initializes a new instance of the ExpressRouteCircuitSku class. /// - /// The name of the SKU. - /// The tier of the SKU. Possible values include: - /// 'Standard', 'Premium', 'Basic', 'Local' - /// The family of the SKU. Possible values - /// include: 'UnlimitedData', 'MeteredData' + + /// The name of the SKU. + /// + + /// The tier of the SKU. + /// Possible values include: 'Standard', 'Premium', 'Basic', 'Local' + + /// The family of the SKU. + /// Possible values include: 'UnlimitedData', 'MeteredData' public ExpressRouteCircuitSku(string name = default(string), string tier = default(string), string family = default(string)) + { - Name = name; - Tier = tier; - Family = family; + this.Name = name; + this.Tier = tier; + this.Family = family; CustomInit(); } @@ -47,25 +46,23 @@ public ExpressRouteCircuitSku() /// partial void CustomInit(); + /// /// Gets or sets the name of the SKU. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the tier of the SKU. Possible values include: - /// 'Standard', 'Premium', 'Basic', 'Local' + /// Gets or sets the tier of the SKU. Possible values include: 'Standard', 'Premium', 'Basic', 'Local' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } /// - /// Gets or sets the family of the SKU. Possible values include: - /// 'UnlimitedData', 'MeteredData' + /// Gets or sets the family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData' /// - [JsonProperty(PropertyName = "family")] - public string Family { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "family")] + public string Family {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuFamily.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuFamily.cs index 77d2628c187e..1b41b48f1942 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuFamily.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuFamily.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteCircuitSkuFamily. /// + + public static class ExpressRouteCircuitSkuFamily { public const string UnlimitedData = "UnlimitedData"; public const string MeteredData = "MeteredData"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuTier.cs index 144e3cc81f10..72758b61d8e3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitSkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteCircuitSkuTier. /// + + public static class ExpressRouteCircuitSkuTier { public const string Standard = "Standard"; @@ -21,4 +18,4 @@ public static class ExpressRouteCircuitSkuTier public const string Basic = "Basic"; public const string Local = "Local"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitStats.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitStats.cs index b1b3247b2760..be47cf56c455 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitStats.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitStats.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,25 @@ public ExpressRouteCircuitStats() /// /// Initializes a new instance of the ExpressRouteCircuitStats class. /// - /// The Primary BytesIn of the - /// peering. - /// The primary BytesOut of the - /// peering. - /// The secondary BytesIn of the - /// peering. - /// The secondary BytesOut of the - /// peering. + + /// The Primary BytesIn of the peering. + /// + + /// The primary BytesOut of the peering. + /// + + /// The secondary BytesIn of the peering. + /// + + /// The secondary BytesOut of the peering. + /// public ExpressRouteCircuitStats(long? primarybytesIn = default(long?), long? primarybytesOut = default(long?), long? secondarybytesIn = default(long?), long? secondarybytesOut = default(long?)) + { - PrimarybytesIn = primarybytesIn; - PrimarybytesOut = primarybytesOut; - SecondarybytesIn = secondarybytesIn; - SecondarybytesOut = secondarybytesOut; + this.PrimarybytesIn = primarybytesIn; + this.PrimarybytesOut = primarybytesOut; + this.SecondarybytesIn = secondarybytesIn; + this.SecondarybytesOut = secondarybytesOut; CustomInit(); } @@ -51,29 +50,29 @@ public ExpressRouteCircuitStats() /// partial void CustomInit(); + /// /// Gets or sets the Primary BytesIn of the peering. /// - [JsonProperty(PropertyName = "primarybytesIn")] - public long? PrimarybytesIn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "primarybytesIn")] + public long? PrimarybytesIn {get; set; } /// /// Gets or sets the primary BytesOut of the peering. /// - [JsonProperty(PropertyName = "primarybytesOut")] - public long? PrimarybytesOut { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "primarybytesOut")] + public long? PrimarybytesOut {get; set; } /// /// Gets or sets the secondary BytesIn of the peering. /// - [JsonProperty(PropertyName = "secondarybytesIn")] - public long? SecondarybytesIn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "secondarybytesIn")] + public long? SecondarybytesIn {get; set; } /// /// Gets or sets the secondary BytesOut of the peering. /// - [JsonProperty(PropertyName = "secondarybytesOut")] - public long? SecondarybytesOut { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secondarybytesOut")] + public long? SecondarybytesOut {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs index b48a76aec112..2b0a5deac52a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs @@ -1,29 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Response for ListArpTable associated with the Express Route Circuits - /// API. + /// Response for ListArpTable associated with the Express Route Circuits API. /// public partial class ExpressRouteCircuitsArpTableListResult { /// - /// Initializes a new instance of the - /// ExpressRouteCircuitsArpTableListResult class. + /// Initializes a new instance of the ExpressRouteCircuitsArpTableListResult class. /// public ExpressRouteCircuitsArpTableListResult() { @@ -31,16 +21,19 @@ public ExpressRouteCircuitsArpTableListResult() } /// - /// Initializes a new instance of the - /// ExpressRouteCircuitsArpTableListResult class. + /// Initializes a new instance of the ExpressRouteCircuitsArpTableListResult class. /// - /// A list of the ARP tables. - /// The URL to get the next set of - /// results. - public ExpressRouteCircuitsArpTableListResult(IList value = default(IList), string nextLink = default(string)) + + /// A list of the ARP tables. + /// + + /// The URL to get the next set of results. + /// + public ExpressRouteCircuitsArpTableListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +42,17 @@ public ExpressRouteCircuitsArpTableListResult() /// partial void CustomInit(); + /// /// Gets or sets a list of the ARP tables. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs index 305fda7ab73c..8c6523175f8d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitsRoutesTableListResult { /// - /// Initializes a new instance of the - /// ExpressRouteCircuitsRoutesTableListResult class. + /// Initializes a new instance of the ExpressRouteCircuitsRoutesTableListResult class. /// public ExpressRouteCircuitsRoutesTableListResult() { @@ -31,16 +22,19 @@ public ExpressRouteCircuitsRoutesTableListResult() } /// - /// Initializes a new instance of the - /// ExpressRouteCircuitsRoutesTableListResult class. + /// Initializes a new instance of the ExpressRouteCircuitsRoutesTableListResult class. /// - /// The list of routes table. - /// The URL to get the next set of - /// results. - public ExpressRouteCircuitsRoutesTableListResult(IList value = default(IList), string nextLink = default(string)) + + /// The list of routes table. + /// + + /// The URL to get the next set of results. + /// + public ExpressRouteCircuitsRoutesTableListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +43,17 @@ public ExpressRouteCircuitsRoutesTableListResult() /// partial void CustomInit(); + /// /// Gets or sets the list of routes table. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs index a8ee8ca79a24..09fd848db999 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCircuitsRoutesTableSummaryListResult { /// - /// Initializes a new instance of the - /// ExpressRouteCircuitsRoutesTableSummaryListResult class. + /// Initializes a new instance of the ExpressRouteCircuitsRoutesTableSummaryListResult class. /// public ExpressRouteCircuitsRoutesTableSummaryListResult() { @@ -31,16 +22,19 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() } /// - /// Initializes a new instance of the - /// ExpressRouteCircuitsRoutesTableSummaryListResult class. + /// Initializes a new instance of the ExpressRouteCircuitsRoutesTableSummaryListResult class. /// - /// A list of the routes table. - /// The URL to get the next set of - /// results. - public ExpressRouteCircuitsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) + + /// A list of the routes table. + /// + + /// The URL to get the next set of results. + /// + public ExpressRouteCircuitsRoutesTableSummaryListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +43,17 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() /// partial void CustomInit(); + /// /// Gets or sets a list of the routes table. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnection.cs index 255bfdfc46eb..3d76620de6ac 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnection.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// ExpressRouteConnection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteConnection : SubResource { /// @@ -32,39 +24,51 @@ public ExpressRouteConnection() /// /// Initializes a new instance of the ExpressRouteConnection class. /// - /// The ExpressRoute circuit - /// peering. - /// The name of the resource. - /// Resource ID. - /// The provisioning state of the - /// express route connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Authorization key to establish the - /// connection. - /// The routing weight associated to the - /// connection. - /// Enable internet - /// security. - /// Enable FastPath to vWan - /// Firewall hub. - /// Bypass the ExpressRoute - /// gateway when accessing private-links. ExpressRoute FastPath - /// (expressRouteGatewayBypass) must be enabled. - /// The Routing Configuration - /// indicating the associated and propagated route tables on this - /// connection. - public ExpressRouteConnection(ExpressRouteCircuitPeeringId expressRouteCircuitPeering, string name, string id = default(string), string provisioningState = default(string), string authorizationKey = default(string), int? routingWeight = default(int?), bool? enableInternetSecurity = default(bool?), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?), RoutingConfiguration routingConfiguration = default(RoutingConfiguration)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource. + /// + + /// The provisioning state of the express route connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// The ExpressRoute circuit peering. + /// + + /// Authorization key to establish the connection. + /// + + /// The routing weight associated to the connection. + /// + + /// Enable internet security. + /// + + /// Enable FastPath to vWan Firewall hub. + /// + + /// Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute + /// FastPath (expressRouteGatewayBypass) must be enabled. + /// + public ExpressRouteConnection(string name, string id = default(string), string provisioningState = default(string), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), ExpressRouteCircuitPeeringId expressRouteCircuitPeering = default(ExpressRouteCircuitPeeringId), string authorizationKey = default(string), int? routingWeight = default(int?), bool? enableInternetSecurity = default(bool?), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?)) + + : base(id) { - ProvisioningState = provisioningState; - ExpressRouteCircuitPeering = expressRouteCircuitPeering; - AuthorizationKey = authorizationKey; - RoutingWeight = routingWeight; - EnableInternetSecurity = enableInternetSecurity; - ExpressRouteGatewayBypass = expressRouteGatewayBypass; - EnablePrivateLinkFastPath = enablePrivateLinkFastPath; - RoutingConfiguration = routingConfiguration; - Name = name; + this.Name = name; + this.ProvisioningState = provisioningState; + this.RoutingConfiguration = routingConfiguration; + this.ExpressRouteCircuitPeering = expressRouteCircuitPeering; + this.AuthorizationKey = authorizationKey; + this.RoutingWeight = routingWeight; + this.EnableInternetSecurity = enableInternetSecurity; + this.ExpressRouteGatewayBypass = expressRouteGatewayBypass; + this.EnablePrivateLinkFastPath = enablePrivateLinkFastPath; CustomInit(); } @@ -73,81 +77,79 @@ public ExpressRouteConnection() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the express route connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the ExpressRoute circuit peering. + /// Gets the provisioning state of the express route connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] - public ExpressRouteCircuitPeeringId ExpressRouteCircuitPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets authorization key to establish the connection. + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } /// - /// Gets or sets the routing weight associated to the connection. + /// Gets or sets the ExpressRoute circuit peering. /// - [JsonProperty(PropertyName = "properties.routingWeight")] - public int? RoutingWeight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] + public ExpressRouteCircuitPeeringId ExpressRouteCircuitPeering {get; set; } /// - /// Gets or sets enable internet security. + /// Gets or sets authorization key to establish the connection. /// - [JsonProperty(PropertyName = "properties.enableInternetSecurity")] - public bool? EnableInternetSecurity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; set; } /// - /// Gets or sets enable FastPath to vWan Firewall hub. + /// Gets or sets the routing weight associated to the connection. /// - [JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] - public bool? ExpressRouteGatewayBypass { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] + public int? RoutingWeight {get; set; } /// - /// Gets or sets bypass the ExpressRoute gateway when accessing - /// private-links. ExpressRoute FastPath (expressRouteGatewayBypass) - /// must be enabled. + /// Gets or sets enable internet security. /// - [JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")] - public bool? EnablePrivateLinkFastPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } /// - /// Gets or sets the Routing Configuration indicating the associated - /// and propagated route tables on this connection. + /// Gets or sets enable FastPath to vWan Firewall hub. /// - [JsonProperty(PropertyName = "properties.routingConfiguration")] - public RoutingConfiguration RoutingConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass {get; set; } /// - /// Gets or sets the name of the resource. + /// Gets or sets bypass the ExpressRoute gateway when accessing private-links. + /// ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")] + public bool? EnablePrivateLinkFastPath {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ExpressRouteCircuitPeering == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ExpressRouteCircuitPeering"); - } - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionId.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionId.cs index ccac22940029..fe9aa42dfea9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionId.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionId.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public ExpressRouteConnectionId() /// /// Initializes a new instance of the ExpressRouteConnectionId class. /// - /// The ID of the ExpressRouteConnection. + + /// The ID of the ExpressRouteConnection. + /// public ExpressRouteConnectionId(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -41,11 +38,11 @@ public ExpressRouteConnectionId() /// partial void CustomInit(); + /// /// Gets the ID of the ExpressRouteConnection. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionList.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionList.cs index b9624134bb57..a940ea32c60d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public ExpressRouteConnectionList() /// /// Initializes a new instance of the ExpressRouteConnectionList class. /// - /// The list of ExpressRoute connections. - public ExpressRouteConnectionList(IList value = default(IList)) + + /// The list of ExpressRoute connections. + /// + public ExpressRouteConnectionList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public ExpressRouteConnectionList() /// partial void CustomInit(); + /// /// Gets or sets the list of ExpressRoute connections. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionProperties.cs new file mode 100644 index 000000000000..dfdf408bde9a --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteConnectionProperties.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the ExpressRouteConnection subresource. + /// + public partial class ExpressRouteConnectionProperties + { + /// + /// Initializes a new instance of the ExpressRouteConnectionProperties class. + /// + public ExpressRouteConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteConnectionProperties class. + /// + + /// The provisioning state of the express route connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The ExpressRoute circuit peering. + /// + + /// Authorization key to establish the connection. + /// + + /// The routing weight associated to the connection. + /// + + /// Enable internet security. + /// + + /// Enable FastPath to vWan Firewall hub. + /// + + /// Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute + /// FastPath (expressRouteGatewayBypass) must be enabled. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + public ExpressRouteConnectionProperties(ExpressRouteCircuitPeeringId expressRouteCircuitPeering, string provisioningState = default(string), string authorizationKey = default(string), int? routingWeight = default(int?), bool? enableInternetSecurity = default(bool?), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?), RoutingConfiguration routingConfiguration = default(RoutingConfiguration)) + + { + this.ProvisioningState = provisioningState; + this.ExpressRouteCircuitPeering = expressRouteCircuitPeering; + this.AuthorizationKey = authorizationKey; + this.RoutingWeight = routingWeight; + this.EnableInternetSecurity = enableInternetSecurity; + this.ExpressRouteGatewayBypass = expressRouteGatewayBypass; + this.EnablePrivateLinkFastPath = enablePrivateLinkFastPath; + this.RoutingConfiguration = routingConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the express route connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the ExpressRoute circuit peering. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteCircuitPeering")] + public ExpressRouteCircuitPeeringId ExpressRouteCircuitPeering {get; set; } + + /// + /// Gets or sets authorization key to establish the connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; set; } + + /// + /// Gets or sets the routing weight associated to the connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingWeight")] + public int? RoutingWeight {get; set; } + + /// + /// Gets or sets enable internet security. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } + + /// + /// Gets or sets enable FastPath to vWan Firewall hub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass {get; set; } + + /// + /// Gets or sets bypass the ExpressRoute gateway when accessing private-links. + /// ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePrivateLinkFastPath")] + public bool? EnablePrivateLinkFastPath {get; set; } + + /// + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ExpressRouteCircuitPeering == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ExpressRouteCircuitPeering"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnection.cs index ebe40b3cdb25..93a35cffdea1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// ExpressRouteCrossConnection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCrossConnection : Resource { /// - /// Initializes a new instance of the ExpressRouteCrossConnection - /// class. + /// Initializes a new instance of the ExpressRouteCrossConnection class. /// public ExpressRouteCrossConnection() { @@ -33,50 +22,72 @@ public ExpressRouteCrossConnection() } /// - /// Initializes a new instance of the ExpressRouteCrossConnection - /// class. + /// Initializes a new instance of the ExpressRouteCrossConnection class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The name of the primary - /// port. - /// The name of the secondary - /// port. - /// The identifier of the circuit traffic. - /// The peering location of the - /// ExpressRoute circuit. - /// The circuit bandwidth In - /// Mbps. - /// The ExpressRouteCircuit. - /// The provisioning - /// state of the circuit in the connectivity provider system. Possible - /// values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - /// 'Deprovisioning' - /// Additional read only notes set - /// by the connectivity provider. - /// The provisioning state of the - /// express route cross connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The list of peerings. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ExpressRouteCrossConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), int? sTag = default(int?), string peeringLocation = default(string), int? bandwidthInMbps = default(int?), ExpressRouteCircuitReference expressRouteCircuit = default(ExpressRouteCircuitReference), string serviceProviderProvisioningState = default(string), string serviceProviderNotes = default(string), string provisioningState = default(string), IList peerings = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the express route cross connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The name of the primary port. + /// + + /// The name of the secondary port. + /// + + /// The identifier of the circuit traffic. + /// + + /// The peering location of the ExpressRoute circuit. + /// + + /// The circuit bandwidth In Mbps. + /// + + /// The ExpressRouteCircuit. + /// + + /// The provisioning state of the circuit in the connectivity provider system. + /// Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + /// 'Deprovisioning' + + /// Additional read only notes set by the connectivity provider. + /// + + /// The list of peerings. + /// + public ExpressRouteCrossConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), int? sTag = default(int?), string peeringLocation = default(string), int? bandwidthInMbps = default(int?), ExpressRouteCircuitReference expressRouteCircuit = default(ExpressRouteCircuitReference), string serviceProviderProvisioningState = default(string), string serviceProviderNotes = default(string), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - PrimaryAzurePort = primaryAzurePort; - SecondaryAzurePort = secondaryAzurePort; - STag = sTag; - PeeringLocation = peeringLocation; - BandwidthInMbps = bandwidthInMbps; - ExpressRouteCircuit = expressRouteCircuit; - ServiceProviderProvisioningState = serviceProviderProvisioningState; - ServiceProviderNotes = serviceProviderNotes; - ProvisioningState = provisioningState; - Peerings = peerings; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.STag = sTag; + this.PeeringLocation = peeringLocation; + this.BandwidthInMbps = bandwidthInMbps; + this.ExpressRouteCircuit = expressRouteCircuit; + this.ServiceProviderProvisioningState = serviceProviderProvisioningState; + this.ServiceProviderNotes = serviceProviderNotes; + this.Peerings = peerings; CustomInit(); } @@ -85,77 +96,73 @@ public ExpressRouteCrossConnection() /// partial void CustomInit(); + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the express route cross connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets the name of the primary port. /// - [JsonProperty(PropertyName = "properties.primaryAzurePort")] - public string PrimaryAzurePort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort {get; private set; } /// /// Gets the name of the secondary port. /// - [JsonProperty(PropertyName = "properties.secondaryAzurePort")] - public string SecondaryAzurePort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort {get; private set; } /// /// Gets the identifier of the circuit traffic. /// - [JsonProperty(PropertyName = "properties.sTag")] - public int? STag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sTag")] + public int? STag {get; private set; } /// /// Gets the peering location of the ExpressRoute circuit. /// - [JsonProperty(PropertyName = "properties.peeringLocation")] - public string PeeringLocation { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringLocation")] + public string PeeringLocation {get; private set; } /// /// Gets the circuit bandwidth In Mbps. /// - [JsonProperty(PropertyName = "properties.bandwidthInMbps")] - public int? BandwidthInMbps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bandwidthInMbps")] + public int? BandwidthInMbps {get; private set; } /// /// Gets or sets the ExpressRouteCircuit. /// - [JsonProperty(PropertyName = "properties.expressRouteCircuit")] - public ExpressRouteCircuitReference ExpressRouteCircuit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteCircuit")] + public ExpressRouteCircuitReference ExpressRouteCircuit {get; set; } /// - /// Gets or sets the provisioning state of the circuit in the - /// connectivity provider system. Possible values include: - /// 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + /// Gets or sets the provisioning state of the circuit in the connectivity + /// provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' /// - [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] - public string ServiceProviderProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] + public string ServiceProviderProvisioningState {get; set; } /// - /// Gets or sets additional read only notes set by the connectivity - /// provider. + /// Gets or sets additional read only notes set by the connectivity provider. /// - [JsonProperty(PropertyName = "properties.serviceProviderNotes")] - public string ServiceProviderNotes { get; set; } - - /// - /// Gets the provisioning state of the express route cross connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderNotes")] + public string ServiceProviderNotes {get; set; } /// /// Gets or sets the list of peerings. /// - [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] + public System.Collections.Generic.IList Peerings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeering.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeering.cs index 2246452167f1..1407aba44514 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeering.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeering.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Peering in an ExpressRoute Cross Connection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCrossConnectionPeering : SubResource { /// - /// Initializes a new instance of the - /// ExpressRouteCrossConnectionPeering class. + /// Initializes a new instance of the ExpressRouteCrossConnectionPeering class. /// public ExpressRouteCrossConnectionPeering() { @@ -31,60 +22,86 @@ public ExpressRouteCrossConnectionPeering() } /// - /// Initializes a new instance of the - /// ExpressRouteCrossConnectionPeering class. - /// - /// Resource ID. - /// The peering type. Possible values - /// include: 'AzurePublicPeering', 'AzurePrivatePeering', - /// 'MicrosoftPeering' - /// The peering state. Possible values include: - /// 'Disabled', 'Enabled' - /// The Azure ASN. - /// The peer ASN. - /// The primary address - /// prefix. - /// The secondary address - /// prefix. - /// The primary port. - /// The secondary port. - /// The shared key. - /// The VLAN ID. - /// The Microsoft peering - /// configuration. - /// The provisioning state of the - /// express route cross connection peering resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The GatewayManager Etag. - /// Who was the last to modify the - /// peering. - /// The IPv6 peering - /// configuration. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ExpressRouteCrossConnectionPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), string name = default(string), string etag = default(string)) - : base(id) + /// Initializes a new instance of the ExpressRouteCrossConnectionPeering class. + /// + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the express route cross connection peering + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The peering type. + /// Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + + /// The peering state. + /// Possible values include: 'Disabled', 'Enabled' + + /// The Azure ASN. + /// + + /// The peer ASN. + /// + + /// The primary address prefix. + /// + + /// The secondary address prefix. + /// + + /// The primary port. + /// + + /// The secondary port. + /// + + /// The shared key. + /// + + /// The VLAN ID. + /// + + /// The Microsoft peering configuration. + /// + + /// The GatewayManager Etag. + /// + + /// Who was the last to modify the peering. + /// + + /// The IPv6 peering configuration. + /// + public ExpressRouteCrossConnectionPeering(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), string peeringType = default(string), string state = default(string), int? azureAsn = default(int?), long? peerAsn = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig)) + + : base(id) { - PeeringType = peeringType; - State = state; - AzureASN = azureASN; - PeerASN = peerASN; - PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; - SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; - PrimaryAzurePort = primaryAzurePort; - SecondaryAzurePort = secondaryAzurePort; - SharedKey = sharedKey; - VlanId = vlanId; - MicrosoftPeeringConfig = microsoftPeeringConfig; - ProvisioningState = provisioningState; - GatewayManagerEtag = gatewayManagerEtag; - LastModifiedBy = lastModifiedBy; - Ipv6PeeringConfig = ipv6PeeringConfig; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.PeeringType = peeringType; + this.State = state; + this.AzureAsn = azureAsn; + this.PeerAsn = peerAsn; + this.PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + this.SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.SharedKey = sharedKey; + this.VlanId = vlanId; + this.MicrosoftPeeringConfig = microsoftPeeringConfig; + this.GatewayManagerEtag = gatewayManagerEtag; + this.LastModifiedBy = lastModifiedBy; + this.Ipv6PeeringConfig = ipv6PeeringConfig; CustomInit(); } @@ -93,133 +110,144 @@ public ExpressRouteCrossConnectionPeering() /// partial void CustomInit(); + + /// + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + /// - /// Gets or sets the peering type. Possible values include: - /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// Gets the provisioning state of the express route cross connection peering + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.peeringType")] - public string PeeringType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the peering state. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets or sets the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' /// - [JsonProperty(PropertyName = "properties.state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringType")] + public string PeeringType {get; set; } + + /// + /// Gets or sets the peering state. Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.state")] + public string State {get; set; } /// /// Gets the Azure ASN. /// - [JsonProperty(PropertyName = "properties.azureASN")] - public int? AzureASN { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azureASN")] + public int? AzureAsn {get; private set; } /// /// Gets or sets the peer ASN. /// - [JsonProperty(PropertyName = "properties.peerASN")] - public long? PeerASN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerASN")] + public long? PeerAsn {get; set; } /// /// Gets or sets the primary address prefix. /// - [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] - public string PrimaryPeerAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix {get; set; } /// /// Gets or sets the secondary address prefix. /// - [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] - public string SecondaryPeerAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix {get; set; } /// /// Gets the primary port. /// - [JsonProperty(PropertyName = "properties.primaryAzurePort")] - public string PrimaryAzurePort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort {get; private set; } /// /// Gets the secondary port. /// - [JsonProperty(PropertyName = "properties.secondaryAzurePort")] - public string SecondaryAzurePort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort {get; private set; } /// /// Gets or sets the shared key. /// - [JsonProperty(PropertyName = "properties.sharedKey")] - public string SharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey {get; set; } /// /// Gets or sets the VLAN ID. /// - [JsonProperty(PropertyName = "properties.vlanId")] - public int? VlanId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vlanId")] + public int? VlanId {get; set; } /// /// Gets or sets the Microsoft peering configuration. /// - [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] - public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } - - /// - /// Gets the provisioning state of the express route cross connection - /// peering resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig {get; set; } /// /// Gets or sets the GatewayManager Etag. /// - [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] - public string GatewayManagerEtag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + public string GatewayManagerEtag {get; set; } /// /// Gets who was the last to modify the peering. /// - [JsonProperty(PropertyName = "properties.lastModifiedBy")] - public string LastModifiedBy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedBy")] + public string LastModifiedBy {get; private set; } /// /// Gets or sets the IPv6 peering configuration. /// - [JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] - public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig { get; set; } - - /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] + public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PeerASN != null) + + + + + + if (this.PeerAsn != null) { - if (PeerASN > 4294967295) + if (this.PeerAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); } - if (PeerASN < 1) + if (this.PeerAsn < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 1); } } + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeeringProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeeringProperties.cs new file mode 100644 index 000000000000..985fbb9e8d58 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionPeeringProperties.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of express route cross connection peering. + /// + public partial class ExpressRouteCrossConnectionPeeringProperties + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionPeeringProperties class. + /// + public ExpressRouteCrossConnectionPeeringProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionPeeringProperties class. + /// + + /// The peering type. + /// Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + + /// The peering state. + /// Possible values include: 'Disabled', 'Enabled' + + /// The Azure ASN. + /// + + /// The peer ASN. + /// + + /// The primary address prefix. + /// + + /// The secondary address prefix. + /// + + /// The primary port. + /// + + /// The secondary port. + /// + + /// The shared key. + /// + + /// The VLAN ID. + /// + + /// The Microsoft peering configuration. + /// + + /// The provisioning state of the express route cross connection peering + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The GatewayManager Etag. + /// + + /// Who was the last to modify the peering. + /// + + /// The IPv6 peering configuration. + /// + public ExpressRouteCrossConnectionPeeringProperties(string peeringType = default(string), string state = default(string), int? azureAsn = default(int?), long? peerAsn = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig)) + + { + this.PeeringType = peeringType; + this.State = state; + this.AzureAsn = azureAsn; + this.PeerAsn = peerAsn; + this.PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + this.SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.SharedKey = sharedKey; + this.VlanId = vlanId; + this.MicrosoftPeeringConfig = microsoftPeeringConfig; + this.ProvisioningState = provisioningState; + this.GatewayManagerEtag = gatewayManagerEtag; + this.LastModifiedBy = lastModifiedBy; + this.Ipv6PeeringConfig = ipv6PeeringConfig; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringType")] + public string PeeringType {get; set; } + + /// + /// Gets or sets the peering state. Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } + + /// + /// Gets the Azure ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "azureASN")] + public int? AzureAsn {get; private set; } + + /// + /// Gets or sets the peer ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerASN")] + public long? PeerAsn {get; set; } + + /// + /// Gets or sets the primary address prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix {get; set; } + + /// + /// Gets or sets the secondary address prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix {get; set; } + + /// + /// Gets the primary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAzurePort")] + public string PrimaryAzurePort {get; private set; } + + /// + /// Gets the secondary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryAzurePort")] + public string SecondaryAzurePort {get; private set; } + + /// + /// Gets or sets the shared key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedKey")] + public string SharedKey {get; set; } + + /// + /// Gets or sets the VLAN ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vlanId")] + public int? VlanId {get; set; } + + /// + /// Gets or sets the Microsoft peering configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig {get; set; } + + /// + /// Gets the provisioning state of the express route cross connection peering + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the GatewayManager Etag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayManagerEtag")] + public string GatewayManagerEtag {get; set; } + + /// + /// Gets who was the last to modify the peering. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; private set; } + + /// + /// Gets or sets the IPv6 peering configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipv6PeeringConfig")] + public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.PeerAsn != null) + { + if (this.PeerAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + } + if (this.PeerAsn < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 1); + } + } + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionProperties.cs new file mode 100644 index 000000000000..b6812d7c29b6 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionProperties.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ExpressRouteCrossConnection. + /// + public partial class ExpressRouteCrossConnectionProperties + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionProperties class. + /// + public ExpressRouteCrossConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionProperties class. + /// + + /// The name of the primary port. + /// + + /// The name of the secondary port. + /// + + /// The identifier of the circuit traffic. + /// + + /// The peering location of the ExpressRoute circuit. + /// + + /// The circuit bandwidth In Mbps. + /// + + /// The ExpressRouteCircuit. + /// + + /// The provisioning state of the circuit in the connectivity provider system. + /// Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + /// 'Deprovisioning' + + /// Additional read only notes set by the connectivity provider. + /// + + /// The provisioning state of the express route cross connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The list of peerings. + /// + public ExpressRouteCrossConnectionProperties(string primaryAzurePort = default(string), string secondaryAzurePort = default(string), int? sTag = default(int?), string peeringLocation = default(string), int? bandwidthInMbps = default(int?), ExpressRouteCircuitReference expressRouteCircuit = default(ExpressRouteCircuitReference), string serviceProviderProvisioningState = default(string), string serviceProviderNotes = default(string), string provisioningState = default(string), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList)) + + { + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.STag = sTag; + this.PeeringLocation = peeringLocation; + this.BandwidthInMbps = bandwidthInMbps; + this.ExpressRouteCircuit = expressRouteCircuit; + this.ServiceProviderProvisioningState = serviceProviderProvisioningState; + this.ServiceProviderNotes = serviceProviderNotes; + this.ProvisioningState = provisioningState; + this.Peerings = peerings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the primary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAzurePort")] + public string PrimaryAzurePort {get; private set; } + + /// + /// Gets the name of the secondary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryAzurePort")] + public string SecondaryAzurePort {get; private set; } + + /// + /// Gets the identifier of the circuit traffic. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sTag")] + public int? STag {get; private set; } + + /// + /// Gets the peering location of the ExpressRoute circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocation")] + public string PeeringLocation {get; private set; } + + /// + /// Gets the circuit bandwidth In Mbps. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthInMbps")] + public int? BandwidthInMbps {get; private set; } + + /// + /// Gets or sets the ExpressRouteCircuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteCircuit")] + public ExpressRouteCircuitReference ExpressRouteCircuit {get; set; } + + /// + /// Gets or sets the provisioning state of the circuit in the connectivity + /// provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderProvisioningState")] + public string ServiceProviderProvisioningState {get; set; } + + /// + /// Gets or sets additional read only notes set by the connectivity provider. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderNotes")] + public string ServiceProviderNotes {get; set; } + + /// + /// Gets the provisioning state of the express route cross connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the list of peerings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerings")] + public System.Collections.Generic.IList Peerings {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs index 177d44103fb1..50f8717784de 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCrossConnectionRoutesTableSummary { /// - /// Initializes a new instance of the - /// ExpressRouteCrossConnectionRoutesTableSummary class. + /// Initializes a new instance of the ExpressRouteCrossConnectionRoutesTableSummary class. /// public ExpressRouteCrossConnectionRoutesTableSummary() { @@ -28,23 +21,29 @@ public ExpressRouteCrossConnectionRoutesTableSummary() } /// - /// Initializes a new instance of the - /// ExpressRouteCrossConnectionRoutesTableSummary class. + /// Initializes a new instance of the ExpressRouteCrossConnectionRoutesTableSummary class. /// - /// IP address of Neighbor router. - /// Autonomous system number. - /// The length of time that the BGP session has - /// been in the Established state, or the current status if not in the - /// Established state. - /// Current state of the BGP - /// session, and the number of prefixes that have been received from a - /// neighbor or peer group. + + /// IP address of Neighbor router. + /// + + /// Autonomous system number. + /// + + /// The length of time that the BGP session has been in the Established state, + /// or the current status if not in the Established state. + /// + + /// Current state of the BGP session, and the number of prefixes that have been + /// received from a neighbor or peer group. + /// public ExpressRouteCrossConnectionRoutesTableSummary(string neighbor = default(string), int? asn = default(int?), string upDown = default(string), string stateOrPrefixesReceived = default(string)) + { - Neighbor = neighbor; - Asn = asn; - UpDown = upDown; - StateOrPrefixesReceived = stateOrPrefixesReceived; + this.Neighbor = neighbor; + this.Asn = asn; + this.UpDown = upDown; + this.StateOrPrefixesReceived = stateOrPrefixesReceived; CustomInit(); } @@ -53,32 +52,31 @@ public ExpressRouteCrossConnectionRoutesTableSummary() /// partial void CustomInit(); + /// - /// Gets or sets IP address of Neighbor router. + /// Gets or sets iP address of Neighbor router. /// - [JsonProperty(PropertyName = "neighbor")] - public string Neighbor { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "neighbor")] + public string Neighbor {get; set; } /// /// Gets or sets autonomous system number. /// - [JsonProperty(PropertyName = "asn")] - public int? Asn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + public int? Asn {get; set; } /// - /// Gets or sets the length of time that the BGP session has been in - /// the Established state, or the current status if not in the - /// Established state. + /// Gets or sets the length of time that the BGP session has been in the + /// Established state, or the current status if not in the Established state. /// - [JsonProperty(PropertyName = "upDown")] - public string UpDown { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "upDown")] + public string UpDown {get; set; } /// - /// Gets or sets current state of the BGP session, and the number of - /// prefixes that have been received from a neighbor or peer group. + /// Gets or sets current state of the BGP session, and the number of prefixes + /// that have been received from a neighbor or peer group. /// - [JsonProperty(PropertyName = "stateOrPrefixesReceived")] - public string StateOrPrefixesReceived { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "stateOrPrefixesReceived")] + public string StateOrPrefixesReceived {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs index 606abbf9bc27..7bc19229df9b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteCrossConnectionsRoutesTableSummaryListResult { /// - /// Initializes a new instance of the - /// ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + /// Initializes a new instance of the ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. /// public ExpressRouteCrossConnectionsRoutesTableSummaryListResult() { @@ -31,16 +22,19 @@ public ExpressRouteCrossConnectionsRoutesTableSummaryListResult() } /// - /// Initializes a new instance of the - /// ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + /// Initializes a new instance of the ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. /// - /// A list of the routes table. - /// The URL to get the next set of - /// results. - public ExpressRouteCrossConnectionsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) + + /// A list of the routes table. + /// + + /// The URL to get the next set of results. + /// + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +43,17 @@ public ExpressRouteCrossConnectionsRoutesTableSummaryListResult() /// partial void CustomInit(); + /// /// Gets or sets a list of the routes table. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGateway.cs index 0bf5ab4fa25a..743138cfed30 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// ExpressRoute gateway resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteGateway : Resource { /// @@ -34,33 +24,49 @@ public ExpressRouteGateway() /// /// Initializes a new instance of the ExpressRouteGateway class. /// - /// The Virtual Hub where the ExpressRoute - /// gateway is or will be deployed. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Configuration for auto - /// scaling. - /// List of ExpressRoute - /// connections to the ExpressRoute gateway. - /// The provisioning state of the - /// express route gateway resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Configures this gateway to - /// accept traffic from non Virtual WAN networks. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ExpressRouteGateway(VirtualHubId virtualHub, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration = default(ExpressRouteGatewayPropertiesAutoScaleConfiguration), IList expressRouteConnections = default(IList), string provisioningState = default(string), bool? allowNonVirtualWanTraffic = default(bool?), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the express route gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Configuration for auto scaling. + /// + + /// List of ExpressRoute connections to the ExpressRoute gateway. + /// + + /// The Virtual Hub where the ExpressRoute gateway is or will be deployed. + /// + + /// Configures this gateway to accept traffic from non Virtual WAN networks. + /// + public ExpressRouteGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration = default(ExpressRouteGatewayPropertiesAutoScaleConfiguration), System.Collections.Generic.IList expressRouteConnections = default(System.Collections.Generic.IList), VirtualHubId virtualHub = default(VirtualHubId), bool? allowNonVirtualWanTraffic = default(bool?)) + + : base(id, name, type, location, tags) { - AutoScaleConfiguration = autoScaleConfiguration; - ExpressRouteConnections = expressRouteConnections; - ProvisioningState = provisioningState; - VirtualHub = virtualHub; - AllowNonVirtualWanTraffic = allowNonVirtualWanTraffic; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.AutoScaleConfiguration = autoScaleConfiguration; + this.ExpressRouteConnections = expressRouteConnections; + this.VirtualHub = virtualHub; + this.AllowNonVirtualWanTraffic = allowNonVirtualWanTraffic; CustomInit(); } @@ -69,70 +75,44 @@ public ExpressRouteGateway() /// partial void CustomInit(); - /// - /// Gets or sets configuration for auto scaling. - /// - [JsonProperty(PropertyName = "properties.autoScaleConfiguration")] - public ExpressRouteGatewayPropertiesAutoScaleConfiguration AutoScaleConfiguration { get; set; } /// - /// Gets or sets list of ExpressRoute connections to the ExpressRoute - /// gateway. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.expressRouteConnections")] - public IList ExpressRouteConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the express route gateway resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the express route gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the Virtual Hub where the ExpressRoute gateway is or - /// will be deployed. + /// Gets or sets configuration for auto scaling. /// - [JsonProperty(PropertyName = "properties.virtualHub")] - public VirtualHubId VirtualHub { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoScaleConfiguration")] + public ExpressRouteGatewayPropertiesAutoScaleConfiguration AutoScaleConfiguration {get; set; } /// - /// Gets or sets configures this gateway to accept traffic from non - /// Virtual WAN networks. + /// Gets or sets list of ExpressRoute connections to the ExpressRoute gateway. /// - [JsonProperty(PropertyName = "properties.allowNonVirtualWanTraffic")] - public bool? AllowNonVirtualWanTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteConnections")] + public System.Collections.Generic.IList ExpressRouteConnections {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the Virtual Hub where the ExpressRoute gateway is or will be + /// deployed. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHub")] + public VirtualHubId VirtualHub {get; set; } /// - /// Validate the object. + /// Gets or sets configures this gateway to accept traffic from non Virtual WAN + /// networks. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VirtualHub == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualHub"); - } - if (ExpressRouteConnections != null) - { - foreach (var element in ExpressRouteConnections) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowNonVirtualWanTraffic")] + public bool? AllowNonVirtualWanTraffic {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayList.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayList.cs index adaabbf58648..50efa3f15ce5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public ExpressRouteGatewayList() /// /// Initializes a new instance of the ExpressRouteGatewayList class. /// - /// List of ExpressRoute gateways. - public ExpressRouteGatewayList(IList value = default(IList)) + + /// List of ExpressRoute gateways. + /// + public ExpressRouteGatewayList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public ExpressRouteGatewayList() /// partial void CustomInit(); + /// /// Gets or sets list of ExpressRoute gateways. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayProperties.cs new file mode 100644 index 000000000000..cd9ebf62a679 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayProperties.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// ExpressRoute gateway resource properties. + /// + public partial class ExpressRouteGatewayProperties + { + /// + /// Initializes a new instance of the ExpressRouteGatewayProperties class. + /// + public ExpressRouteGatewayProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteGatewayProperties class. + /// + + /// Configuration for auto scaling. + /// + + /// List of ExpressRoute connections to the ExpressRoute gateway. + /// + + /// The provisioning state of the express route gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The Virtual Hub where the ExpressRoute gateway is or will be deployed. + /// + + /// Configures this gateway to accept traffic from non Virtual WAN networks. + /// + public ExpressRouteGatewayProperties(VirtualHubId virtualHub, ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration = default(ExpressRouteGatewayPropertiesAutoScaleConfiguration), System.Collections.Generic.IList expressRouteConnections = default(System.Collections.Generic.IList), string provisioningState = default(string), bool? allowNonVirtualWanTraffic = default(bool?)) + + { + this.AutoScaleConfiguration = autoScaleConfiguration; + this.ExpressRouteConnections = expressRouteConnections; + this.ProvisioningState = provisioningState; + this.VirtualHub = virtualHub; + this.AllowNonVirtualWanTraffic = allowNonVirtualWanTraffic; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets configuration for auto scaling. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleConfiguration")] + public ExpressRouteGatewayPropertiesAutoScaleConfiguration AutoScaleConfiguration {get; set; } + + /// + /// Gets or sets list of ExpressRoute connections to the ExpressRoute gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteConnections")] + public System.Collections.Generic.IList ExpressRouteConnections {get; set; } + + /// + /// Gets the provisioning state of the express route gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the Virtual Hub where the ExpressRoute gateway is or will be + /// deployed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHub")] + public VirtualHubId VirtualHub {get; set; } + + /// + /// Gets or sets configures this gateway to accept traffic from non Virtual WAN + /// networks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowNonVirtualWanTraffic")] + public bool? AllowNonVirtualWanTraffic {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.VirtualHub == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualHub"); + } + + if (this.ExpressRouteConnections != null) + { + foreach (var element in this.ExpressRouteConnections) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.cs index 5aa64c38bc69..8057ac24b607 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteGatewayPropertiesAutoScaleConfiguration { /// - /// Initializes a new instance of the - /// ExpressRouteGatewayPropertiesAutoScaleConfiguration class. + /// Initializes a new instance of the ExpressRouteGatewayPropertiesAutoScaleConfiguration class. /// public ExpressRouteGatewayPropertiesAutoScaleConfiguration() { @@ -28,14 +21,15 @@ public ExpressRouteGatewayPropertiesAutoScaleConfiguration() } /// - /// Initializes a new instance of the - /// ExpressRouteGatewayPropertiesAutoScaleConfiguration class. + /// Initializes a new instance of the ExpressRouteGatewayPropertiesAutoScaleConfiguration class. /// - /// Minimum and maximum number of scale units to - /// deploy. + + /// Minimum and maximum number of scale units to deploy. + /// public ExpressRouteGatewayPropertiesAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds = default(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds)) + { - Bounds = bounds; + this.Bounds = bounds; CustomInit(); } @@ -44,11 +38,11 @@ public ExpressRouteGatewayPropertiesAutoScaleConfiguration() /// partial void CustomInit(); + /// /// Gets or sets minimum and maximum number of scale units to deploy. /// - [JsonProperty(PropertyName = "bounds")] - public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds Bounds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bounds")] + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds Bounds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.cs index b5696383d04d..d35233d95f1d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { /// - /// Initializes a new instance of the - /// ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds class. + /// Initializes a new instance of the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds class. /// public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds() { @@ -28,17 +21,19 @@ public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds() } /// - /// Initializes a new instance of the - /// ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds class. + /// Initializes a new instance of the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds class. /// - /// Minimum number of scale units deployed for - /// ExpressRoute gateway. - /// Maximum number of scale units deployed for - /// ExpressRoute gateway. + + /// Minimum number of scale units deployed for ExpressRoute gateway. + /// + + /// Maximum number of scale units deployed for ExpressRoute gateway. + /// public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds(int? min = default(int?), int? max = default(int?)) + { - Min = min; - Max = max; + this.Min = min; + this.Max = max; CustomInit(); } @@ -47,19 +42,19 @@ public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds() /// partial void CustomInit(); + /// - /// Gets or sets minimum number of scale units deployed for - /// ExpressRoute gateway. + /// Gets or sets minimum number of scale units deployed for ExpressRoute + /// gateway. /// - [JsonProperty(PropertyName = "min")] - public int? Min { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "min")] + public int? Min {get; set; } /// - /// Gets or sets maximum number of scale units deployed for - /// ExpressRoute gateway. + /// Gets or sets maximum number of scale units deployed for ExpressRoute + /// gateway. /// - [JsonProperty(PropertyName = "max")] - public int? Max { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "max")] + public int? Max {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLink.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLink.cs index bf7de8a71bde..76e14a287139 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLink.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLink.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// - /// ExpressRouteLink + /// ExpressRouteLink child resource definition. /// /// /// ExpressRouteLink child resource definition. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteLink : SubResource { /// @@ -35,42 +27,58 @@ public ExpressRouteLink() /// /// Initializes a new instance of the ExpressRouteLink class. /// - /// Resource ID. - /// Name of Azure router associated with - /// physical port. - /// Name of Azure router interface. - /// Mapping between physical port to patch - /// panel port. - /// Mapping of physical patch panel to - /// rack. - /// Cololocation for ExpressRoute Hybrid - /// Direct. - /// Physical fiber port type. Possible - /// values include: 'LC', 'SC' + + /// Resource ID. + /// + + /// Name of child port resource that is unique among child port resources of + /// the parent. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the express route link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Name of Azure router associated with physical port. + /// + + /// Name of Azure router interface. + /// + + /// Mapping between physical port to patch panel port. + /// + + /// Mapping of physical patch panel to rack. + /// + + /// Cololocation for ExpressRoute Hybrid Direct. + /// + + /// Physical fiber port type. + /// Possible values include: 'LC', 'SC' + /// Administrative state of the physical port. - /// Possible values include: 'Enabled', 'Disabled' - /// The provisioning state of the - /// express route link resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// MacSec configuration. - /// Name of child port resource that is unique among - /// child port resources of the parent. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ExpressRouteLink(string id = default(string), string routerName = default(string), string interfaceName = default(string), string patchPanelId = default(string), string rackId = default(string), string coloLocation = default(string), string connectorType = default(string), string adminState = default(string), string provisioningState = default(string), ExpressRouteLinkMacSecConfig macSecConfig = default(ExpressRouteLinkMacSecConfig), string name = default(string), string etag = default(string)) - : base(id) + /// Possible values include: 'Enabled', 'Disabled' + + /// MacSec configuration. + /// + public ExpressRouteLink(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), string routerName = default(string), string interfaceName = default(string), string patchPanelId = default(string), string rackId = default(string), string coloLocation = default(string), string connectorType = default(string), string adminState = default(string), ExpressRouteLinkMacSecConfig macSecConfig = default(ExpressRouteLinkMacSecConfig)) + + : base(id) { - RouterName = routerName; - InterfaceName = interfaceName; - PatchPanelId = patchPanelId; - RackId = rackId; - ColoLocation = coloLocation; - ConnectorType = connectorType; - AdminState = adminState; - ProvisioningState = provisioningState; - MacSecConfig = macSecConfig; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.RouterName = routerName; + this.InterfaceName = interfaceName; + this.PatchPanelId = patchPanelId; + this.RackId = rackId; + this.ColoLocation = coloLocation; + this.ConnectorType = connectorType; + this.AdminState = adminState; + this.MacSecConfig = macSecConfig; CustomInit(); } @@ -79,76 +87,73 @@ public ExpressRouteLink() /// partial void CustomInit(); + /// - /// Gets name of Azure router associated with physical port. + /// Gets or sets name of child port resource that is unique among child port + /// resources of the parent. /// - [JsonProperty(PropertyName = "properties.routerName")] - public string RouterName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets name of Azure router interface. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.interfaceName")] - public string InterfaceName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets mapping between physical port to patch panel port. + /// Gets the provisioning state of the express route link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.patchPanelId")] - public string PatchPanelId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets mapping of physical patch panel to rack. + /// Gets name of Azure router associated with physical port. /// - [JsonProperty(PropertyName = "properties.rackId")] - public string RackId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routerName")] + public string RouterName {get; private set; } /// - /// Gets cololocation for ExpressRoute Hybrid Direct. + /// Gets name of Azure router interface. /// - [JsonProperty(PropertyName = "properties.coloLocation")] - public string ColoLocation { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.interfaceName")] + public string InterfaceName {get; private set; } /// - /// Gets physical fiber port type. Possible values include: 'LC', 'SC' + /// Gets mapping between physical port to patch panel port. /// - [JsonProperty(PropertyName = "properties.connectorType")] - public string ConnectorType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.patchPanelId")] + public string PatchPanelId {get; private set; } /// - /// Gets or sets administrative state of the physical port. Possible - /// values include: 'Enabled', 'Disabled' + /// Gets mapping of physical patch panel to rack. /// - [JsonProperty(PropertyName = "properties.adminState")] - public string AdminState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rackId")] + public string RackId {get; private set; } /// - /// Gets the provisioning state of the express route link resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets cololocation for ExpressRoute Hybrid Direct. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coloLocation")] + public string ColoLocation {get; private set; } /// - /// Gets or sets macSec configuration. + /// Gets physical fiber port type. Possible values include: 'LC', 'SC' /// - [JsonProperty(PropertyName = "properties.macSecConfig")] - public ExpressRouteLinkMacSecConfig MacSecConfig { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectorType")] + public string ConnectorType {get; private set; } /// - /// Gets or sets name of child port resource that is unique among child - /// port resources of the parent. + /// Gets or sets administrative state of the physical port. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.adminState")] + public string AdminState {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets macSec configuration. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.macSecConfig")] + public ExpressRouteLinkMacSecConfig MacSecConfig {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkAdminState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkAdminState.cs index be25145aa0d1..239537d2ca1b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkAdminState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkAdminState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteLinkAdminState. /// + + public static class ExpressRouteLinkAdminState { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkConnectorType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkConnectorType.cs index cbf955ed70b8..f9eb08e22ad0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkConnectorType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkConnectorType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteLinkConnectorType. /// + + public static class ExpressRouteLinkConnectorType { public const string LC = "LC"; public const string SC = "SC"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecCipher.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecCipher.cs index 8beb4832ee15..9fac690dd47a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecCipher.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecCipher.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteLinkMacSecCipher. /// + + public static class ExpressRouteLinkMacSecCipher { public const string GcmAes256 = "GcmAes256"; @@ -21,4 +18,4 @@ public static class ExpressRouteLinkMacSecCipher public const string GcmAesXpn128 = "GcmAesXpn128"; public const string GcmAesXpn256 = "GcmAesXpn256"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecConfig.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecConfig.cs index 18310880be87..5bc584cbaeb3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecConfig.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecConfig.cs @@ -1,20 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Definition of ExpressRouteLink Mac Security configuration. + /// ExpressRouteLink Mac Security Configuration. /// /// /// ExpressRouteLink Mac Security Configuration. @@ -22,8 +16,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteLinkMacSecConfig { /// - /// Initializes a new instance of the ExpressRouteLinkMacSecConfig - /// class. + /// Initializes a new instance of the ExpressRouteLinkMacSecConfig class. /// public ExpressRouteLinkMacSecConfig() { @@ -31,23 +24,28 @@ public ExpressRouteLinkMacSecConfig() } /// - /// Initializes a new instance of the ExpressRouteLinkMacSecConfig - /// class. + /// Initializes a new instance of the ExpressRouteLinkMacSecConfig class. /// - /// Keyvault Secret Identifier URL - /// containing Mac security CKN key. - /// Keyvault Secret Identifier URL - /// containing Mac security CAK key. - /// Mac security cipher. Possible values include: - /// 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', 'GcmAesXpn256' - /// Sci mode enabled/disabled. Possible values - /// include: 'Disabled', 'Enabled' + + /// Keyvault Secret Identifier URL containing Mac security CKN key. + /// + + /// Keyvault Secret Identifier URL containing Mac security CAK key. + /// + + /// Mac security cipher. + /// Possible values include: 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', + /// 'GcmAesXpn256' + + /// Sci mode enabled/disabled. + /// Possible values include: 'Disabled', 'Enabled' public ExpressRouteLinkMacSecConfig(string cknSecretIdentifier = default(string), string cakSecretIdentifier = default(string), string cipher = default(string), string sciState = default(string)) + { - CknSecretIdentifier = cknSecretIdentifier; - CakSecretIdentifier = cakSecretIdentifier; - Cipher = cipher; - SciState = sciState; + this.CknSecretIdentifier = cknSecretIdentifier; + this.CakSecretIdentifier = cakSecretIdentifier; + this.Cipher = cipher; + this.SciState = sciState; CustomInit(); } @@ -56,33 +54,31 @@ public ExpressRouteLinkMacSecConfig() /// partial void CustomInit(); + /// - /// Gets or sets keyvault Secret Identifier URL containing Mac security - /// CKN key. + /// Gets or sets keyvault Secret Identifier URL containing Mac security CKN + /// key. /// - [JsonProperty(PropertyName = "cknSecretIdentifier")] - public string CknSecretIdentifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cknSecretIdentifier")] + public string CknSecretIdentifier {get; set; } /// - /// Gets or sets keyvault Secret Identifier URL containing Mac security - /// CAK key. + /// Gets or sets keyvault Secret Identifier URL containing Mac security CAK + /// key. /// - [JsonProperty(PropertyName = "cakSecretIdentifier")] - public string CakSecretIdentifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cakSecretIdentifier")] + public string CakSecretIdentifier {get; set; } /// - /// Gets or sets mac security cipher. Possible values include: - /// 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', 'GcmAesXpn256' + /// Gets or sets mac security cipher. Possible values include: 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', 'GcmAesXpn256' /// - [JsonProperty(PropertyName = "cipher")] - public string Cipher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cipher")] + public string Cipher {get; set; } /// - /// Gets or sets sci mode enabled/disabled. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets or sets sci mode enabled/disabled. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "sciState")] - public string SciState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sciState")] + public string SciState {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecSciState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecSciState.cs index f8ec4246ea01..a0030b125a47 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecSciState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkMacSecSciState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRouteLinkMacSecSciState. /// + + public static class ExpressRouteLinkMacSecSciState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkPropertiesFormat.cs new file mode 100644 index 000000000000..2d33416abac0 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteLinkPropertiesFormat.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties specific to ExpressRouteLink resources. + /// + /// + /// Properties specific to ExpressRouteLink resources. + /// + public partial class ExpressRouteLinkPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRouteLinkPropertiesFormat class. + /// + public ExpressRouteLinkPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteLinkPropertiesFormat class. + /// + + /// Name of Azure router associated with physical port. + /// + + /// Name of Azure router interface. + /// + + /// Mapping between physical port to patch panel port. + /// + + /// Mapping of physical patch panel to rack. + /// + + /// Cololocation for ExpressRoute Hybrid Direct. + /// + + /// Physical fiber port type. + /// Possible values include: 'LC', 'SC' + + /// Administrative state of the physical port. + /// Possible values include: 'Enabled', 'Disabled' + + /// The provisioning state of the express route link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// MacSec configuration. + /// + public ExpressRouteLinkPropertiesFormat(string routerName = default(string), string interfaceName = default(string), string patchPanelId = default(string), string rackId = default(string), string coloLocation = default(string), string connectorType = default(string), string adminState = default(string), string provisioningState = default(string), ExpressRouteLinkMacSecConfig macSecConfig = default(ExpressRouteLinkMacSecConfig)) + + { + this.RouterName = routerName; + this.InterfaceName = interfaceName; + this.PatchPanelId = patchPanelId; + this.RackId = rackId; + this.ColoLocation = coloLocation; + this.ConnectorType = connectorType; + this.AdminState = adminState; + this.ProvisioningState = provisioningState; + this.MacSecConfig = macSecConfig; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets name of Azure router associated with physical port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routerName")] + public string RouterName {get; private set; } + + /// + /// Gets name of Azure router interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "interfaceName")] + public string InterfaceName {get; private set; } + + /// + /// Gets mapping between physical port to patch panel port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "patchPanelId")] + public string PatchPanelId {get; private set; } + + /// + /// Gets mapping of physical patch panel to rack. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rackId")] + public string RackId {get; private set; } + + /// + /// Gets cololocation for ExpressRoute Hybrid Direct. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coloLocation")] + public string ColoLocation {get; private set; } + + /// + /// Gets physical fiber port type. Possible values include: 'LC', 'SC' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectorType")] + public string ConnectorType {get; private set; } + + /// + /// Gets or sets administrative state of the physical port. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "adminState")] + public string AdminState {get; set; } + + /// + /// Gets the provisioning state of the express route link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets macSec configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "macSecConfig")] + public ExpressRouteLinkMacSecConfig MacSecConfig {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringState.cs index 2f58bbd4e777..4c8673b5a9f4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRoutePeeringState. /// + + public static class ExpressRoutePeeringState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringType.cs index f621f7015bc9..2c51985aa60a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePeeringType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRoutePeeringType. /// + + public static class ExpressRoutePeeringType { public const string AzurePublicPeering = "AzurePublicPeering"; public const string AzurePrivatePeering = "AzurePrivatePeering"; public const string MicrosoftPeering = "MicrosoftPeering"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePort.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePort.cs index 33e5462490ff..108cd6dceffd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePort.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePort.cs @@ -1,29 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// ExpressRoute Port + /// ExpressRoutePort resource definition. /// /// /// ExpressRoutePort resource definition. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRoutePort : Resource { /// @@ -37,56 +27,83 @@ public ExpressRoutePort() /// /// Initializes a new instance of the ExpressRoutePort class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The name of the peering location that - /// the ExpressRoutePort is mapped to physically. - /// Bandwidth of procured ports in - /// Gbps. - /// Aggregate Gbps of - /// associated circuit bandwidths. - /// Maximum transmission unit of the physical port - /// pair(s). + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The identity of ExpressRoutePort, if configured. + /// + + /// The provisioning state of the express route port resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The name of the peering location that the ExpressRoutePort is mapped to + /// physically. + /// + + /// Bandwidth of procured ports in Gbps. + /// + + /// Aggregate Gbps of associated circuit bandwidths. + /// + + /// Maximum transmission unit of the physical port pair(s). + /// + /// Encapsulation method on physical ports. - /// Possible values include: 'Dot1Q', 'QinQ' - /// Ether type of the physical port. - /// Date of the physical port allocation - /// to be used in Letter of Authorization. - /// ExpressRouteLink Sub-Resources - /// Reference the ExpressRoute circuit(s) that - /// are provisioned on this ExpressRoutePort resource. - /// The provisioning state of the - /// express route port resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The resource GUID property of the - /// express route port resource. - /// The billing type of the ExpressRoutePort - /// resource. Possible values include: 'MeteredData', - /// 'UnlimitedData' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The identity of ExpressRoutePort, if - /// configured. - public ExpressRoutePort(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string peeringLocation = default(string), int? bandwidthInGbps = default(int?), double? provisionedBandwidthInGbps = default(double?), string mtu = default(string), string encapsulation = default(string), string etherType = default(string), string allocationDate = default(string), IList links = default(IList), IList circuits = default(IList), string provisioningState = default(string), string resourceGuid = default(string), string billingType = default(string), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(id, name, type, location, tags) + /// Possible values include: 'Dot1Q', 'QinQ' + + /// Ether type of the physical port. + /// + + /// Date of the physical port allocation to be used in Letter of Authorization. + /// + + /// The set of physical links of the ExpressRoutePort resource. + /// + + /// Reference the ExpressRoute circuit(s) that are provisioned on this + /// ExpressRoutePort resource. + /// + + /// The resource GUID property of the express route port resource. + /// + + /// The billing type of the ExpressRoutePort resource. + /// Possible values include: 'MeteredData', 'UnlimitedData' + public ExpressRoutePort(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), string peeringLocation = default(string), int? bandwidthInGbps = default(int?), double? provisionedBandwidthInGbps = default(double?), string mtu = default(string), string encapsulation = default(string), string etherType = default(string), string allocationDate = default(string), System.Collections.Generic.IList links = default(System.Collections.Generic.IList), System.Collections.Generic.IList circuits = default(System.Collections.Generic.IList), string resourceGuid = default(string), string billingType = default(string)) + + : base(id, name, type, location, tags) { - PeeringLocation = peeringLocation; - BandwidthInGbps = bandwidthInGbps; - ProvisionedBandwidthInGbps = provisionedBandwidthInGbps; - Mtu = mtu; - Encapsulation = encapsulation; - EtherType = etherType; - AllocationDate = allocationDate; - Links = links; - Circuits = circuits; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; - BillingType = billingType; - Etag = etag; - Identity = identity; + this.Etag = etag; + this.Identity = identity; + this.ProvisioningState = provisioningState; + this.PeeringLocation = peeringLocation; + this.BandwidthInGbps = bandwidthInGbps; + this.ProvisionedBandwidthInGbps = provisionedBandwidthInGbps; + this.Mtu = mtu; + this.Encapsulation = encapsulation; + this.EtherType = etherType; + this.AllocationDate = allocationDate; + this.Links = links; + this.Circuits = circuits; + this.ResourceGuid = resourceGuid; + this.BillingType = billingType; CustomInit(); } @@ -95,100 +112,93 @@ public ExpressRoutePort() /// partial void CustomInit(); + /// - /// Gets or sets the name of the peering location that the - /// ExpressRoutePort is mapped to physically. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.peeringLocation")] - public string PeeringLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets bandwidth of procured ports in Gbps. + /// Gets or sets the identity of ExpressRoutePort, if configured. /// - [JsonProperty(PropertyName = "properties.bandwidthInGbps")] - public int? BandwidthInGbps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// - /// Gets aggregate Gbps of associated circuit bandwidths. + /// Gets the provisioning state of the express route port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisionedBandwidthInGbps")] - public double? ProvisionedBandwidthInGbps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets maximum transmission unit of the physical port pair(s). + /// Gets or sets the name of the peering location that the ExpressRoutePort is + /// mapped to physically. /// - [JsonProperty(PropertyName = "properties.mtu")] - public string Mtu { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringLocation")] + public string PeeringLocation {get; set; } /// - /// Gets or sets encapsulation method on physical ports. Possible - /// values include: 'Dot1Q', 'QinQ' + /// Gets or sets bandwidth of procured ports in Gbps. /// - [JsonProperty(PropertyName = "properties.encapsulation")] - public string Encapsulation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bandwidthInGbps")] + public int? BandwidthInGbps {get; set; } /// - /// Gets ether type of the physical port. + /// Gets aggregate Gbps of associated circuit bandwidths. /// - [JsonProperty(PropertyName = "properties.etherType")] - public string EtherType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionedBandwidthInGbps")] + public double? ProvisionedBandwidthInGbps {get; private set; } /// - /// Gets date of the physical port allocation to be used in Letter of - /// Authorization. + /// Gets maximum transmission unit of the physical port pair(s). /// - [JsonProperty(PropertyName = "properties.allocationDate")] - public string AllocationDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mtu")] + public string Mtu {get; private set; } /// - /// Gets or sets expressRouteLink Sub-Resources + /// Gets or sets encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' /// - /// - /// The set of physical links of the ExpressRoutePort resource. - /// - [JsonProperty(PropertyName = "properties.links")] - public IList Links { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encapsulation")] + public string Encapsulation {get; set; } /// - /// Gets reference the ExpressRoute circuit(s) that are provisioned on - /// this ExpressRoutePort resource. + /// Gets ether type of the physical port. /// - [JsonProperty(PropertyName = "properties.circuits")] - public IList Circuits { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.etherType")] + public string EtherType {get; private set; } /// - /// Gets the provisioning state of the express route port resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets date of the physical port allocation to be used in Letter of + /// Authorization. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allocationDate")] + public string AllocationDate {get; private set; } /// - /// Gets the resource GUID property of the express route port resource. + /// Gets or sets the set of physical links of the ExpressRoutePort resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.links")] + public System.Collections.Generic.IList Links {get; set; } /// - /// Gets or sets the billing type of the ExpressRoutePort resource. - /// Possible values include: 'MeteredData', 'UnlimitedData' + /// Gets reference the ExpressRoute circuit(s) that are provisioned on this + /// ExpressRoutePort resource. /// - [JsonProperty(PropertyName = "properties.billingType")] - public string BillingType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuits")] + public System.Collections.Generic.IList Circuits {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the express route port resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets the identity of ExpressRoutePort, if configured. + /// Gets or sets the billing type of the ExpressRoutePort resource. Possible values include: 'MeteredData', 'UnlimitedData' /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingType")] + public string BillingType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorization.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorization.cs index e0166439196e..f42be0d95ed1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorization.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorization.cs @@ -1,32 +1,23 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// - /// ExpressRoute Port Authorization + /// ExpressRoutePort Authorization resource definition. /// /// /// ExpressRoutePort Authorization resource definition. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRoutePortAuthorization : SubResource { /// - /// Initializes a new instance of the ExpressRoutePortAuthorization - /// class. + /// Initializes a new instance of the ExpressRoutePortAuthorization class. /// public ExpressRoutePortAuthorization() { @@ -34,34 +25,44 @@ public ExpressRoutePortAuthorization() } /// - /// Initializes a new instance of the ExpressRoutePortAuthorization - /// class. + /// Initializes a new instance of the ExpressRoutePortAuthorization class. /// - /// Resource ID. - /// The authorization key. + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the authorization resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The authorization key. + /// + /// The authorization use status. - /// Possible values include: 'Available', 'InUse' - /// The reference to the ExpressRoute - /// circuit resource using the authorization. - /// The provisioning state of the - /// authorization resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public ExpressRoutePortAuthorization(string id = default(string), string authorizationKey = default(string), string authorizationUseStatus = default(string), string circuitResourceUri = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Possible values include: 'Available', 'InUse' + + /// The reference to the ExpressRoute circuit resource using the authorization. + /// + public ExpressRoutePortAuthorization(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string authorizationKey = default(string), string authorizationUseStatus = default(string), string circuitResourceUri = default(string)) + + : base(id) { - AuthorizationKey = authorizationKey; - AuthorizationUseStatus = authorizationUseStatus; - CircuitResourceUri = circuitResourceUri; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AuthorizationKey = authorizationKey; + this.AuthorizationUseStatus = authorizationUseStatus; + this.CircuitResourceUri = circuitResourceUri; CustomInit(); } @@ -70,52 +71,50 @@ public ExpressRoutePortAuthorization() /// partial void CustomInit(); + /// - /// Gets the authorization key. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the authorization use status. Possible values include: - /// 'Available', 'InUse' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.authorizationUseStatus")] - public string AuthorizationUseStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the reference to the ExpressRoute circuit resource using the - /// authorization. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.circuitResourceUri")] - public string CircuitResourceUri { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the authorization resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets the authorization key. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the authorization use status. Possible values include: 'Available', 'InUse' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationUseStatus")] + public string AuthorizationUseStatus {get; private set; } /// - /// Gets type of the resource. + /// Gets the reference to the ExpressRoute circuit resource using the + /// authorization. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuitResourceUri")] + public string CircuitResourceUri {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationPropertiesFormat.cs new file mode 100644 index 000000000000..b013920c6779 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationPropertiesFormat.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ExpressRoutePort Authorization. + /// + /// + /// Properties of ExpressRoutePort Authorization. + /// + public partial class ExpressRoutePortAuthorizationPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRoutePortAuthorizationPropertiesFormat class. + /// + public ExpressRoutePortAuthorizationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRoutePortAuthorizationPropertiesFormat class. + /// + + /// The authorization key. + /// + + /// The authorization use status. + /// Possible values include: 'Available', 'InUse' + + /// The reference to the ExpressRoute circuit resource using the authorization. + /// + + /// The provisioning state of the authorization resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ExpressRoutePortAuthorizationPropertiesFormat(string authorizationKey = default(string), string authorizationUseStatus = default(string), string circuitResourceUri = default(string), string provisioningState = default(string)) + + { + this.AuthorizationKey = authorizationKey; + this.AuthorizationUseStatus = authorizationUseStatus; + this.CircuitResourceUri = circuitResourceUri; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the authorization key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; private set; } + + /// + /// Gets the authorization use status. Possible values include: 'Available', 'InUse' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationUseStatus")] + public string AuthorizationUseStatus {get; private set; } + + /// + /// Gets the reference to the ExpressRoute circuit resource using the + /// authorization. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "circuitResourceUri")] + public string CircuitResourceUri {get; private set; } + + /// + /// Gets the provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationUseStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationUseStatus.cs index 85ce75ff2717..3a88171151f8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationUseStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortAuthorizationUseStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRoutePortAuthorizationUseStatus. /// + + public static class ExpressRoutePortAuthorizationUseStatus { public const string Available = "Available"; public const string InUse = "InUse"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortPropertiesFormat.cs new file mode 100644 index 000000000000..007faa00eac7 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortPropertiesFormat.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties specific to ExpressRoutePort resources. + /// + /// + /// Properties specific to ExpressRoutePort resources. + /// + public partial class ExpressRoutePortPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRoutePortPropertiesFormat class. + /// + public ExpressRoutePortPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRoutePortPropertiesFormat class. + /// + + /// The name of the peering location that the ExpressRoutePort is mapped to + /// physically. + /// + + /// Bandwidth of procured ports in Gbps. + /// + + /// Aggregate Gbps of associated circuit bandwidths. + /// + + /// Maximum transmission unit of the physical port pair(s). + /// + + /// Encapsulation method on physical ports. + /// Possible values include: 'Dot1Q', 'QinQ' + + /// Ether type of the physical port. + /// + + /// Date of the physical port allocation to be used in Letter of Authorization. + /// + + /// The set of physical links of the ExpressRoutePort resource. + /// + + /// Reference the ExpressRoute circuit(s) that are provisioned on this + /// ExpressRoutePort resource. + /// + + /// The provisioning state of the express route port resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The resource GUID property of the express route port resource. + /// + + /// The billing type of the ExpressRoutePort resource. + /// Possible values include: 'MeteredData', 'UnlimitedData' + public ExpressRoutePortPropertiesFormat(string peeringLocation = default(string), int? bandwidthInGbps = default(int?), double? provisionedBandwidthInGbps = default(double?), string mtu = default(string), string encapsulation = default(string), string etherType = default(string), string allocationDate = default(string), System.Collections.Generic.IList links = default(System.Collections.Generic.IList), System.Collections.Generic.IList circuits = default(System.Collections.Generic.IList), string provisioningState = default(string), string resourceGuid = default(string), string billingType = default(string)) + + { + this.PeeringLocation = peeringLocation; + this.BandwidthInGbps = bandwidthInGbps; + this.ProvisionedBandwidthInGbps = provisionedBandwidthInGbps; + this.Mtu = mtu; + this.Encapsulation = encapsulation; + this.EtherType = etherType; + this.AllocationDate = allocationDate; + this.Links = links; + this.Circuits = circuits; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + this.BillingType = billingType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the peering location that the ExpressRoutePort is + /// mapped to physically. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocation")] + public string PeeringLocation {get; set; } + + /// + /// Gets or sets bandwidth of procured ports in Gbps. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthInGbps")] + public int? BandwidthInGbps {get; set; } + + /// + /// Gets aggregate Gbps of associated circuit bandwidths. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionedBandwidthInGbps")] + public double? ProvisionedBandwidthInGbps {get; private set; } + + /// + /// Gets maximum transmission unit of the physical port pair(s). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mtu")] + public string Mtu {get; private set; } + + /// + /// Gets or sets encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encapsulation")] + public string Encapsulation {get; set; } + + /// + /// Gets ether type of the physical port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etherType")] + public string EtherType {get; private set; } + + /// + /// Gets date of the physical port allocation to be used in Letter of + /// Authorization. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allocationDate")] + public string AllocationDate {get; private set; } + + /// + /// Gets or sets the set of physical links of the ExpressRoutePort resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "links")] + public System.Collections.Generic.IList Links {get; set; } + + /// + /// Gets reference the ExpressRoute circuit(s) that are provisioned on this + /// ExpressRoutePort resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "circuits")] + public System.Collections.Generic.IList Circuits {get; private set; } + + /// + /// Gets the provisioning state of the express route port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the resource GUID property of the express route port resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets or sets the billing type of the ExpressRoutePort resource. Possible values include: 'MeteredData', 'UnlimitedData' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "billingType")] + public string BillingType {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsBillingType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsBillingType.cs index 3a290d8a01a1..9decb4d7c4c0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsBillingType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsBillingType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRoutePortsBillingType. /// + + public static class ExpressRoutePortsBillingType { public const string MeteredData = "MeteredData"; public const string UnlimitedData = "UnlimitedData"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsEncapsulation.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsEncapsulation.cs index 370129c94045..b6c2f6628645 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsEncapsulation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsEncapsulation.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExpressRoutePortsEncapsulation. /// + + public static class ExpressRoutePortsEncapsulation { public const string Dot1Q = "Dot1Q"; public const string QinQ = "QinQ"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocation.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocation.cs index d7f1164e9f06..85d3967508b4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocation.cs @@ -1,29 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// ExpressRoutePorts Peering Location + /// Definition of the ExpressRoutePorts peering location resource. /// /// /// Definition of the ExpressRoutePorts peering location resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRoutePortsLocation : Resource { /// @@ -37,25 +27,41 @@ public ExpressRoutePortsLocation() /// /// Initializes a new instance of the ExpressRoutePortsLocation class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Address of peering location. - /// Contact details of peering locations. - /// The inventory of available - /// ExpressRoutePort bandwidths. - /// The provisioning state of the - /// express route port location resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - public ExpressRoutePortsLocation(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string address = default(string), string contact = default(string), IList availableBandwidths = default(IList), string provisioningState = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The provisioning state of the express route port location resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Address of peering location. + /// + + /// Contact details of peering locations. + /// + + /// The inventory of available ExpressRoutePort bandwidths. + /// + public ExpressRoutePortsLocation(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string provisioningState = default(string), string address = default(string), string contact = default(string), System.Collections.Generic.IList availableBandwidths = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - Address = address; - Contact = contact; - AvailableBandwidths = availableBandwidths; - ProvisioningState = provisioningState; + this.ProvisioningState = provisioningState; + this.Address = address; + this.Contact = contact; + this.AvailableBandwidths = availableBandwidths; CustomInit(); } @@ -64,32 +70,29 @@ public ExpressRoutePortsLocation() /// partial void CustomInit(); + /// - /// Gets address of peering location. + /// Gets the provisioning state of the express route port location resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.address")] - public string Address { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets contact details of peering locations. + /// Gets address of peering location. /// - [JsonProperty(PropertyName = "properties.contact")] - public string Contact { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.address")] + public string Address {get; private set; } /// - /// Gets or sets the inventory of available ExpressRoutePort - /// bandwidths. + /// Gets contact details of peering locations. /// - [JsonProperty(PropertyName = "properties.availableBandwidths")] - public IList AvailableBandwidths { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.contact")] + public string Contact {get; private set; } /// - /// Gets the provisioning state of the express route port location - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the inventory of available ExpressRoutePort bandwidths. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availableBandwidths")] + public System.Collections.Generic.IList AvailableBandwidths {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationBandwidths.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationBandwidths.cs index 280e0830ab36..f1272b9f8e51 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationBandwidths.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationBandwidths.cs @@ -1,20 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// ExpressRoutePorts Location Bandwidths + /// Real-time inventory of available ExpressRoute port bandwidths. /// /// /// Real-time inventory of available ExpressRoute port bandwidths. @@ -22,8 +16,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRoutePortsLocationBandwidths { /// - /// Initializes a new instance of the - /// ExpressRoutePortsLocationBandwidths class. + /// Initializes a new instance of the ExpressRoutePortsLocationBandwidths class. /// public ExpressRoutePortsLocationBandwidths() { @@ -31,15 +24,19 @@ public ExpressRoutePortsLocationBandwidths() } /// - /// Initializes a new instance of the - /// ExpressRoutePortsLocationBandwidths class. + /// Initializes a new instance of the ExpressRoutePortsLocationBandwidths class. /// - /// Bandwidth descriptive name. - /// Bandwidth value in Gbps. + + /// Bandwidth descriptive name. + /// + + /// Bandwidth value in Gbps. + /// public ExpressRoutePortsLocationBandwidths(string offerName = default(string), int? valueInGbps = default(int?)) + { - OfferName = offerName; - ValueInGbps = valueInGbps; + this.OfferName = offerName; + this.ValueInGbps = valueInGbps; CustomInit(); } @@ -48,17 +45,17 @@ public ExpressRoutePortsLocationBandwidths() /// partial void CustomInit(); + /// /// Gets bandwidth descriptive name. /// - [JsonProperty(PropertyName = "offerName")] - public string OfferName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offerName")] + public string OfferName {get; private set; } /// /// Gets bandwidth value in Gbps. /// - [JsonProperty(PropertyName = "valueInGbps")] - public int? ValueInGbps { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "valueInGbps")] + public int? ValueInGbps {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationPropertiesFormat.cs new file mode 100644 index 000000000000..94e35fa01150 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRoutePortsLocationPropertiesFormat.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties specific to ExpressRoutePorts peering location resources. + /// + /// + /// Properties specific to ExpressRoutePorts peering location resources. + /// + public partial class ExpressRoutePortsLocationPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRoutePortsLocationPropertiesFormat class. + /// + public ExpressRoutePortsLocationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRoutePortsLocationPropertiesFormat class. + /// + + /// Address of peering location. + /// + + /// Contact details of peering locations. + /// + + /// The inventory of available ExpressRoutePort bandwidths. + /// + + /// The provisioning state of the express route port location resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ExpressRoutePortsLocationPropertiesFormat(string address = default(string), string contact = default(string), System.Collections.Generic.IList availableBandwidths = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Address = address; + this.Contact = contact; + this.AvailableBandwidths = availableBandwidths; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets address of peering location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + public string Address {get; private set; } + + /// + /// Gets contact details of peering locations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "contact")] + public string Contact {get; private set; } + + /// + /// Gets or sets the inventory of available ExpressRoutePort bandwidths. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availableBandwidths")] + public System.Collections.Generic.IList AvailableBandwidths {get; set; } + + /// + /// Gets the provisioning state of the express route port location resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPort.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPort.cs index e7008aafd3bb..431210c6cad7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPort.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPort.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// ExpressRouteProviderPort resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteProviderPort : Resource { /// @@ -34,40 +24,61 @@ public ExpressRouteProviderPort() /// /// Initializes a new instance of the ExpressRouteProviderPort class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The name of the port pair. - /// The name of the primary - /// port. - /// The name of the secondary - /// port. - /// The peering location of the port - /// pair. - /// Overprovisioning factor for the - /// port pair. - /// Bandwidth of the port in - /// Mbps - /// Used Bandwidth of the port in - /// Mbps - /// Remaining Bandwidth of the - /// port in Mbps - /// A unique read-only string that changes whenever - /// the resource is updated. - public ExpressRouteProviderPort(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string portPairDescriptor = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string peeringLocation = default(string), int? overprovisionFactor = default(int?), int? portBandwidthInMbps = default(int?), int? usedBandwidthInMbps = default(int?), int? remainingBandwidthInMbps = default(int?), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The name of the port pair. + /// + + /// The name of the primary port. + /// + + /// The name of the secondary port. + /// + + /// The peering location of the port pair. + /// + + /// Overprovisioning factor for the port pair. + /// + + /// Bandwidth of the port in Mbps + /// + + /// Used Bandwidth of the port in Mbps + /// + + /// Remaining Bandwidth of the port in Mbps + /// + public ExpressRouteProviderPort(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string portPairDescriptor = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string peeringLocation = default(string), int? overprovisionFactor = default(int?), int? portBandwidthInMbps = default(int?), int? usedBandwidthInMbps = default(int?), int? remainingBandwidthInMbps = default(int?)) + + : base(id, name, type, location, tags) { - PortPairDescriptor = portPairDescriptor; - PrimaryAzurePort = primaryAzurePort; - SecondaryAzurePort = secondaryAzurePort; - PeeringLocation = peeringLocation; - OverprovisionFactor = overprovisionFactor; - PortBandwidthInMbps = portBandwidthInMbps; - UsedBandwidthInMbps = usedBandwidthInMbps; - RemainingBandwidthInMbps = remainingBandwidthInMbps; - Etag = etag; + this.Etag = etag; + this.PortPairDescriptor = portPairDescriptor; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.PeeringLocation = peeringLocation; + this.OverprovisionFactor = overprovisionFactor; + this.PortBandwidthInMbps = portBandwidthInMbps; + this.UsedBandwidthInMbps = usedBandwidthInMbps; + this.RemainingBandwidthInMbps = remainingBandwidthInMbps; CustomInit(); } @@ -76,60 +87,60 @@ public ExpressRouteProviderPort() /// partial void CustomInit(); + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + /// /// Gets the name of the port pair. /// - [JsonProperty(PropertyName = "properties.portPairDescriptor")] - public string PortPairDescriptor { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.portPairDescriptor")] + public string PortPairDescriptor {get; private set; } /// /// Gets the name of the primary port. /// - [JsonProperty(PropertyName = "properties.primaryAzurePort")] - public string PrimaryAzurePort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort {get; private set; } /// /// Gets the name of the secondary port. /// - [JsonProperty(PropertyName = "properties.secondaryAzurePort")] - public string SecondaryAzurePort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort {get; private set; } /// /// Gets or sets the peering location of the port pair. /// - [JsonProperty(PropertyName = "properties.peeringLocation")] - public string PeeringLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringLocation")] + public string PeeringLocation {get; set; } /// /// Gets or sets overprovisioning factor for the port pair. /// - [JsonProperty(PropertyName = "properties.overprovisionFactor")] - public int? OverprovisionFactor { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.overprovisionFactor")] + public int? OverprovisionFactor {get; set; } /// /// Gets or sets bandwidth of the port in Mbps /// - [JsonProperty(PropertyName = "properties.portBandwidthInMbps")] - public int? PortBandwidthInMbps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.portBandwidthInMbps")] + public int? PortBandwidthInMbps {get; set; } /// /// Gets or sets used Bandwidth of the port in Mbps /// - [JsonProperty(PropertyName = "properties.usedBandwidthInMbps")] - public int? UsedBandwidthInMbps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usedBandwidthInMbps")] + public int? UsedBandwidthInMbps {get; set; } /// /// Gets or sets remaining Bandwidth of the port in Mbps /// - [JsonProperty(PropertyName = "properties.remainingBandwidthInMbps")] - public int? RemainingBandwidthInMbps { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remainingBandwidthInMbps")] + public int? RemainingBandwidthInMbps {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortListResult.cs index 8ec00b2a8189..c57e12baace8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteProviderPortListResult { /// - /// Initializes a new instance of the - /// ExpressRouteProviderPortListResult class. + /// Initializes a new instance of the ExpressRouteProviderPortListResult class. /// public ExpressRouteProviderPortListResult() { @@ -30,17 +21,19 @@ public ExpressRouteProviderPortListResult() } /// - /// Initializes a new instance of the - /// ExpressRouteProviderPortListResult class. + /// Initializes a new instance of the ExpressRouteProviderPortListResult class. /// - /// A list of ExpressRouteProviderPort - /// resources. - /// The URL to get the next set of - /// results. - public ExpressRouteProviderPortListResult(IList value = default(IList), string nextLink = default(string)) + + /// A list of ExpressRouteProviderPort resources. + /// + + /// The URL to get the next set of results. + /// + public ExpressRouteProviderPortListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +42,17 @@ public ExpressRouteProviderPortListResult() /// partial void CustomInit(); + /// /// Gets or sets a list of ExpressRouteProviderPort resources. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortProperties.cs new file mode 100644 index 000000000000..99769f8a406d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteProviderPortProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ExpressRouteProviderPort. + /// + public partial class ExpressRouteProviderPortProperties + { + /// + /// Initializes a new instance of the ExpressRouteProviderPortProperties class. + /// + public ExpressRouteProviderPortProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteProviderPortProperties class. + /// + + /// The name of the port pair. + /// + + /// The name of the primary port. + /// + + /// The name of the secondary port. + /// + + /// The peering location of the port pair. + /// + + /// Overprovisioning factor for the port pair. + /// + + /// Bandwidth of the port in Mbps + /// + + /// Used Bandwidth of the port in Mbps + /// + + /// Remaining Bandwidth of the port in Mbps + /// + public ExpressRouteProviderPortProperties(string portPairDescriptor = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string peeringLocation = default(string), int? overprovisionFactor = default(int?), int? portBandwidthInMbps = default(int?), int? usedBandwidthInMbps = default(int?), int? remainingBandwidthInMbps = default(int?)) + + { + this.PortPairDescriptor = portPairDescriptor; + this.PrimaryAzurePort = primaryAzurePort; + this.SecondaryAzurePort = secondaryAzurePort; + this.PeeringLocation = peeringLocation; + this.OverprovisionFactor = overprovisionFactor; + this.PortBandwidthInMbps = portBandwidthInMbps; + this.UsedBandwidthInMbps = usedBandwidthInMbps; + this.RemainingBandwidthInMbps = remainingBandwidthInMbps; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the port pair. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "portPairDescriptor")] + public string PortPairDescriptor {get; private set; } + + /// + /// Gets the name of the primary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAzurePort")] + public string PrimaryAzurePort {get; private set; } + + /// + /// Gets the name of the secondary port. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryAzurePort")] + public string SecondaryAzurePort {get; private set; } + + /// + /// Gets or sets the peering location of the port pair. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocation")] + public string PeeringLocation {get; set; } + + /// + /// Gets or sets overprovisioning factor for the port pair. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "overprovisionFactor")] + public int? OverprovisionFactor {get; set; } + + /// + /// Gets or sets bandwidth of the port in Mbps + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "portBandwidthInMbps")] + public int? PortBandwidthInMbps {get; set; } + + /// + /// Gets or sets used Bandwidth of the port in Mbps + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usedBandwidthInMbps")] + public int? UsedBandwidthInMbps {get; set; } + + /// + /// Gets or sets remaining Bandwidth of the port in Mbps + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remainingBandwidthInMbps")] + public int? RemainingBandwidthInMbps {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProvider.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProvider.cs index 2d059ca682cc..e4276fa00c89 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProvider.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProvider.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A ExpressRouteResourceProvider object. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteServiceProvider : Resource { /// - /// Initializes a new instance of the ExpressRouteServiceProvider - /// class. + /// Initializes a new instance of the ExpressRouteServiceProvider class. /// public ExpressRouteServiceProvider() { @@ -33,26 +22,39 @@ public ExpressRouteServiceProvider() } /// - /// Initializes a new instance of the ExpressRouteServiceProvider - /// class. + /// Initializes a new instance of the ExpressRouteServiceProvider class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A list of peering locations. - /// A list of bandwidths - /// offered. - /// The provisioning state of the - /// express route service provider resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList peeringLocations = default(IList), IList bandwidthsOffered = default(IList), string provisioningState = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The provisioning state of the express route service provider resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A list of peering locations. + /// + + /// A list of bandwidths offered. + /// + public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string provisioningState = default(string), System.Collections.Generic.IList peeringLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList bandwidthsOffered = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - PeeringLocations = peeringLocations; - BandwidthsOffered = bandwidthsOffered; - ProvisioningState = provisioningState; + this.ProvisioningState = provisioningState; + this.PeeringLocations = peeringLocations; + this.BandwidthsOffered = bandwidthsOffered; CustomInit(); } @@ -61,25 +63,23 @@ public ExpressRouteServiceProvider() /// partial void CustomInit(); + /// - /// Gets or sets a list of peering locations. + /// Gets the provisioning state of the express route service provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.peeringLocations")] - public IList PeeringLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets a list of bandwidths offered. + /// Gets or sets a list of peering locations. /// - [JsonProperty(PropertyName = "properties.bandwidthsOffered")] - public IList BandwidthsOffered { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringLocations")] + public System.Collections.Generic.IList PeeringLocations {get; set; } /// - /// Gets the provisioning state of the express route service provider - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets a list of bandwidths offered. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bandwidthsOffered")] + public System.Collections.Generic.IList BandwidthsOffered {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs index 33ab66956f30..989f346fe642 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ExpressRouteServiceProviderBandwidthsOffered { /// - /// Initializes a new instance of the - /// ExpressRouteServiceProviderBandwidthsOffered class. + /// Initializes a new instance of the ExpressRouteServiceProviderBandwidthsOffered class. /// public ExpressRouteServiceProviderBandwidthsOffered() { @@ -28,15 +21,19 @@ public ExpressRouteServiceProviderBandwidthsOffered() } /// - /// Initializes a new instance of the - /// ExpressRouteServiceProviderBandwidthsOffered class. + /// Initializes a new instance of the ExpressRouteServiceProviderBandwidthsOffered class. /// - /// The OfferName. - /// The ValueInMbps. + + /// The OfferName. + /// + + /// The ValueInMbps. + /// public ExpressRouteServiceProviderBandwidthsOffered(string offerName = default(string), int? valueInMbps = default(int?)) + { - OfferName = offerName; - ValueInMbps = valueInMbps; + this.OfferName = offerName; + this.ValueInMbps = valueInMbps; CustomInit(); } @@ -45,17 +42,17 @@ public ExpressRouteServiceProviderBandwidthsOffered() /// partial void CustomInit(); + /// /// Gets or sets the OfferName. /// - [JsonProperty(PropertyName = "offerName")] - public string OfferName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offerName")] + public string OfferName {get; set; } /// /// Gets or sets the ValueInMbps. /// - [JsonProperty(PropertyName = "valueInMbps")] - public int? ValueInMbps { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "valueInMbps")] + public int? ValueInMbps {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderPropertiesFormat.cs new file mode 100644 index 000000000000..16a906d5ed4c --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExpressRouteServiceProviderPropertiesFormat.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ExpressRouteServiceProvider. + /// + public partial class ExpressRouteServiceProviderPropertiesFormat + { + /// + /// Initializes a new instance of the ExpressRouteServiceProviderPropertiesFormat class. + /// + public ExpressRouteServiceProviderPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteServiceProviderPropertiesFormat class. + /// + + /// A list of peering locations. + /// + + /// A list of bandwidths offered. + /// + + /// The provisioning state of the express route service provider resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ExpressRouteServiceProviderPropertiesFormat(System.Collections.Generic.IList peeringLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList bandwidthsOffered = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.PeeringLocations = peeringLocations; + this.BandwidthsOffered = bandwidthsOffered; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a list of peering locations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocations")] + public System.Collections.Generic.IList PeeringLocations {get; set; } + + /// + /// Gets or sets a list of bandwidths offered. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthsOffered")] + public System.Collections.Generic.IList BandwidthsOffered {get; set; } + + /// + /// Gets the provisioning state of the express route service provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocation.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocation.cs index 7456d0919b8f..2417e6a519c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ExtendedLocation() /// /// Initializes a new instance of the ExtendedLocation class. /// - /// The name of the extended location. - /// The type of the extended location. Possible - /// values include: 'EdgeZone' + + /// The name of the extended location. + /// + + /// The type of the extended location. + /// Possible values include: 'EdgeZone' public ExtendedLocation(string name = default(string), string type = default(string)) + { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -44,18 +42,17 @@ public ExtendedLocation() /// partial void CustomInit(); + /// /// Gets or sets the name of the extended location. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the type of the extended location. Possible values - /// include: 'EdgeZone' + /// Gets or sets the type of the extended location. Possible values include: 'EdgeZone' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocationTypes.cs b/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocationTypes.cs index b6a45ceb1bdf..1a994ffc5279 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocationTypes.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ExtendedLocationTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ExtendedLocationTypes. /// + + public static class ExtendedLocationTypes { public const string EdgeZone = "EdgeZone"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FilterItems.cs b/src/Network/Network.Management.Sdk/Generated/Models/FilterItems.cs index 43dcbe2eb09a..9417bc0ba355 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FilterItems.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FilterItems.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,17 @@ public FilterItems() /// /// Initializes a new instance of the FilterItems class. /// - /// The name of the field we would like to - /// filter - /// List of values to filter the current field - /// by - public FilterItems(string field = default(string), IList values = default(IList)) + + /// The name of the field we would like to filter + /// + + /// List of values to filter the current field by + /// + public FilterItems(string field = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + { - Field = field; - Values = values; + this.Field = field; + this.Values = values; CustomInit(); } @@ -47,17 +42,17 @@ public FilterItems() /// partial void CustomInit(); + /// /// Gets or sets the name of the field we would like to filter /// - [JsonProperty(PropertyName = "field")] - public string Field { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "field")] + public string Field {get; set; } /// /// Gets or sets list of values to filter the current field by /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParameters.cs index 3f55e88be014..551048c1ddfa 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParameters.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Azure Firewall Packet Capture Parameters resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FirewallPacketCaptureParameters : SubResource { /// - /// Initializes a new instance of the FirewallPacketCaptureParameters - /// class. + /// Initializes a new instance of the FirewallPacketCaptureParameters class. /// public FirewallPacketCaptureParameters() { @@ -33,32 +22,43 @@ public FirewallPacketCaptureParameters() } /// - /// Initializes a new instance of the FirewallPacketCaptureParameters - /// class. + /// Initializes a new instance of the FirewallPacketCaptureParameters class. /// - /// Resource ID. - /// Duration of packet capture in - /// seconds. - /// Number of packets to be - /// captured. - /// Upload capture location - /// Name of file to be uploaded to - /// sasURL - /// The protocol of packets to capture. Possible - /// values include: 'TCP', 'UDP', 'Any', 'ICMP' - /// The tcp-flag type to be captured. Used with - /// protocol TCP - /// Rules to filter packet captures. - public FirewallPacketCaptureParameters(string id = default(string), int? durationInSeconds = default(int?), int? numberOfPacketsToCapture = default(int?), string sasUrl = default(string), string fileName = default(string), string protocol = default(string), IList flags = default(IList), IList filters = default(IList)) - : base(id) + + /// Resource ID. + /// + + /// Duration of packet capture in seconds. + /// + + /// Number of packets to be captured. + /// + + /// Upload capture location + /// + + /// Name of file to be uploaded to sasURL + /// + + /// The protocol of packets to capture + /// Possible values include: 'TCP', 'UDP', 'Any', 'ICMP' + + /// The tcp-flag type to be captured. Used with protocol TCP + /// + + /// Rules to filter packet captures. + /// + public FirewallPacketCaptureParameters(string id = default(string), int? durationInSeconds = default(int?), int? numberOfPacketsToCapture = default(int?), string sasUrl = default(string), string fileName = default(string), string protocol = default(string), System.Collections.Generic.IList flags = default(System.Collections.Generic.IList), System.Collections.Generic.IList filters = default(System.Collections.Generic.IList)) + + : base(id) { - DurationInSeconds = durationInSeconds; - NumberOfPacketsToCapture = numberOfPacketsToCapture; - SasUrl = sasUrl; - FileName = fileName; - Protocol = protocol; - Flags = flags; - Filters = filters; + this.DurationInSeconds = durationInSeconds; + this.NumberOfPacketsToCapture = numberOfPacketsToCapture; + this.SasUrl = sasUrl; + this.FileName = fileName; + this.Protocol = protocol; + this.Flags = flags; + this.Filters = filters; CustomInit(); } @@ -67,80 +67,83 @@ public FirewallPacketCaptureParameters() /// partial void CustomInit(); + /// /// Gets or sets duration of packet capture in seconds. /// - [JsonProperty(PropertyName = "properties.durationInSeconds")] - public int? DurationInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.durationInSeconds")] + public int? DurationInSeconds {get; set; } /// /// Gets or sets number of packets to be captured. /// - [JsonProperty(PropertyName = "properties.numberOfPacketsToCapture")] - public int? NumberOfPacketsToCapture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.numberOfPacketsToCapture")] + public int? NumberOfPacketsToCapture {get; set; } /// /// Gets or sets upload capture location /// - [JsonProperty(PropertyName = "properties.sasUrl")] - public string SasUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sasUrl")] + public string SasUrl {get; set; } /// /// Gets or sets name of file to be uploaded to sasURL /// - [JsonProperty(PropertyName = "properties.fileName")] - public string FileName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fileName")] + public string FileName {get; set; } /// - /// Gets or sets the protocol of packets to capture. Possible values - /// include: 'TCP', 'UDP', 'Any', 'ICMP' + /// Gets or sets the protocol of packets to capture Possible values include: 'TCP', 'UDP', 'Any', 'ICMP' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets the tcp-flag type to be captured. Used with protocol - /// TCP + /// Gets or sets the tcp-flag type to be captured. Used with protocol TCP /// - [JsonProperty(PropertyName = "properties.flags")] - public IList Flags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flags")] + public System.Collections.Generic.IList Flags {get; set; } /// /// Gets or sets rules to filter packet captures. /// - [JsonProperty(PropertyName = "properties.filters")] - public IList Filters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.filters")] + public System.Collections.Generic.IList Filters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DurationInSeconds != null) + if (this.DurationInSeconds != null) { - if (DurationInSeconds > 1800) + if (this.DurationInSeconds > 1800) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "DurationInSeconds", 1800); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "DurationInSeconds", 1800); } - if (DurationInSeconds < 30) + if (this.DurationInSeconds < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DurationInSeconds", 30); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "DurationInSeconds", 30); } } - if (NumberOfPacketsToCapture != null) + if (this.NumberOfPacketsToCapture != null) { - if (NumberOfPacketsToCapture > 90000) + if (this.NumberOfPacketsToCapture > 90000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "NumberOfPacketsToCapture", 90000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "NumberOfPacketsToCapture", 90000); } - if (NumberOfPacketsToCapture < 100) + if (this.NumberOfPacketsToCapture < 100) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "NumberOfPacketsToCapture", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "NumberOfPacketsToCapture", 100); } } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParametersFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParametersFormat.cs new file mode 100644 index 000000000000..c478fe660de2 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPacketCaptureParametersFormat.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Packet capture parameters on azure firewall. + /// + public partial class FirewallPacketCaptureParametersFormat + { + /// + /// Initializes a new instance of the FirewallPacketCaptureParametersFormat class. + /// + public FirewallPacketCaptureParametersFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FirewallPacketCaptureParametersFormat class. + /// + + /// Duration of packet capture in seconds. + /// + + /// Number of packets to be captured. + /// + + /// Upload capture location + /// + + /// Name of file to be uploaded to sasURL + /// + + /// The protocol of packets to capture + /// Possible values include: 'TCP', 'UDP', 'Any', 'ICMP' + + /// The tcp-flag type to be captured. Used with protocol TCP + /// + + /// Rules to filter packet captures. + /// + public FirewallPacketCaptureParametersFormat(int? durationInSeconds = default(int?), int? numberOfPacketsToCapture = default(int?), string sasUrl = default(string), string fileName = default(string), string protocol = default(string), System.Collections.Generic.IList flags = default(System.Collections.Generic.IList), System.Collections.Generic.IList filters = default(System.Collections.Generic.IList)) + + { + this.DurationInSeconds = durationInSeconds; + this.NumberOfPacketsToCapture = numberOfPacketsToCapture; + this.SasUrl = sasUrl; + this.FileName = fileName; + this.Protocol = protocol; + this.Flags = flags; + this.Filters = filters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets duration of packet capture in seconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "durationInSeconds")] + public int? DurationInSeconds {get; set; } + + /// + /// Gets or sets number of packets to be captured. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "numberOfPacketsToCapture")] + public int? NumberOfPacketsToCapture {get; set; } + + /// + /// Gets or sets upload capture location + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sasUrl")] + public string SasUrl {get; set; } + + /// + /// Gets or sets name of file to be uploaded to sasURL + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fileName")] + public string FileName {get; set; } + + /// + /// Gets or sets the protocol of packets to capture Possible values include: 'TCP', 'UDP', 'Any', 'ICMP' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets the tcp-flag type to be captured. Used with protocol TCP + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flags")] + public System.Collections.Generic.IList Flags {get; set; } + + /// + /// Gets or sets rules to filter packet captures. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "filters")] + public System.Collections.Generic.IList Filters {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.DurationInSeconds != null) + { + if (this.DurationInSeconds > 1800) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "DurationInSeconds", 1800); + } + if (this.DurationInSeconds < 30) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "DurationInSeconds", 30); + } + } + if (this.NumberOfPacketsToCapture != null) + { + if (this.NumberOfPacketsToCapture > 90000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "NumberOfPacketsToCapture", 90000); + } + if (this.NumberOfPacketsToCapture < 100) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "NumberOfPacketsToCapture", 100); + } + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicy.cs index 4b2ff130fd44..786468a51a6c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicy.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// FirewallPolicy Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FirewallPolicy : Resource { /// @@ -34,65 +24,99 @@ public FirewallPolicy() /// /// Initializes a new instance of the FirewallPolicy class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A read-only string that represents the size of - /// the FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) - /// List of references to - /// FirewallPolicyRuleCollectionGroups. - /// The provisioning state of the - /// firewall policy resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The parent firewall policy from which - /// rules are inherited. - /// List of references to Azure Firewalls that - /// this Firewall Policy is associated with. - /// List of references to Child Firewall - /// Policies. - /// The operation mode for Threat - /// Intelligence. Possible values include: 'Alert', 'Deny', - /// 'Off' - /// ThreatIntel Whitelist for - /// Firewall Policy. - /// Insights on Firewall Policy. - /// The private IP addresses/IP ranges to which - /// traffic will not be SNAT. - /// SQL Settings definition. - /// DNS Proxy Settings definition. - /// Explicit Proxy Settings - /// definition. - /// The configuration for Intrusion - /// detection. - /// TLS Configuration - /// definition. - /// The Firewall Policy SKU. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The identity of the firewall policy. - public FirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string size = default(string), IList ruleCollectionGroups = default(IList), string provisioningState = default(string), SubResource basePolicy = default(SubResource), IList firewalls = default(IList), IList childPolicies = default(IList), string threatIntelMode = default(string), FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default(FirewallPolicyThreatIntelWhitelist), FirewallPolicyInsights insights = default(FirewallPolicyInsights), FirewallPolicySNAT snat = default(FirewallPolicySNAT), FirewallPolicySQL sql = default(FirewallPolicySQL), DnsSettings dnsSettings = default(DnsSettings), ExplicitProxy explicitProxy = default(ExplicitProxy), FirewallPolicyIntrusionDetection intrusionDetection = default(FirewallPolicyIntrusionDetection), FirewallPolicyTransportSecurity transportSecurity = default(FirewallPolicyTransportSecurity), FirewallPolicySku sku = default(FirewallPolicySku), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The identity of the firewall policy. + /// + + /// The provisioning state of the firewall policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// DNS Proxy Settings definition. + /// + + /// Explicit Proxy Settings definition. + /// + + /// A read-only string that represents the size of the + /// FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) + /// + + /// List of references to FirewallPolicyRuleCollectionGroups. + /// + + /// The parent firewall policy from which rules are inherited. + /// + + /// List of references to Azure Firewalls that this Firewall Policy is + /// associated with. + /// + + /// List of references to Child Firewall Policies. + /// + + /// The operation mode for Threat Intelligence. + /// Possible values include: 'Alert', 'Deny', 'Off' + + /// ThreatIntel Whitelist for Firewall Policy. + /// + + /// Insights on Firewall Policy. + /// + + /// The private IP addresses/IP ranges to which traffic will not be SNAT. + /// + + /// SQL Settings definition. + /// + + /// The configuration for Intrusion detection. + /// + + /// TLS Configuration definition. + /// + + /// The Firewall Policy SKU. + /// + public FirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), DnsSettings dnsSettings = default(DnsSettings), ExplicitProxy explicitProxy = default(ExplicitProxy), string size = default(string), System.Collections.Generic.IList ruleCollectionGroups = default(System.Collections.Generic.IList), SubResource basePolicy = default(SubResource), System.Collections.Generic.IList firewalls = default(System.Collections.Generic.IList), System.Collections.Generic.IList childPolicies = default(System.Collections.Generic.IList), string threatIntelMode = default(string), FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default(FirewallPolicyThreatIntelWhitelist), FirewallPolicyInsights insights = default(FirewallPolicyInsights), FirewallPolicySnat snat = default(FirewallPolicySnat), FirewallPolicySQL sql = default(FirewallPolicySQL), FirewallPolicyIntrusionDetection intrusionDetection = default(FirewallPolicyIntrusionDetection), FirewallPolicyTransportSecurity transportSecurity = default(FirewallPolicyTransportSecurity), FirewallPolicySku sku = default(FirewallPolicySku)) + + : base(id, name, type, location, tags) { - Size = size; - RuleCollectionGroups = ruleCollectionGroups; - ProvisioningState = provisioningState; - BasePolicy = basePolicy; - Firewalls = firewalls; - ChildPolicies = childPolicies; - ThreatIntelMode = threatIntelMode; - ThreatIntelWhitelist = threatIntelWhitelist; - Insights = insights; - Snat = snat; - Sql = sql; - DnsSettings = dnsSettings; - ExplicitProxy = explicitProxy; - IntrusionDetection = intrusionDetection; - TransportSecurity = transportSecurity; - Sku = sku; - Etag = etag; - Identity = identity; + this.Etag = etag; + this.Identity = identity; + this.ProvisioningState = provisioningState; + this.DnsSettings = dnsSettings; + this.ExplicitProxy = explicitProxy; + this.Size = size; + this.RuleCollectionGroups = ruleCollectionGroups; + this.BasePolicy = basePolicy; + this.Firewalls = firewalls; + this.ChildPolicies = childPolicies; + this.ThreatIntelMode = threatIntelMode; + this.ThreatIntelWhitelist = threatIntelWhitelist; + this.Insights = insights; + this.Snat = snat; + this.Sql = sql; + this.IntrusionDetection = intrusionDetection; + this.TransportSecurity = transportSecurity; + this.Sku = sku; CustomInit(); } @@ -101,134 +125,147 @@ public FirewallPolicy() /// partial void CustomInit(); + /// - /// Gets a read-only string that represents the size of the - /// FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets list of references to FirewallPolicyRuleCollectionGroups. + /// Gets or sets the identity of the firewall policy. /// - [JsonProperty(PropertyName = "properties.ruleCollectionGroups")] - public IList RuleCollectionGroups { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// - /// Gets the provisioning state of the firewall policy resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the firewall policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the parent firewall policy from which rules are - /// inherited. + /// Gets or sets dNS Proxy Settings definition. /// - [JsonProperty(PropertyName = "properties.basePolicy")] - public SubResource BasePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public DnsSettings DnsSettings {get; set; } /// - /// Gets list of references to Azure Firewalls that this Firewall - /// Policy is associated with. + /// Gets or sets explicit Proxy Settings definition. /// - [JsonProperty(PropertyName = "properties.firewalls")] - public IList Firewalls { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.explicitProxy")] + public ExplicitProxy ExplicitProxy {get; set; } /// - /// Gets list of references to Child Firewall Policies. + /// Gets a read-only string that represents the size of the + /// FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) /// - [JsonProperty(PropertyName = "properties.childPolicies")] - public IList ChildPolicies { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public string Size {get; private set; } /// - /// Gets or sets the operation mode for Threat Intelligence. Possible - /// values include: 'Alert', 'Deny', 'Off' + /// Gets list of references to FirewallPolicyRuleCollectionGroups. /// - [JsonProperty(PropertyName = "properties.threatIntelMode")] - public string ThreatIntelMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleCollectionGroups")] + public System.Collections.Generic.IList RuleCollectionGroups {get; private set; } /// - /// Gets or sets threatIntel Whitelist for Firewall Policy. + /// Gets or sets the parent firewall policy from which rules are inherited. /// - [JsonProperty(PropertyName = "properties.threatIntelWhitelist")] - public FirewallPolicyThreatIntelWhitelist ThreatIntelWhitelist { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.basePolicy")] + public SubResource BasePolicy {get; set; } /// - /// Gets or sets insights on Firewall Policy. + /// Gets list of references to Azure Firewalls that this Firewall Policy is + /// associated with. /// - [JsonProperty(PropertyName = "properties.insights")] - public FirewallPolicyInsights Insights { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewalls")] + public System.Collections.Generic.IList Firewalls {get; private set; } /// - /// Gets or sets the private IP addresses/IP ranges to which traffic - /// will not be SNAT. + /// Gets list of references to Child Firewall Policies. /// - [JsonProperty(PropertyName = "properties.snat")] - public FirewallPolicySNAT Snat { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.childPolicies")] + public System.Collections.Generic.IList ChildPolicies {get; private set; } /// - /// Gets or sets SQL Settings definition. + /// Gets or sets the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off' /// - [JsonProperty(PropertyName = "properties.sql")] - public FirewallPolicySQL Sql { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.threatIntelMode")] + public string ThreatIntelMode {get; set; } /// - /// Gets or sets DNS Proxy Settings definition. + /// Gets or sets threatIntel Whitelist for Firewall Policy. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public DnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.threatIntelWhitelist")] + public FirewallPolicyThreatIntelWhitelist ThreatIntelWhitelist {get; set; } /// - /// Gets or sets explicit Proxy Settings definition. + /// Gets or sets insights on Firewall Policy. /// - [JsonProperty(PropertyName = "properties.explicitProxy")] - public ExplicitProxy ExplicitProxy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.insights")] + public FirewallPolicyInsights Insights {get; set; } /// - /// Gets or sets the configuration for Intrusion detection. + /// Gets or sets the private IP addresses/IP ranges to which traffic will not + /// be SNAT. /// - [JsonProperty(PropertyName = "properties.intrusionDetection")] - public FirewallPolicyIntrusionDetection IntrusionDetection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snat")] + public FirewallPolicySnat Snat {get; set; } /// - /// Gets or sets TLS Configuration definition. + /// Gets or sets sQL Settings definition. /// - [JsonProperty(PropertyName = "properties.transportSecurity")] - public FirewallPolicyTransportSecurity TransportSecurity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sql")] + public FirewallPolicySQL Sql {get; set; } /// - /// Gets or sets the Firewall Policy SKU. + /// Gets or sets the configuration for Intrusion detection. /// - [JsonProperty(PropertyName = "properties.sku")] - public FirewallPolicySku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.intrusionDetection")] + public FirewallPolicyIntrusionDetection IntrusionDetection {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets tLS Configuration definition. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.transportSecurity")] + public FirewallPolicyTransportSecurity TransportSecurity {get; set; } /// - /// Gets or sets the identity of the firewall policy. + /// Gets or sets the Firewall Policy SKU. /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public FirewallPolicySku Sku {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ExplicitProxy != null) + + + + + if (this.ExplicitProxy != null) { - ExplicitProxy.Validate(); + this.ExplicitProxy.Validate(); } + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyCertificateAuthority.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyCertificateAuthority.cs index 8d33e63068b0..9ce9ecaaf5f1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyCertificateAuthority.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyCertificateAuthority.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyCertificateAuthority { /// - /// Initializes a new instance of the - /// FirewallPolicyCertificateAuthority class. + /// Initializes a new instance of the FirewallPolicyCertificateAuthority class. /// public FirewallPolicyCertificateAuthority() { @@ -28,17 +21,20 @@ public FirewallPolicyCertificateAuthority() } /// - /// Initializes a new instance of the - /// FirewallPolicyCertificateAuthority class. + /// Initializes a new instance of the FirewallPolicyCertificateAuthority class. /// - /// Secret Id of (base-64 encoded - /// unencrypted pfx) 'Secret' or 'Certificate' object stored in - /// KeyVault. - /// Name of the CA certificate. + + /// Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + /// object stored in KeyVault. + /// + + /// Name of the CA certificate. + /// public FirewallPolicyCertificateAuthority(string keyVaultSecretId = default(string), string name = default(string)) + { - KeyVaultSecretId = keyVaultSecretId; - Name = name; + this.KeyVaultSecretId = keyVaultSecretId; + this.Name = name; CustomInit(); } @@ -47,18 +43,18 @@ public FirewallPolicyCertificateAuthority() /// partial void CustomInit(); + /// - /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) - /// 'Secret' or 'Certificate' object stored in KeyVault. + /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + /// 'Certificate' object stored in KeyVault. /// - [JsonProperty(PropertyName = "keyVaultSecretId")] - public string KeyVaultSecretId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultSecretId")] + public string KeyVaultSecretId {get; set; } /// /// Gets or sets name of the CA certificate. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollection.cs index 2184add4699b..d08eed745753 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollection.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyFilterRuleCollection : FirewallPolicyRuleCollection { /// - /// Initializes a new instance of the - /// FirewallPolicyFilterRuleCollection class. + /// Initializes a new instance of the FirewallPolicyFilterRuleCollection class. /// public FirewallPolicyFilterRuleCollection() { @@ -31,21 +22,26 @@ public FirewallPolicyFilterRuleCollection() } /// - /// Initializes a new instance of the - /// FirewallPolicyFilterRuleCollection class. + /// Initializes a new instance of the FirewallPolicyFilterRuleCollection class. /// - /// The name of the rule collection. - /// Priority of the Firewall Policy Rule - /// Collection resource. - /// The action type of a Filter rule - /// collection. - /// List of rules included in a rule - /// collection. - public FirewallPolicyFilterRuleCollection(string name = default(string), int? priority = default(int?), FirewallPolicyFilterRuleCollectionAction action = default(FirewallPolicyFilterRuleCollectionAction), IList rules = default(IList)) - : base(name, priority) + + /// The name of the rule collection. + /// + + /// Priority of the Firewall Policy Rule Collection resource. + /// + + /// The action type of a Filter rule collection. + /// + + /// List of rules included in a rule collection. + /// + public FirewallPolicyFilterRuleCollection(string name = default(string), int? priority = default(int?), FirewallPolicyFilterRuleCollectionAction action = default(FirewallPolicyFilterRuleCollectionAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(name, priority) { - Action = action; - Rules = rules; + this.Action = action; + this.Rules = rules; CustomInit(); } @@ -54,27 +50,29 @@ public FirewallPolicyFilterRuleCollection() /// partial void CustomInit(); + /// /// Gets or sets the action type of a Filter rule collection. /// - [JsonProperty(PropertyName = "action")] - public FirewallPolicyFilterRuleCollectionAction Action { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public FirewallPolicyFilterRuleCollectionAction Action {get; set; } /// /// Gets or sets list of rules included in a rule collection. /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionAction.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionAction.cs index 82c1814c4621..874bcd6b36a1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionAction.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionAction.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyFilterRuleCollectionAction { /// - /// Initializes a new instance of the - /// FirewallPolicyFilterRuleCollectionAction class. + /// Initializes a new instance of the FirewallPolicyFilterRuleCollectionAction class. /// public FirewallPolicyFilterRuleCollectionAction() { @@ -28,14 +21,15 @@ public FirewallPolicyFilterRuleCollectionAction() } /// - /// Initializes a new instance of the - /// FirewallPolicyFilterRuleCollectionAction class. + /// Initializes a new instance of the FirewallPolicyFilterRuleCollectionAction class. /// - /// The type of action. Possible values include: - /// 'Allow', 'Deny' + + /// The type of action. + /// Possible values include: 'Allow', 'Deny' public FirewallPolicyFilterRuleCollectionAction(string type = default(string)) + { - Type = type; + this.Type = type; CustomInit(); } @@ -44,12 +38,11 @@ public FirewallPolicyFilterRuleCollectionAction() /// partial void CustomInit(); + /// - /// Gets or sets the type of action. Possible values include: 'Allow', - /// 'Deny' + /// Gets or sets the type of action. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionActionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionActionType.cs index c2d58f1b9877..de48b4e2c79c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionActionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyFilterRuleCollectionActionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyFilterRuleCollectionActionType. /// + + public static class FirewallPolicyFilterRuleCollectionActionType { public const string Allow = "Allow"; public const string Deny = "Deny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyHttpHeaderToInsert.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyHttpHeaderToInsert.cs index 457ba0b1524b..ce6d2938a84b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyHttpHeaderToInsert.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyHttpHeaderToInsert.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyHttpHeaderToInsert { /// - /// Initializes a new instance of the FirewallPolicyHttpHeaderToInsert - /// class. + /// Initializes a new instance of the FirewallPolicyHttpHeaderToInsert class. /// public FirewallPolicyHttpHeaderToInsert() { @@ -28,15 +21,19 @@ public FirewallPolicyHttpHeaderToInsert() } /// - /// Initializes a new instance of the FirewallPolicyHttpHeaderToInsert - /// class. + /// Initializes a new instance of the FirewallPolicyHttpHeaderToInsert class. /// - /// Contains the name of the header - /// Contains the value of the header + + /// Contains the name of the header + /// + + /// Contains the value of the header + /// public FirewallPolicyHttpHeaderToInsert(string headerName = default(string), string headerValue = default(string)) + { - HeaderName = headerName; - HeaderValue = headerValue; + this.HeaderName = headerName; + this.HeaderValue = headerValue; CustomInit(); } @@ -45,17 +42,17 @@ public FirewallPolicyHttpHeaderToInsert() /// partial void CustomInit(); + /// /// Gets or sets contains the name of the header /// - [JsonProperty(PropertyName = "headerName")] - public string HeaderName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "headerName")] + public string HeaderName {get; set; } /// /// Gets or sets contains the value of the header /// - [JsonProperty(PropertyName = "headerValue")] - public string HeaderValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "headerValue")] + public string HeaderValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIDPSQuerySortOrder.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIDPSQuerySortOrder.cs index 5e531066ca96..52ebf8186949 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIDPSQuerySortOrder.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIDPSQuerySortOrder.cs @@ -1,22 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for FirewallPolicyIDPSQuerySortOrder. + /// Defines values for FirewallPolicyIdpsQuerySortOrder. /// - public static class FirewallPolicyIDPSQuerySortOrder + + + public static class FirewallPolicyIdpsQuerySortOrder { public const string Ascending = "Ascending"; public const string Descending = "Descending"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureDirection.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureDirection.cs new file mode 100644 index 000000000000..25febd83bc73 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureDirection.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for FirewallPolicyIdpsSignatureDirection. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum FirewallPolicyIdpsSignatureDirection + { + [System.Runtime.Serialization.EnumMember(Value = "0")] + Zero, + [System.Runtime.Serialization.EnumMember(Value = "1")] + One, + [System.Runtime.Serialization.EnumMember(Value = "2")] + Two, + [System.Runtime.Serialization.EnumMember(Value = "3")] + Three, + [System.Runtime.Serialization.EnumMember(Value = "4")] + Four + } + internal static class FirewallPolicyIdpsSignatureDirectionEnumExtension + { + internal static string ToSerializedValue(this FirewallPolicyIdpsSignatureDirection? value) + { + return value == null ? null : ((FirewallPolicyIdpsSignatureDirection)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this FirewallPolicyIdpsSignatureDirection value) + { + switch( value ) + { + case FirewallPolicyIdpsSignatureDirection.Zero: + return "0"; + case FirewallPolicyIdpsSignatureDirection.One: + return "1"; + case FirewallPolicyIdpsSignatureDirection.Two: + return "2"; + case FirewallPolicyIdpsSignatureDirection.Three: + return "3"; + case FirewallPolicyIdpsSignatureDirection.Four: + return "4"; + } + return null; + } + internal static FirewallPolicyIdpsSignatureDirection? ParseFirewallPolicyIdpsSignatureDirection(this string value) + { + switch( value ) + { + case "0": + return FirewallPolicyIdpsSignatureDirection.Zero; + case "1": + return FirewallPolicyIdpsSignatureDirection.One; + case "2": + return FirewallPolicyIdpsSignatureDirection.Two; + case "3": + return FirewallPolicyIdpsSignatureDirection.Three; + case "4": + return FirewallPolicyIdpsSignatureDirection.Four; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureMode.cs new file mode 100644 index 000000000000..a16b060adbea --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureMode.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for FirewallPolicyIdpsSignatureMode. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum FirewallPolicyIdpsSignatureMode + { + [System.Runtime.Serialization.EnumMember(Value = "0")] + Zero, + [System.Runtime.Serialization.EnumMember(Value = "1")] + One, + [System.Runtime.Serialization.EnumMember(Value = "2")] + Two + } + internal static class FirewallPolicyIdpsSignatureModeEnumExtension + { + internal static string ToSerializedValue(this FirewallPolicyIdpsSignatureMode? value) + { + return value == null ? null : ((FirewallPolicyIdpsSignatureMode)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this FirewallPolicyIdpsSignatureMode value) + { + switch( value ) + { + case FirewallPolicyIdpsSignatureMode.Zero: + return "0"; + case FirewallPolicyIdpsSignatureMode.One: + return "1"; + case FirewallPolicyIdpsSignatureMode.Two: + return "2"; + } + return null; + } + internal static FirewallPolicyIdpsSignatureMode? ParseFirewallPolicyIdpsSignatureMode(this string value) + { + switch( value ) + { + case "0": + return FirewallPolicyIdpsSignatureMode.Zero; + case "1": + return FirewallPolicyIdpsSignatureMode.One; + case "2": + return FirewallPolicyIdpsSignatureMode.Two; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureSeverity.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureSeverity.cs new file mode 100644 index 000000000000..2ebfdeb27eb3 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIdpsSignatureSeverity.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for FirewallPolicyIdpsSignatureSeverity. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum FirewallPolicyIdpsSignatureSeverity + { + [System.Runtime.Serialization.EnumMember(Value = "1")] + One, + [System.Runtime.Serialization.EnumMember(Value = "2")] + Two, + [System.Runtime.Serialization.EnumMember(Value = "3")] + Three + } + internal static class FirewallPolicyIdpsSignatureSeverityEnumExtension + { + internal static string ToSerializedValue(this FirewallPolicyIdpsSignatureSeverity? value) + { + return value == null ? null : ((FirewallPolicyIdpsSignatureSeverity)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this FirewallPolicyIdpsSignatureSeverity value) + { + switch( value ) + { + case FirewallPolicyIdpsSignatureSeverity.One: + return "1"; + case FirewallPolicyIdpsSignatureSeverity.Two: + return "2"; + case FirewallPolicyIdpsSignatureSeverity.Three: + return "3"; + } + return null; + } + internal static FirewallPolicyIdpsSignatureSeverity? ParseFirewallPolicyIdpsSignatureSeverity(this string value) + { + switch( value ) + { + case "1": + return FirewallPolicyIdpsSignatureSeverity.One; + case "2": + return FirewallPolicyIdpsSignatureSeverity.Two; + case "3": + return FirewallPolicyIdpsSignatureSeverity.Three; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyInsights.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyInsights.cs index 4579db9059d6..68f37f3c1c2b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyInsights.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyInsights.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public FirewallPolicyInsights() /// /// Initializes a new instance of the FirewallPolicyInsights class. /// - /// A flag to indicate if the insights are - /// enabled on the policy. - /// Number of days the insights should be - /// enabled on the policy. - /// Workspaces needed to configure - /// the Firewall Policy Insights. + + /// A flag to indicate if the insights are enabled on the policy. + /// + + /// Number of days the insights should be enabled on the policy. + /// + + /// Workspaces needed to configure the Firewall Policy Insights. + /// public FirewallPolicyInsights(bool? isEnabled = default(bool?), int? retentionDays = default(int?), FirewallPolicyLogAnalyticsResources logAnalyticsResources = default(FirewallPolicyLogAnalyticsResources)) + { - IsEnabled = isEnabled; - RetentionDays = retentionDays; - LogAnalyticsResources = logAnalyticsResources; + this.IsEnabled = isEnabled; + this.RetentionDays = retentionDays; + this.LogAnalyticsResources = logAnalyticsResources; CustomInit(); } @@ -48,26 +46,23 @@ public FirewallPolicyInsights() /// partial void CustomInit(); + /// - /// Gets or sets a flag to indicate if the insights are enabled on the - /// policy. + /// Gets or sets a flag to indicate if the insights are enabled on the policy. /// - [JsonProperty(PropertyName = "isEnabled")] - public bool? IsEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isEnabled")] + public bool? IsEnabled {get; set; } /// - /// Gets or sets number of days the insights should be enabled on the - /// policy. + /// Gets or sets number of days the insights should be enabled on the policy. /// - [JsonProperty(PropertyName = "retentionDays")] - public int? RetentionDays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionDays")] + public int? RetentionDays {get; set; } /// - /// Gets or sets workspaces needed to configure the Firewall Policy - /// Insights. + /// Gets or sets workspaces needed to configure the Firewall Policy Insights. /// - [JsonProperty(PropertyName = "logAnalyticsResources")] - public FirewallPolicyLogAnalyticsResources LogAnalyticsResources { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "logAnalyticsResources")] + public FirewallPolicyLogAnalyticsResources LogAnalyticsResources {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetection.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetection.cs index 0302b9415335..ed20e15f9fa5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetection.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyIntrusionDetection { /// - /// Initializes a new instance of the FirewallPolicyIntrusionDetection - /// class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetection class. /// public FirewallPolicyIntrusionDetection() { @@ -28,24 +21,25 @@ public FirewallPolicyIntrusionDetection() } /// - /// Initializes a new instance of the FirewallPolicyIntrusionDetection - /// class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetection class. /// - /// Intrusion detection general state. When attached - /// to a parent policy, the firewall's effective IDPS mode is the - /// stricter mode of the two. Possible values include: 'Off', 'Alert', - /// 'Deny' - /// IDPS profile name. When attached to a parent - /// policy, the firewall's effective profile is the profile name of the - /// parent policy. Possible values include: 'Basic', 'Standard', - /// 'Advanced', 'Extended' - /// Intrusion detection configuration - /// properties. + + /// Intrusion detection general state. When attached to a parent policy, the + /// firewall's effective IDPS mode is the stricter mode of the two. + /// Possible values include: 'Off', 'Alert', 'Deny' + + /// IDPS profile name. When attached to a parent policy, the firewall's + /// effective profile is the profile name of the parent policy. + /// Possible values include: 'Basic', 'Standard', 'Advanced', 'Extended' + + /// Intrusion detection configuration properties. + /// public FirewallPolicyIntrusionDetection(string mode = default(string), string profile = default(string), FirewallPolicyIntrusionDetectionConfiguration configuration = default(FirewallPolicyIntrusionDetectionConfiguration)) + { - Mode = mode; - Profile = profile; - Configuration = configuration; + this.Mode = mode; + this.Profile = profile; + this.Configuration = configuration; CustomInit(); } @@ -54,28 +48,25 @@ public FirewallPolicyIntrusionDetection() /// partial void CustomInit(); + /// - /// Gets or sets intrusion detection general state. When attached to a - /// parent policy, the firewall's effective IDPS mode is the stricter - /// mode of the two. Possible values include: 'Off', 'Alert', 'Deny' + /// Gets or sets intrusion detection general state. When attached to a parent + /// policy, the firewall's effective IDPS mode is the stricter mode of the two. Possible values include: 'Off', 'Alert', 'Deny' /// - [JsonProperty(PropertyName = "mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } /// - /// Gets or sets IDPS profile name. When attached to a parent policy, - /// the firewall's effective profile is the profile name of the parent - /// policy. Possible values include: 'Basic', 'Standard', 'Advanced', - /// 'Extended' + /// Gets or sets iDPS profile name. When attached to a parent policy, the + /// firewall's effective profile is the profile name of the parent policy. Possible values include: 'Basic', 'Standard', 'Advanced', 'Extended' /// - [JsonProperty(PropertyName = "profile")] - public string Profile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "profile")] + public string Profile {get; set; } /// /// Gets or sets intrusion detection configuration properties. /// - [JsonProperty(PropertyName = "configuration")] - public FirewallPolicyIntrusionDetectionConfiguration Configuration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "configuration")] + public FirewallPolicyIntrusionDetectionConfiguration Configuration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.cs index da43e2399faa..3d3ea84418d9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications { /// - /// Initializes a new instance of the - /// FirewallPolicyIntrusionDetectionBypassTrafficSpecifications class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications class. /// public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications() { @@ -30,34 +21,43 @@ public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications() } /// - /// Initializes a new instance of the - /// FirewallPolicyIntrusionDetectionBypassTrafficSpecifications class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications class. /// - /// Name of the bypass traffic rule. - /// Description of the bypass traffic - /// rule. - /// The rule bypass protocol. Possible values - /// include: 'TCP', 'UDP', 'ICMP', 'ANY' - /// List of source IP addresses or ranges - /// for this rule. - /// List of destination IP addresses - /// or ranges for this rule. - /// List of destination ports or - /// ranges. - /// List of source IpGroups for this - /// rule. - /// List of destination IpGroups for - /// this rule. - public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications(string name = default(string), string description = default(string), string protocol = default(string), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList sourceIpGroups = default(IList), IList destinationIpGroups = default(IList)) + + /// Name of the bypass traffic rule. + /// + + /// Description of the bypass traffic rule. + /// + + /// The rule bypass protocol. + /// Possible values include: 'TCP', 'UDP', 'ICMP', 'ANY' + + /// List of source IP addresses or ranges for this rule. + /// + + /// List of destination IP addresses or ranges for this rule. + /// + + /// List of destination ports or ranges. + /// + + /// List of source IpGroups for this rule. + /// + + /// List of destination IpGroups for this rule. + /// + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications(string name = default(string), string description = default(string), string protocol = default(string), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationIPGroups = default(System.Collections.Generic.IList)) + { - Name = name; - Description = description; - Protocol = protocol; - SourceAddresses = sourceAddresses; - DestinationAddresses = destinationAddresses; - DestinationPorts = destinationPorts; - SourceIpGroups = sourceIpGroups; - DestinationIpGroups = destinationIpGroups; + this.Name = name; + this.Description = description; + this.Protocol = protocol; + this.SourceAddresses = sourceAddresses; + this.DestinationAddresses = destinationAddresses; + this.DestinationPorts = destinationPorts; + this.SourceIPGroups = sourceIPGroups; + this.DestinationIPGroups = destinationIPGroups; CustomInit(); } @@ -66,55 +66,53 @@ public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications() /// partial void CustomInit(); + /// /// Gets or sets name of the bypass traffic rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets description of the bypass traffic rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets the rule bypass protocol. Possible values include: - /// 'TCP', 'UDP', 'ICMP', 'ANY' + /// Gets or sets the rule bypass protocol. Possible values include: 'TCP', 'UDP', 'ICMP', 'ANY' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// /// Gets or sets list of source IP addresses or ranges for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// - /// Gets or sets list of destination IP addresses or ranges for this - /// rule. + /// Gets or sets list of destination IP addresses or ranges for this rule. /// - [JsonProperty(PropertyName = "destinationAddresses")] - public IList DestinationAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddresses")] + public System.Collections.Generic.IList DestinationAddresses {get; set; } /// /// Gets or sets list of destination ports or ranges. /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } /// /// Gets or sets list of destination IpGroups for this rule. /// - [JsonProperty(PropertyName = "destinationIpGroups")] - public IList DestinationIpGroups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationIpGroups")] + public System.Collections.Generic.IList DestinationIPGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionConfiguration.cs index c586e5edccc3..60265401066f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyIntrusionDetectionConfiguration { /// - /// Initializes a new instance of the - /// FirewallPolicyIntrusionDetectionConfiguration class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetectionConfiguration class. /// public FirewallPolicyIntrusionDetectionConfiguration() { @@ -30,23 +21,26 @@ public FirewallPolicyIntrusionDetectionConfiguration() } /// - /// Initializes a new instance of the - /// FirewallPolicyIntrusionDetectionConfiguration class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetectionConfiguration class. /// - /// List of specific signatures - /// states. - /// List of rules for traffic to - /// bypass. - /// IDPS Private IP address ranges are used - /// to identify traffic direction (i.e. inbound, outbound, etc.). By - /// default, only ranges defined by IANA RFC 1918 are considered - /// private IP addresses. To modify default ranges, specify your - /// Private IP address ranges with this property - public FirewallPolicyIntrusionDetectionConfiguration(IList signatureOverrides = default(IList), IList bypassTrafficSettings = default(IList), IList privateRanges = default(IList)) + + /// List of specific signatures states. + /// + + /// List of rules for traffic to bypass. + /// + + /// IDPS Private IP address ranges are used to identify traffic direction (i.e. + /// inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 + /// are considered private IP addresses. To modify default ranges, specify your + /// Private IP address ranges with this property + /// + public FirewallPolicyIntrusionDetectionConfiguration(System.Collections.Generic.IList signatureOverrides = default(System.Collections.Generic.IList), System.Collections.Generic.IList bypassTrafficSettings = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateRanges = default(System.Collections.Generic.IList)) + { - SignatureOverrides = signatureOverrides; - BypassTrafficSettings = bypassTrafficSettings; - PrivateRanges = privateRanges; + this.SignatureOverrides = signatureOverrides; + this.BypassTrafficSettings = bypassTrafficSettings; + this.PrivateRanges = privateRanges; CustomInit(); } @@ -55,27 +49,26 @@ public FirewallPolicyIntrusionDetectionConfiguration() /// partial void CustomInit(); + /// /// Gets or sets list of specific signatures states. /// - [JsonProperty(PropertyName = "signatureOverrides")] - public IList SignatureOverrides { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "signatureOverrides")] + public System.Collections.Generic.IList SignatureOverrides {get; set; } /// /// Gets or sets list of rules for traffic to bypass. /// - [JsonProperty(PropertyName = "bypassTrafficSettings")] - public IList BypassTrafficSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bypassTrafficSettings")] + public System.Collections.Generic.IList BypassTrafficSettings {get; set; } /// - /// Gets or sets IDPS Private IP address ranges are used to identify - /// traffic direction (i.e. inbound, outbound, etc.). By default, only - /// ranges defined by IANA RFC 1918 are considered private IP - /// addresses. To modify default ranges, specify your Private IP - /// address ranges with this property + /// Gets or sets iDPS Private IP address ranges are used to identify traffic + /// direction (i.e. inbound, outbound, etc.). By default, only ranges defined + /// by IANA RFC 1918 are considered private IP addresses. To modify default + /// ranges, specify your Private IP address ranges with this property /// - [JsonProperty(PropertyName = "privateRanges")] - public IList PrivateRanges { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privateRanges")] + public System.Collections.Generic.IList PrivateRanges {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProfileType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProfileType.cs index f1e90325e9ea..ff886b369cbf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProfileType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProfileType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyIntrusionDetectionProfileType. /// + + public static class FirewallPolicyIntrusionDetectionProfileType { public const string Basic = "Basic"; @@ -21,4 +18,4 @@ public static class FirewallPolicyIntrusionDetectionProfileType public const string Advanced = "Advanced"; public const string Extended = "Extended"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProtocol.cs index 4f3325dee453..e3d203d2ff05 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,11 +9,13 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyIntrusionDetectionProtocol. /// + + public static class FirewallPolicyIntrusionDetectionProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; - public const string ICMP = "ICMP"; + public const string Icmp = "ICMP"; public const string ANY = "ANY"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionSignatureSpecification.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionSignatureSpecification.cs index 517d693a0198..ce21699f1122 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionSignatureSpecification.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionSignatureSpecification.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyIntrusionDetectionSignatureSpecification { /// - /// Initializes a new instance of the - /// FirewallPolicyIntrusionDetectionSignatureSpecification class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetectionSignatureSpecification class. /// public FirewallPolicyIntrusionDetectionSignatureSpecification() { @@ -28,16 +21,19 @@ public FirewallPolicyIntrusionDetectionSignatureSpecification() } /// - /// Initializes a new instance of the - /// FirewallPolicyIntrusionDetectionSignatureSpecification class. + /// Initializes a new instance of the FirewallPolicyIntrusionDetectionSignatureSpecification class. /// - /// Signature id. - /// The signature state. Possible values include: - /// 'Off', 'Alert', 'Deny' + + /// Signature id. + /// + + /// The signature state. + /// Possible values include: 'Off', 'Alert', 'Deny' public FirewallPolicyIntrusionDetectionSignatureSpecification(string id = default(string), string mode = default(string)) + { - Id = id; - Mode = mode; + this.Id = id; + this.Mode = mode; CustomInit(); } @@ -46,18 +42,17 @@ public FirewallPolicyIntrusionDetectionSignatureSpecification() /// partial void CustomInit(); + /// /// Gets or sets signature id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the signature state. Possible values include: 'Off', - /// 'Alert', 'Deny' + /// Gets or sets the signature state. Possible values include: 'Off', 'Alert', 'Deny' /// - [JsonProperty(PropertyName = "mode")] - public string Mode { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionStateType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionStateType.cs index 0b8d17fbfc23..dadcdbdbf6bd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionStateType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyIntrusionDetectionStateType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyIntrusionDetectionStateType. /// + + public static class FirewallPolicyIntrusionDetectionStateType { public const string Off = "Off"; public const string Alert = "Alert"; public const string Deny = "Deny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsResources.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsResources.cs index 371810bbdbeb..92e555d12dd2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsResources.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsResources.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyLogAnalyticsResources { /// - /// Initializes a new instance of the - /// FirewallPolicyLogAnalyticsResources class. + /// Initializes a new instance of the FirewallPolicyLogAnalyticsResources class. /// public FirewallPolicyLogAnalyticsResources() { @@ -30,17 +21,19 @@ public FirewallPolicyLogAnalyticsResources() } /// - /// Initializes a new instance of the - /// FirewallPolicyLogAnalyticsResources class. + /// Initializes a new instance of the FirewallPolicyLogAnalyticsResources class. /// - /// List of workspaces for Firewall Policy - /// Insights. - /// The default workspace Id for - /// Firewall Policy Insights. - public FirewallPolicyLogAnalyticsResources(IList workspaces = default(IList), SubResource defaultWorkspaceId = default(SubResource)) + + /// List of workspaces for Firewall Policy Insights. + /// + + /// The default workspace Id for Firewall Policy Insights. + /// + public FirewallPolicyLogAnalyticsResources(System.Collections.Generic.IList workspaces = default(System.Collections.Generic.IList), SubResource defaultWorkspaceId = default(SubResource)) + { - Workspaces = workspaces; - DefaultWorkspaceId = defaultWorkspaceId; + this.Workspaces = workspaces; + this.DefaultWorkspaceId = defaultWorkspaceId; CustomInit(); } @@ -49,17 +42,17 @@ public FirewallPolicyLogAnalyticsResources() /// partial void CustomInit(); + /// /// Gets or sets list of workspaces for Firewall Policy Insights. /// - [JsonProperty(PropertyName = "workspaces")] - public IList Workspaces { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaces")] + public System.Collections.Generic.IList Workspaces {get; set; } /// /// Gets or sets the default workspace Id for Firewall Policy Insights. /// - [JsonProperty(PropertyName = "defaultWorkspaceId")] - public SubResource DefaultWorkspaceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultWorkspaceId")] + public SubResource DefaultWorkspaceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsWorkspace.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsWorkspace.cs index ecf13cd35766..9c9a97cee478 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsWorkspace.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyLogAnalyticsWorkspace.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyLogAnalyticsWorkspace { /// - /// Initializes a new instance of the - /// FirewallPolicyLogAnalyticsWorkspace class. + /// Initializes a new instance of the FirewallPolicyLogAnalyticsWorkspace class. /// public FirewallPolicyLogAnalyticsWorkspace() { @@ -28,16 +21,19 @@ public FirewallPolicyLogAnalyticsWorkspace() } /// - /// Initializes a new instance of the - /// FirewallPolicyLogAnalyticsWorkspace class. + /// Initializes a new instance of the FirewallPolicyLogAnalyticsWorkspace class. /// - /// Region to configure the Workspace. - /// The workspace Id for Firewall Policy - /// Insights. + + /// Region to configure the Workspace. + /// + + /// The workspace Id for Firewall Policy Insights. + /// public FirewallPolicyLogAnalyticsWorkspace(string region = default(string), SubResource workspaceId = default(SubResource)) + { - Region = region; - WorkspaceId = workspaceId; + this.Region = region; + this.WorkspaceId = workspaceId; CustomInit(); } @@ -46,17 +42,17 @@ public FirewallPolicyLogAnalyticsWorkspace() /// partial void CustomInit(); + /// /// Gets or sets region to configure the Workspace. /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; set; } /// /// Gets or sets the workspace Id for Firewall Policy Insights. /// - [JsonProperty(PropertyName = "workspaceId")] - public SubResource WorkspaceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceId")] + public SubResource WorkspaceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollection.cs index 5466fda21bf3..78a8f1bcb234 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollection.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyNatRuleCollection : FirewallPolicyRuleCollection { /// - /// Initializes a new instance of the FirewallPolicyNatRuleCollection - /// class. + /// Initializes a new instance of the FirewallPolicyNatRuleCollection class. /// public FirewallPolicyNatRuleCollection() { @@ -31,21 +22,26 @@ public FirewallPolicyNatRuleCollection() } /// - /// Initializes a new instance of the FirewallPolicyNatRuleCollection - /// class. + /// Initializes a new instance of the FirewallPolicyNatRuleCollection class. /// - /// The name of the rule collection. - /// Priority of the Firewall Policy Rule - /// Collection resource. - /// The action type of a Nat rule - /// collection. - /// List of rules included in a rule - /// collection. - public FirewallPolicyNatRuleCollection(string name = default(string), int? priority = default(int?), FirewallPolicyNatRuleCollectionAction action = default(FirewallPolicyNatRuleCollectionAction), IList rules = default(IList)) - : base(name, priority) + + /// The name of the rule collection. + /// + + /// Priority of the Firewall Policy Rule Collection resource. + /// + + /// The action type of a Nat rule collection. + /// + + /// List of rules included in a rule collection. + /// + public FirewallPolicyNatRuleCollection(string name = default(string), int? priority = default(int?), FirewallPolicyNatRuleCollectionAction action = default(FirewallPolicyNatRuleCollectionAction), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(name, priority) { - Action = action; - Rules = rules; + this.Action = action; + this.Rules = rules; CustomInit(); } @@ -54,27 +50,29 @@ public FirewallPolicyNatRuleCollection() /// partial void CustomInit(); + /// /// Gets or sets the action type of a Nat rule collection. /// - [JsonProperty(PropertyName = "action")] - public FirewallPolicyNatRuleCollectionAction Action { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public FirewallPolicyNatRuleCollectionAction Action {get; set; } /// /// Gets or sets list of rules included in a rule collection. /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionAction.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionAction.cs index 215b87c4f0a8..0c47cc7c7766 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionAction.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionAction.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyNatRuleCollectionAction { /// - /// Initializes a new instance of the - /// FirewallPolicyNatRuleCollectionAction class. + /// Initializes a new instance of the FirewallPolicyNatRuleCollectionAction class. /// public FirewallPolicyNatRuleCollectionAction() { @@ -28,14 +21,15 @@ public FirewallPolicyNatRuleCollectionAction() } /// - /// Initializes a new instance of the - /// FirewallPolicyNatRuleCollectionAction class. + /// Initializes a new instance of the FirewallPolicyNatRuleCollectionAction class. /// - /// The type of action. Possible values include: - /// 'DNAT' + + /// The type of action. + /// Possible values include: 'DNAT' public FirewallPolicyNatRuleCollectionAction(string type = default(string)) + { - Type = type; + this.Type = type; CustomInit(); } @@ -44,11 +38,11 @@ public FirewallPolicyNatRuleCollectionAction() /// partial void CustomInit(); + /// - /// Gets or sets the type of action. Possible values include: 'DNAT' + /// Gets or sets the type of action. Possible values include: 'DNAT' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionActionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionActionType.cs index 180deeac7157..818a9e93c7e5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionActionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyNatRuleCollectionActionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyNatRuleCollectionActionType. /// + + public static class FirewallPolicyNatRuleCollectionActionType { - public const string DNAT = "DNAT"; + public const string Dnat = "DNAT"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyPropertiesFormat.cs new file mode 100644 index 000000000000..e64c0a0acbad --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyPropertiesFormat.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Firewall Policy definition. + /// + public partial class FirewallPolicyPropertiesFormat + { + /// + /// Initializes a new instance of the FirewallPolicyPropertiesFormat class. + /// + public FirewallPolicyPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FirewallPolicyPropertiesFormat class. + /// + + /// A read-only string that represents the size of the + /// FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) + /// + + /// List of references to FirewallPolicyRuleCollectionGroups. + /// + + /// The provisioning state of the firewall policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The parent firewall policy from which rules are inherited. + /// + + /// List of references to Azure Firewalls that this Firewall Policy is + /// associated with. + /// + + /// List of references to Child Firewall Policies. + /// + + /// The operation mode for Threat Intelligence. + /// Possible values include: 'Alert', 'Deny', 'Off' + + /// ThreatIntel Whitelist for Firewall Policy. + /// + + /// Insights on Firewall Policy. + /// + + /// The private IP addresses/IP ranges to which traffic will not be SNAT. + /// + + /// SQL Settings definition. + /// + + /// DNS Proxy Settings definition. + /// + + /// Explicit Proxy Settings definition. + /// + + /// The configuration for Intrusion detection. + /// + + /// TLS Configuration definition. + /// + + /// The Firewall Policy SKU. + /// + public FirewallPolicyPropertiesFormat(string size = default(string), System.Collections.Generic.IList ruleCollectionGroups = default(System.Collections.Generic.IList), string provisioningState = default(string), SubResource basePolicy = default(SubResource), System.Collections.Generic.IList firewalls = default(System.Collections.Generic.IList), System.Collections.Generic.IList childPolicies = default(System.Collections.Generic.IList), string threatIntelMode = default(string), FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default(FirewallPolicyThreatIntelWhitelist), FirewallPolicyInsights insights = default(FirewallPolicyInsights), FirewallPolicySnat snat = default(FirewallPolicySnat), FirewallPolicySQL sql = default(FirewallPolicySQL), DnsSettings dnsSettings = default(DnsSettings), ExplicitProxy explicitProxy = default(ExplicitProxy), FirewallPolicyIntrusionDetection intrusionDetection = default(FirewallPolicyIntrusionDetection), FirewallPolicyTransportSecurity transportSecurity = default(FirewallPolicyTransportSecurity), FirewallPolicySku sku = default(FirewallPolicySku)) + + { + this.Size = size; + this.RuleCollectionGroups = ruleCollectionGroups; + this.ProvisioningState = provisioningState; + this.BasePolicy = basePolicy; + this.Firewalls = firewalls; + this.ChildPolicies = childPolicies; + this.ThreatIntelMode = threatIntelMode; + this.ThreatIntelWhitelist = threatIntelWhitelist; + this.Insights = insights; + this.Snat = snat; + this.Sql = sql; + this.DnsSettings = dnsSettings; + this.ExplicitProxy = explicitProxy; + this.IntrusionDetection = intrusionDetection; + this.TransportSecurity = transportSecurity; + this.Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets a read-only string that represents the size of the + /// FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; private set; } + + /// + /// Gets list of references to FirewallPolicyRuleCollectionGroups. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleCollectionGroups")] + public System.Collections.Generic.IList RuleCollectionGroups {get; private set; } + + /// + /// Gets the provisioning state of the firewall policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the parent firewall policy from which rules are inherited. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "basePolicy")] + public SubResource BasePolicy {get; set; } + + /// + /// Gets list of references to Azure Firewalls that this Firewall Policy is + /// associated with. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewalls")] + public System.Collections.Generic.IList Firewalls {get; private set; } + + /// + /// Gets list of references to Child Firewall Policies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "childPolicies")] + public System.Collections.Generic.IList ChildPolicies {get; private set; } + + /// + /// Gets or sets the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatIntelMode")] + public string ThreatIntelMode {get; set; } + + /// + /// Gets or sets threatIntel Whitelist for Firewall Policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatIntelWhitelist")] + public FirewallPolicyThreatIntelWhitelist ThreatIntelWhitelist {get; set; } + + /// + /// Gets or sets insights on Firewall Policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "insights")] + public FirewallPolicyInsights Insights {get; set; } + + /// + /// Gets or sets the private IP addresses/IP ranges to which traffic will not + /// be SNAT. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snat")] + public FirewallPolicySnat Snat {get; set; } + + /// + /// Gets or sets sQL Settings definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sql")] + public FirewallPolicySQL Sql {get; set; } + + /// + /// Gets or sets dNS Proxy Settings definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public DnsSettings DnsSettings {get; set; } + + /// + /// Gets or sets explicit Proxy Settings definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "explicitProxy")] + public ExplicitProxy ExplicitProxy {get; set; } + + /// + /// Gets or sets the configuration for Intrusion detection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "intrusionDetection")] + public FirewallPolicyIntrusionDetection IntrusionDetection {get; set; } + + /// + /// Gets or sets tLS Configuration definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "transportSecurity")] + public FirewallPolicyTransportSecurity TransportSecurity {get; set; } + + /// + /// Gets or sets the Firewall Policy SKU. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public FirewallPolicySku Sku {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + + + + + if (this.ExplicitProxy != null) + { + this.ExplicitProxy.Validate(); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRule.cs index ed4b7f977df1..cc611eec45cd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,12 +24,17 @@ public FirewallPolicyRule() /// /// Initializes a new instance of the FirewallPolicyRule class. /// - /// Name of the rule. - /// Description of the rule. + + /// Name of the rule. + /// + + /// Description of the rule. + /// public FirewallPolicyRule(string name = default(string), string description = default(string)) + { - Name = name; - Description = description; + this.Name = name; + this.Description = description; CustomInit(); } @@ -44,17 +43,17 @@ public FirewallPolicyRule() /// partial void CustomInit(); + /// /// Gets or sets name of the rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets description of the rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs index 2bad4a0ff8cf..0a2c2d826a11 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyRuleApplicationProtocol { /// - /// Initializes a new instance of the - /// FirewallPolicyRuleApplicationProtocol class. + /// Initializes a new instance of the FirewallPolicyRuleApplicationProtocol class. /// public FirewallPolicyRuleApplicationProtocol() { @@ -29,17 +21,19 @@ public FirewallPolicyRuleApplicationProtocol() } /// - /// Initializes a new instance of the - /// FirewallPolicyRuleApplicationProtocol class. + /// Initializes a new instance of the FirewallPolicyRuleApplicationProtocol class. /// - /// Protocol type. Possible values include: - /// 'Http', 'Https' - /// Port number for the protocol, cannot be greater - /// than 64000. + + /// Protocol type. + /// Possible values include: 'Http', 'Https' + + /// Port number for the protocol, cannot be greater than 64000. + /// public FirewallPolicyRuleApplicationProtocol(string protocolType = default(string), int? port = default(int?)) + { - ProtocolType = protocolType; - Port = port; + this.ProtocolType = protocolType; + this.Port = port; CustomInit(); } @@ -48,39 +42,38 @@ public FirewallPolicyRuleApplicationProtocol() /// partial void CustomInit(); + /// - /// Gets or sets protocol type. Possible values include: 'Http', - /// 'Https' + /// Gets or sets protocol type. Possible values include: 'Http', 'Https' /// - [JsonProperty(PropertyName = "protocolType")] - public string ProtocolType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocolType")] + public string ProtocolType {get; set; } /// - /// Gets or sets port number for the protocol, cannot be greater than - /// 64000. + /// Gets or sets port number for the protocol, cannot be greater than 64000. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Port != null) + + if (this.Port != null) { - if (Port > 64000) + if (this.Port > 64000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 64000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Port", 64000); } - if (Port < 0) + if (this.Port < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Port", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocolType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocolType.cs index 17675ff7207f..5030e1b3138f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocolType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleApplicationProtocolType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyRuleApplicationProtocolType. /// + + public static class FirewallPolicyRuleApplicationProtocolType { public const string Http = "Http"; public const string Https = "Https"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollection.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollection.cs index 824b73fb84a3..d19cd6f45cff 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollection.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -21,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyRuleCollection { /// - /// Initializes a new instance of the FirewallPolicyRuleCollection - /// class. + /// Initializes a new instance of the FirewallPolicyRuleCollection class. /// public FirewallPolicyRuleCollection() { @@ -30,16 +22,19 @@ public FirewallPolicyRuleCollection() } /// - /// Initializes a new instance of the FirewallPolicyRuleCollection - /// class. + /// Initializes a new instance of the FirewallPolicyRuleCollection class. /// - /// The name of the rule collection. - /// Priority of the Firewall Policy Rule - /// Collection resource. + + /// The name of the rule collection. + /// + + /// Priority of the Firewall Policy Rule Collection resource. + /// public FirewallPolicyRuleCollection(string name = default(string), int? priority = default(int?)) + { - Name = name; - Priority = priority; + this.Name = name; + this.Priority = priority; CustomInit(); } @@ -48,38 +43,38 @@ public FirewallPolicyRuleCollection() /// partial void CustomInit(); + /// /// Gets or sets the name of the rule collection. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets priority of the Firewall Policy Rule Collection - /// resource. + /// Gets or sets priority of the Firewall Policy Rule Collection resource. /// - [JsonProperty(PropertyName = "priority")] - public int? Priority { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority != null) + + if (this.Priority != null) { - if (Priority > 65000) + if (this.Priority > 65000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); } - if (Priority < 100) + if (this.Priority < 100) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroup.cs index 1345776fa850..16c4a67143d5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroup.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Rule Collection Group resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FirewallPolicyRuleCollectionGroup : SubResource { /// - /// Initializes a new instance of the FirewallPolicyRuleCollectionGroup - /// class. + /// Initializes a new instance of the FirewallPolicyRuleCollectionGroup class. /// public FirewallPolicyRuleCollectionGroup() { @@ -33,36 +22,46 @@ public FirewallPolicyRuleCollectionGroup() } /// - /// Initializes a new instance of the FirewallPolicyRuleCollectionGroup - /// class. + /// Initializes a new instance of the FirewallPolicyRuleCollectionGroup class. /// - /// Resource ID. - /// A read-only string that represents the size of - /// the FirewallPolicyRuleCollectionGroupProperties in MB. (ex - /// 1.2MB) - /// Priority of the Firewall Policy Rule - /// Collection Group resource. - /// Group of Firewall Policy rule - /// collections. - /// The provisioning state of the - /// firewall policy rule collection group resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Rule Group type. - public FirewallPolicyRuleCollectionGroup(string id = default(string), string size = default(string), int? priority = default(int?), IList ruleCollections = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Rule Group type. + /// + + /// The provisioning state of the firewall policy rule collection group + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A read-only string that represents the size of the + /// FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) + /// + + /// Priority of the Firewall Policy Rule Collection Group resource. + /// + + /// Group of Firewall Policy rule collections. + /// + public FirewallPolicyRuleCollectionGroup(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string size = default(string), int? priority = default(int?), System.Collections.Generic.IList ruleCollections = default(System.Collections.Generic.IList)) + + : base(id) { - Size = size; - Priority = priority; - RuleCollections = ruleCollections; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Size = size; + this.Priority = priority; + this.RuleCollections = ruleCollections; CustomInit(); } @@ -71,76 +70,80 @@ public FirewallPolicyRuleCollectionGroup() /// partial void CustomInit(); + /// - /// Gets a read-only string that represents the size of the - /// FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets priority of the Firewall Policy Rule Collection Group - /// resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets group of Firewall Policy rule collections. + /// Gets rule Group type. /// - [JsonProperty(PropertyName = "properties.ruleCollections")] - public IList RuleCollections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the firewall policy rule collection - /// group resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the firewall policy rule collection group + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets a read-only string that represents the size of the + /// FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public string Size {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets priority of the Firewall Policy Rule Collection Group + /// resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets rule Group type. + /// Gets or sets group of Firewall Policy rule collections. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleCollections")] + public System.Collections.Generic.IList RuleCollections {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Priority != null) + + + + + + if (this.Priority != null) { - if (Priority > 65000) + if (this.Priority > 65000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); } - if (Priority < 100) + if (this.Priority < 100) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); } } - if (RuleCollections != null) + if (this.RuleCollections != null) { - foreach (var element in RuleCollections) + foreach (var element in this.RuleCollections) { if (element != null) { @@ -150,4 +153,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroupProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroupProperties.cs new file mode 100644 index 000000000000..48c139485134 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionGroupProperties.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the rule collection group. + /// + public partial class FirewallPolicyRuleCollectionGroupProperties + { + /// + /// Initializes a new instance of the FirewallPolicyRuleCollectionGroupProperties class. + /// + public FirewallPolicyRuleCollectionGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FirewallPolicyRuleCollectionGroupProperties class. + /// + + /// A read-only string that represents the size of the + /// FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) + /// + + /// Priority of the Firewall Policy Rule Collection Group resource. + /// + + /// Group of Firewall Policy rule collections. + /// + + /// The provisioning state of the firewall policy rule collection group + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public FirewallPolicyRuleCollectionGroupProperties(string size = default(string), int? priority = default(int?), System.Collections.Generic.IList ruleCollections = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Size = size; + this.Priority = priority; + this.RuleCollections = ruleCollections; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets a read-only string that represents the size of the + /// FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; private set; } + + /// + /// Gets or sets priority of the Firewall Policy Rule Collection Group + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } + + /// + /// Gets or sets group of Firewall Policy rule collections. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleCollections")] + public System.Collections.Generic.IList RuleCollections {get; set; } + + /// + /// Gets the provisioning state of the firewall policy rule collection group + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.Priority != null) + { + if (this.Priority > 65000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (this.Priority < 100) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Priority", 100); + } + } + if (this.RuleCollections != null) + { + foreach (var element in this.RuleCollections) + { + if (element != null) + { + element.Validate(); + } + } + } + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionType.cs new file mode 100644 index 000000000000..d5fbfc802cae --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleCollectionType.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for FirewallPolicyRuleCollectionType. + /// + + + public static class FirewallPolicyRuleCollectionType + { + public const string FirewallPolicyNatRuleCollection = "FirewallPolicyNatRuleCollection"; + public const string FirewallPolicyFilterRuleCollection = "FirewallPolicyFilterRuleCollection"; + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleNetworkProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleNetworkProtocol.cs index 28f6751de895..bf944b4313cb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleNetworkProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleNetworkProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,11 +9,13 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicyRuleNetworkProtocol. /// + + public static class FirewallPolicyRuleNetworkProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; public const string Any = "Any"; - public const string ICMP = "ICMP"; + public const string Icmp = "ICMP"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleType.cs new file mode 100644 index 000000000000..f18784b9c258 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyRuleType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for FirewallPolicyRuleType. + /// + + + public static class FirewallPolicyRuleType + { + public const string ApplicationRule = "ApplicationRule"; + public const string NetworkRule = "NetworkRule"; + public const string NatRule = "NatRule"; + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySNAT.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySNAT.cs index b3146d4796a8..0d4e8b0102ca 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySNAT.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySNAT.cs @@ -1,45 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The private IP addresses/IP ranges to which traffic will not be SNAT. /// - public partial class FirewallPolicySNAT + public partial class FirewallPolicySnat { /// - /// Initializes a new instance of the FirewallPolicySNAT class. + /// Initializes a new instance of the FirewallPolicySnat class. /// - public FirewallPolicySNAT() + public FirewallPolicySnat() { CustomInit(); } /// - /// Initializes a new instance of the FirewallPolicySNAT class. + /// Initializes a new instance of the FirewallPolicySnat class. /// - /// List of private IP addresses/IP address - /// ranges to not be SNAT. - /// The operation mode for - /// automatically learning private ranges to not be SNAT. Possible - /// values include: 'Enabled', 'Disabled' - public FirewallPolicySNAT(IList privateRanges = default(IList), string autoLearnPrivateRanges = default(string)) + + /// List of private IP addresses/IP address ranges to not be SNAT. + /// + + /// The operation mode for automatically learning private ranges to not be SNAT + /// Possible values include: 'Enabled', 'Disabled' + public FirewallPolicySnat(System.Collections.Generic.IList privateRanges = default(System.Collections.Generic.IList), string autoLearnPrivateRanges = default(string)) + { - PrivateRanges = privateRanges; - AutoLearnPrivateRanges = autoLearnPrivateRanges; + this.PrivateRanges = privateRanges; + this.AutoLearnPrivateRanges = autoLearnPrivateRanges; CustomInit(); } @@ -48,20 +42,18 @@ public FirewallPolicySNAT() /// partial void CustomInit(); + /// - /// Gets or sets list of private IP addresses/IP address ranges to not - /// be SNAT. + /// Gets or sets list of private IP addresses/IP address ranges to not be SNAT. /// - [JsonProperty(PropertyName = "privateRanges")] - public IList PrivateRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateRanges")] + public System.Collections.Generic.IList PrivateRanges {get; set; } /// - /// Gets or sets the operation mode for automatically learning private - /// ranges to not be SNAT. Possible values include: 'Enabled', - /// 'Disabled' + /// Gets or sets the operation mode for automatically learning private ranges + /// to not be SNAT Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "autoLearnPrivateRanges")] - public string AutoLearnPrivateRanges { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "autoLearnPrivateRanges")] + public string AutoLearnPrivateRanges {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySQL.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySQL.cs index 2e5943a839a9..b35b3ad087ba 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySQL.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySQL.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,14 @@ public FirewallPolicySQL() /// /// Initializes a new instance of the FirewallPolicySQL class. /// - /// A flag to indicate if SQL Redirect - /// traffic filtering is enabled. Turning on the flag requires no rule - /// using port 11000-11999. + + /// A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on + /// the flag requires no rule using port 11000-11999. + /// public FirewallPolicySQL(bool? allowSqlRedirect = default(bool?)) + { - AllowSqlRedirect = allowSqlRedirect; + this.AllowSqlRedirect = allowSqlRedirect; CustomInit(); } @@ -43,13 +39,12 @@ public FirewallPolicySQL() /// partial void CustomInit(); + /// - /// Gets or sets a flag to indicate if SQL Redirect traffic filtering - /// is enabled. Turning on the flag requires no rule using port - /// 11000-11999. + /// Gets or sets a flag to indicate if SQL Redirect traffic filtering is + /// enabled. Turning on the flag requires no rule using port 11000-11999. /// - [JsonProperty(PropertyName = "allowSqlRedirect")] - public bool? AllowSqlRedirect { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allowSqlRedirect")] + public bool? AllowSqlRedirect {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySku.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySku.cs index 87e5d50a7aa9..af8c379af9ce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public FirewallPolicySku() /// /// Initializes a new instance of the FirewallPolicySku class. /// - /// Tier of Firewall Policy. Possible values - /// include: 'Standard', 'Premium', 'Basic' + + /// Tier of Firewall Policy. + /// Possible values include: 'Standard', 'Premium', 'Basic' public FirewallPolicySku(string tier = default(string)) + { - Tier = tier; + this.Tier = tier; CustomInit(); } @@ -42,12 +38,11 @@ public FirewallPolicySku() /// partial void CustomInit(); + /// - /// Gets or sets tier of Firewall Policy. Possible values include: - /// 'Standard', 'Premium', 'Basic' + /// Gets or sets tier of Firewall Policy. Possible values include: 'Standard', 'Premium', 'Basic' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySkuTier.cs index 2ef56270ca30..d236989fc487 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicySkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FirewallPolicySkuTier. /// + + public static class FirewallPolicySkuTier { public const string Standard = "Standard"; public const string Premium = "Premium"; public const string Basic = "Basic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyThreatIntelWhitelist.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyThreatIntelWhitelist.cs index f36141e285cf..2036e4f8aedc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyThreatIntelWhitelist.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyThreatIntelWhitelist.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyThreatIntelWhitelist { /// - /// Initializes a new instance of the - /// FirewallPolicyThreatIntelWhitelist class. + /// Initializes a new instance of the FirewallPolicyThreatIntelWhitelist class. /// public FirewallPolicyThreatIntelWhitelist() { @@ -30,17 +21,19 @@ public FirewallPolicyThreatIntelWhitelist() } /// - /// Initializes a new instance of the - /// FirewallPolicyThreatIntelWhitelist class. + /// Initializes a new instance of the FirewallPolicyThreatIntelWhitelist class. /// - /// List of IP addresses for the ThreatIntel - /// Whitelist. - /// List of FQDNs for the ThreatIntel - /// Whitelist. - public FirewallPolicyThreatIntelWhitelist(IList ipAddresses = default(IList), IList fqdns = default(IList)) + + /// List of IP addresses for the ThreatIntel Whitelist. + /// + + /// List of FQDNs for the ThreatIntel Whitelist. + /// + public FirewallPolicyThreatIntelWhitelist(System.Collections.Generic.IList ipAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList fqdns = default(System.Collections.Generic.IList)) + { - IpAddresses = ipAddresses; - Fqdns = fqdns; + this.IPAddresses = ipAddresses; + this.Fqdns = fqdns; CustomInit(); } @@ -49,17 +42,17 @@ public FirewallPolicyThreatIntelWhitelist() /// partial void CustomInit(); + /// /// Gets or sets list of IP addresses for the ThreatIntel Whitelist. /// - [JsonProperty(PropertyName = "ipAddresses")] - public IList IpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddresses")] + public System.Collections.Generic.IList IPAddresses {get; set; } /// /// Gets or sets list of FQDNs for the ThreatIntel Whitelist. /// - [JsonProperty(PropertyName = "fqdns")] - public IList Fqdns { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdns")] + public System.Collections.Generic.IList Fqdns {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyTransportSecurity.cs b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyTransportSecurity.cs index f374a8f0e766..22f211d2f605 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyTransportSecurity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FirewallPolicyTransportSecurity.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class FirewallPolicyTransportSecurity { /// - /// Initializes a new instance of the FirewallPolicyTransportSecurity - /// class. + /// Initializes a new instance of the FirewallPolicyTransportSecurity class. /// public FirewallPolicyTransportSecurity() { @@ -28,14 +21,15 @@ public FirewallPolicyTransportSecurity() } /// - /// Initializes a new instance of the FirewallPolicyTransportSecurity - /// class. + /// Initializes a new instance of the FirewallPolicyTransportSecurity class. /// - /// The CA used for intermediate CA - /// generation. + + /// The CA used for intermediate CA generation. + /// public FirewallPolicyTransportSecurity(FirewallPolicyCertificateAuthority certificateAuthority = default(FirewallPolicyCertificateAuthority)) + { - CertificateAuthority = certificateAuthority; + this.CertificateAuthority = certificateAuthority; CustomInit(); } @@ -44,11 +38,11 @@ public FirewallPolicyTransportSecurity() /// partial void CustomInit(); + /// /// Gets or sets the CA used for intermediate CA generation. /// - [JsonProperty(PropertyName = "certificateAuthority")] - public FirewallPolicyCertificateAuthority CertificateAuthority { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "certificateAuthority")] + public FirewallPolicyCertificateAuthority CertificateAuthority {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLog.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLog.cs index fe3b92106b7b..712175f98918 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FlowLog.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLog.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A flow log resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FlowLog : Resource { /// @@ -34,41 +24,61 @@ public FlowLog() /// /// Initializes a new instance of the FlowLog class. /// - /// ID of network security group to - /// which flow log will be applied. - /// ID of the storage account which is used to - /// store the flow log. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Guid of network security group to - /// which flow log will be applied. - /// Flag to enable/disable flow logging. - /// Parameters that define the retention - /// policy for flow log. - /// Parameters that define the flow log - /// format. - /// Parameters that define the - /// configuration of traffic analytics. - /// The provisioning state of the flow - /// log. Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public FlowLog(string targetResourceId, string storageId, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string targetResourceGuid = default(string), bool? enabled = default(bool?), RetentionPolicyParameters retentionPolicy = default(RetentionPolicyParameters), FlowLogFormatParameters format = default(FlowLogFormatParameters), TrafficAnalyticsProperties flowAnalyticsConfiguration = default(TrafficAnalyticsProperties), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the flow log. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// ID of network security group to which flow log will be applied. + /// + + /// Guid of network security group to which flow log will be applied. + /// + + /// ID of the storage account which is used to store the flow log. + /// + + /// Flag to enable/disable flow logging. + /// + + /// Parameters that define the retention policy for flow log. + /// + + /// Parameters that define the flow log format. + /// + + /// Parameters that define the configuration of traffic analytics. + /// + public FlowLog(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string targetResourceId = default(string), string targetResourceGuid = default(string), string storageId = default(string), bool? enabled = default(bool?), RetentionPolicyParameters retentionPolicy = default(RetentionPolicyParameters), FlowLogFormatParameters format = default(FlowLogFormatParameters), TrafficAnalyticsProperties flowAnalyticsConfiguration = default(TrafficAnalyticsProperties)) + + : base(id, name, type, location, tags) { - TargetResourceId = targetResourceId; - TargetResourceGuid = targetResourceGuid; - StorageId = storageId; - Enabled = enabled; - RetentionPolicy = retentionPolicy; - Format = format; - FlowAnalyticsConfiguration = flowAnalyticsConfiguration; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.TargetResourceId = targetResourceId; + this.TargetResourceGuid = targetResourceGuid; + this.StorageId = storageId; + this.Enabled = enabled; + this.RetentionPolicy = retentionPolicy; + this.Format = format; + this.FlowAnalyticsConfiguration = flowAnalyticsConfiguration; CustomInit(); } @@ -77,83 +87,61 @@ public FlowLog() /// partial void CustomInit(); - /// - /// Gets or sets ID of network security group to which flow log will be - /// applied. - /// - [JsonProperty(PropertyName = "properties.targetResourceId")] - public string TargetResourceId { get; set; } /// - /// Gets guid of network security group to which flow log will be - /// applied. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.targetResourceGuid")] - public string TargetResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets ID of the storage account which is used to store the - /// flow log. + /// Gets the provisioning state of the flow log. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.storageId")] - public string StorageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets flag to enable/disable flow logging. + /// Gets or sets iD of network security group to which flow log will be + /// applied. /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetResourceId")] + public string TargetResourceId {get; set; } /// - /// Gets or sets parameters that define the retention policy for flow - /// log. + /// Gets guid of network security group to which flow log will be applied. /// - [JsonProperty(PropertyName = "properties.retentionPolicy")] - public RetentionPolicyParameters RetentionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetResourceGuid")] + public string TargetResourceGuid {get; private set; } /// - /// Gets or sets parameters that define the flow log format. + /// Gets or sets iD of the storage account which is used to store the flow log. /// - [JsonProperty(PropertyName = "properties.format")] - public FlowLogFormatParameters Format { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageId")] + public string StorageId {get; set; } /// - /// Gets or sets parameters that define the configuration of traffic - /// analytics. + /// Gets or sets flag to enable/disable flow logging. /// - [JsonProperty(PropertyName = "properties.flowAnalyticsConfiguration")] - public TrafficAnalyticsProperties FlowAnalyticsConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } /// - /// Gets the provisioning state of the flow log. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets parameters that define the retention policy for flow log. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionPolicy")] + public RetentionPolicyParameters RetentionPolicy {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets parameters that define the flow log format. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.format")] + public FlowLogFormatParameters Format {get; set; } /// - /// Validate the object. + /// Gets or sets parameters that define the configuration of traffic analytics. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TargetResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); - } - if (StorageId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageId"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flowAnalyticsConfiguration")] + public TrafficAnalyticsProperties FlowAnalyticsConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatParameters.cs index f30f23a82cbd..012a218480b8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public FlowLogFormatParameters() /// /// Initializes a new instance of the FlowLogFormatParameters class. /// - /// The file type of flow log. Possible values - /// include: 'JSON' - /// The version (revision) of the flow - /// log. + + /// The file type of flow log. + /// Possible values include: 'JSON' + + /// The version (revision) of the flow log. + /// public FlowLogFormatParameters(string type = default(string), int? version = default(int?)) + { - Type = type; - Version = version; + this.Type = type; + this.Version = version; CustomInit(); } @@ -45,18 +42,17 @@ public FlowLogFormatParameters() /// partial void CustomInit(); + /// - /// Gets or sets the file type of flow log. Possible values include: - /// 'JSON' + /// Gets or sets the file type of flow log. Possible values include: 'JSON' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the version (revision) of the flow log. /// - [JsonProperty(PropertyName = "version")] - public int? Version { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public int? Version {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatType.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatType.cs index 7771183eb104..90b3dbf27a50 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogFormatType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for FlowLogFormatType. /// + + public static class FlowLogFormatType { - public const string JSON = "JSON"; + public const string Json = "JSON"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogInformation.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogInformation.cs index 1605774c944a..86b28a99475f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogInformation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogInformation.cs @@ -1,25 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Information on the configuration of flow log and traffic analytics /// (optional) . /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FlowLogInformation { /// @@ -33,25 +25,34 @@ public FlowLogInformation() /// /// Initializes a new instance of the FlowLogInformation class. /// - /// The ID of the resource to configure - /// for flow log and traffic analytics (optional) . - /// ID of the storage account which is used to - /// store the flow log. - /// Flag to enable/disable flow logging. - /// Parameters that define the retention - /// policy for flow log. - /// Parameters that define the flow log - /// format. - /// Parameters that define the - /// configuration of traffic analytics. - public FlowLogInformation(string targetResourceId, string storageId, bool enabled, RetentionPolicyParameters retentionPolicy = default(RetentionPolicyParameters), FlowLogFormatParameters format = default(FlowLogFormatParameters), TrafficAnalyticsProperties flowAnalyticsConfiguration = default(TrafficAnalyticsProperties)) + + /// The ID of the resource to configure for flow log and traffic analytics + /// (optional) . + /// + + /// Parameters that define the configuration of traffic analytics. + /// + + /// ID of the storage account which is used to store the flow log. + /// + + /// Flag to enable/disable flow logging. + /// + + /// Parameters that define the retention policy for flow log. + /// + + /// Parameters that define the flow log format. + /// + public FlowLogInformation(string targetResourceId, string storageId, bool enabled, TrafficAnalyticsProperties flowAnalyticsConfiguration = default(TrafficAnalyticsProperties), RetentionPolicyParameters retentionPolicy = default(RetentionPolicyParameters), FlowLogFormatParameters format = default(FlowLogFormatParameters)) + { - TargetResourceId = targetResourceId; - StorageId = storageId; - Enabled = enabled; - RetentionPolicy = retentionPolicy; - Format = format; - FlowAnalyticsConfiguration = flowAnalyticsConfiguration; + this.TargetResourceId = targetResourceId; + this.FlowAnalyticsConfiguration = flowAnalyticsConfiguration; + this.StorageId = storageId; + this.Enabled = enabled; + this.RetentionPolicy = retentionPolicy; + this.Format = format; CustomInit(); } @@ -60,62 +61,64 @@ public FlowLogInformation() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the resource to configure for flow log and - /// traffic analytics (optional) . + /// Gets or sets the ID of the resource to configure for flow log and traffic + /// analytics (optional) . /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// - /// Gets or sets ID of the storage account which is used to store the - /// flow log. + /// Gets or sets parameters that define the configuration of traffic analytics. /// - [JsonProperty(PropertyName = "properties.storageId")] - public string StorageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "flowAnalyticsConfiguration")] + public TrafficAnalyticsProperties FlowAnalyticsConfiguration {get; set; } /// - /// Gets or sets flag to enable/disable flow logging. + /// Gets or sets iD of the storage account which is used to store the flow log. /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageId")] + public string StorageId {get; set; } /// - /// Gets or sets parameters that define the retention policy for flow - /// log. + /// Gets or sets flag to enable/disable flow logging. /// - [JsonProperty(PropertyName = "properties.retentionPolicy")] - public RetentionPolicyParameters RetentionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool Enabled {get; set; } /// - /// Gets or sets parameters that define the flow log format. + /// Gets or sets parameters that define the retention policy for flow log. /// - [JsonProperty(PropertyName = "properties.format")] - public FlowLogFormatParameters Format { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionPolicy")] + public RetentionPolicyParameters RetentionPolicy {get; set; } /// - /// Gets or sets parameters that define the configuration of traffic - /// analytics. + /// Gets or sets parameters that define the flow log format. /// - [JsonProperty(PropertyName = "flowAnalyticsConfiguration")] - public TrafficAnalyticsProperties FlowAnalyticsConfiguration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.format")] + public FlowLogFormatParameters Format {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } - if (StorageId == null) + if (this.StorageId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageId"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogProperties.cs new file mode 100644 index 000000000000..d87e9c53b7b4 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters that define the configuration of flow log. + /// + public partial class FlowLogProperties + { + /// + /// Initializes a new instance of the FlowLogProperties class. + /// + public FlowLogProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FlowLogProperties class. + /// + + /// ID of the storage account which is used to store the flow log. + /// + + /// Flag to enable/disable flow logging. + /// + + /// Parameters that define the retention policy for flow log. + /// + + /// Parameters that define the flow log format. + /// + public FlowLogProperties(string storageId, bool enabled, RetentionPolicyParameters retentionPolicy = default(RetentionPolicyParameters), FlowLogFormatParameters format = default(FlowLogFormatParameters)) + + { + this.StorageId = storageId; + this.Enabled = enabled; + this.RetentionPolicy = retentionPolicy; + this.Format = format; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets iD of the storage account which is used to store the flow log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageId")] + public string StorageId {get; set; } + + /// + /// Gets or sets flag to enable/disable flow logging. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled {get; set; } + + /// + /// Gets or sets parameters that define the retention policy for flow log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicyParameters RetentionPolicy {get; set; } + + /// + /// Gets or sets parameters that define the flow log format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "format")] + public FlowLogFormatParameters Format {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.StorageId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageId"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogPropertiesFormat.cs new file mode 100644 index 000000000000..6f40591d0c89 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogPropertiesFormat.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters that define the configuration of flow log. + /// + public partial class FlowLogPropertiesFormat + { + /// + /// Initializes a new instance of the FlowLogPropertiesFormat class. + /// + public FlowLogPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FlowLogPropertiesFormat class. + /// + + /// ID of network security group to which flow log will be applied. + /// + + /// Guid of network security group to which flow log will be applied. + /// + + /// ID of the storage account which is used to store the flow log. + /// + + /// Flag to enable/disable flow logging. + /// + + /// Parameters that define the retention policy for flow log. + /// + + /// Parameters that define the flow log format. + /// + + /// Parameters that define the configuration of traffic analytics. + /// + + /// The provisioning state of the flow log. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public FlowLogPropertiesFormat(string targetResourceId, string storageId, string targetResourceGuid = default(string), bool? enabled = default(bool?), RetentionPolicyParameters retentionPolicy = default(RetentionPolicyParameters), FlowLogFormatParameters format = default(FlowLogFormatParameters), TrafficAnalyticsProperties flowAnalyticsConfiguration = default(TrafficAnalyticsProperties), string provisioningState = default(string)) + + { + this.TargetResourceId = targetResourceId; + this.TargetResourceGuid = targetResourceGuid; + this.StorageId = storageId; + this.Enabled = enabled; + this.RetentionPolicy = retentionPolicy; + this.Format = format; + this.FlowAnalyticsConfiguration = flowAnalyticsConfiguration; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets iD of network security group to which flow log will be + /// applied. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } + + /// + /// Gets guid of network security group to which flow log will be applied. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGuid")] + public string TargetResourceGuid {get; private set; } + + /// + /// Gets or sets iD of the storage account which is used to store the flow log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageId")] + public string StorageId {get; set; } + + /// + /// Gets or sets flag to enable/disable flow logging. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } + + /// + /// Gets or sets parameters that define the retention policy for flow log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicyParameters RetentionPolicy {get; set; } + + /// + /// Gets or sets parameters that define the flow log format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "format")] + public FlowLogFormatParameters Format {get; set; } + + /// + /// Gets or sets parameters that define the configuration of traffic analytics. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flowAnalyticsConfiguration")] + public TrafficAnalyticsProperties FlowAnalyticsConfiguration {get; set; } + + /// + /// Gets the provisioning state of the flow log. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.TargetResourceId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); + } + if (this.StorageId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageId"); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogStatusParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogStatusParameters.cs index 9ed0ff9da09f..bf345f7bcd24 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FlowLogStatusParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FlowLogStatusParameters.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Parameters that define a resource to query flow log and traffic - /// analytics (optional) status. + /// Parameters that define a resource to query flow log and traffic analytics + /// (optional) status. /// public partial class FlowLogStatusParameters { @@ -31,11 +24,14 @@ public FlowLogStatusParameters() /// /// Initializes a new instance of the FlowLogStatusParameters class. /// - /// The target resource where getting - /// the flow log and traffic analytics (optional) status. + + /// The target resource where getting the flow log and traffic analytics + /// (optional) status. + /// public FlowLogStatusParameters(string targetResourceId) + { - TargetResourceId = targetResourceId; + this.TargetResourceId = targetResourceId; CustomInit(); } @@ -44,25 +40,26 @@ public FlowLogStatusParameters(string targetResourceId) /// partial void CustomInit(); + /// - /// Gets or sets the target resource where getting the flow log and - /// traffic analytics (optional) status. + /// Gets or sets the target resource where getting the flow log and traffic + /// analytics (optional) status. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfiguration.cs index ad66fc03d071..c90bef67ea4b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfiguration.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Frontend IP address of the load balancer. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FrontendIPConfiguration : SubResource { /// @@ -34,59 +24,81 @@ public FrontendIPConfiguration() /// /// Initializes a new instance of the FrontendIPConfiguration class. /// - /// Resource ID. - /// An array of references to inbound - /// rules that use this frontend IP. - /// An array of references to inbound - /// pools that use this frontend IP. - /// An array of references to outbound - /// rules that use this frontend IP. - /// An array of references to load - /// balancing rules that use this frontend IP. - /// The private IP address of the IP - /// configuration. - /// The Private IP allocation - /// method. Possible values include: 'Static', 'Dynamic' - /// Whether the specific - /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible - /// values include: 'IPv4', 'IPv6' - /// The reference to the subnet resource. - /// The reference to the Public IP - /// resource. - /// The reference to the Public IP Prefix - /// resource. - /// The reference to gateway load - /// balancer frontend IP. - /// The provisioning state of the - /// frontend IP configuration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the set of frontend IP configurations used by the load balancer. - /// This name can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - /// A list of availability zones denoting the IP - /// allocated for the resource needs to come from. - public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), SubResource publicIPPrefix = default(SubResource), SubResource gatewayLoadBalancer = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string), IList zones = default(IList)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of frontend IP + /// configurations used by the load balancer. This name can be used to access + /// the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// A list of availability zones denoting the IP allocated for the resource + /// needs to come from. + /// + + /// The reference to the subnet resource. + /// + + /// The provisioning state of the frontend IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// An array of references to inbound rules that use this frontend IP. + /// + + /// An array of references to inbound pools that use this frontend IP. + /// + + /// An array of references to outbound rules that use this frontend IP. + /// + + /// An array of references to load balancing rules that use this frontend IP. + /// + + /// The private IP address of the IP configuration. + /// + + /// The Private IP allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. + /// Possible values include: 'IPv4', 'IPv6' + + /// The reference to the Public IP resource. + /// + + /// The reference to the Public IP Prefix resource. + /// + + /// The reference to gateway load balancer frontend IP. + /// + public FrontendIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), Subnet subnet = default(Subnet), string provisioningState = default(string), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), PublicIPAddress publicIPAddress = default(PublicIPAddress), SubResource publicIPPrefix = default(SubResource), SubResource gatewayLoadBalancer = default(SubResource)) + + : base(id) { - InboundNatRules = inboundNatRules; - InboundNatPools = inboundNatPools; - OutboundRules = outboundRules; - LoadBalancingRules = loadBalancingRules; - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - PrivateIPAddressVersion = privateIPAddressVersion; - Subnet = subnet; - PublicIPAddress = publicIPAddress; - PublicIPPrefix = publicIPPrefix; - GatewayLoadBalancer = gatewayLoadBalancer; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; - Zones = zones; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.Zones = zones; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + this.InboundNatRules = inboundNatRules; + this.InboundNatPools = inboundNatPools; + this.OutboundRules = outboundRules; + this.LoadBalancingRules = loadBalancingRules; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.PublicIPAddress = publicIPAddress; + this.PublicIPPrefix = publicIPPrefix; + this.GatewayLoadBalancer = gatewayLoadBalancer; CustomInit(); } @@ -95,113 +107,107 @@ public FrontendIPConfiguration() /// partial void CustomInit(); + /// - /// Gets an array of references to inbound rules that use this frontend - /// IP. + /// Gets or sets the name of the resource that is unique within the set of + /// frontend IP configurations used by the load balancer. This name can be used + /// to access the resource. /// - [JsonProperty(PropertyName = "properties.inboundNatRules")] - public IList InboundNatRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets an array of references to inbound pools that use this frontend - /// IP. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.inboundNatPools")] - public IList InboundNatPools { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets an array of references to outbound rules that use this - /// frontend IP. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.outboundRules")] - public IList OutboundRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets an array of references to load balancing rules that use this - /// frontend IP. + /// Gets or sets a list of availability zones denoting the IP allocated for the + /// resource needs to come from. /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets the private IP address of the IP configuration. + /// Gets or sets the reference to the subnet resource. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets or sets the Private IP allocation method. Possible values - /// include: 'Static', 'Dynamic' + /// Gets the provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6' + /// Gets an array of references to inbound rules that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] - public string PrivateIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; private set; } /// - /// Gets or sets the reference to the subnet resource. + /// Gets an array of references to inbound pools that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatPools")] + public System.Collections.Generic.IList InboundNatPools {get; private set; } /// - /// Gets or sets the reference to the Public IP resource. + /// Gets an array of references to outbound rules that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public PublicIPAddress PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundRules")] + public System.Collections.Generic.IList OutboundRules {get; private set; } /// - /// Gets or sets the reference to the Public IP Prefix resource. + /// Gets an array of references to load balancing rules that use this frontend + /// IP. /// - [JsonProperty(PropertyName = "properties.publicIPPrefix")] - public SubResource PublicIPPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; private set; } /// - /// Gets or sets the reference to gateway load balancer frontend IP. + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] - public SubResource GatewayLoadBalancer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets the provisioning state of the frontend IP configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the Private IP allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of frontend IP configurations used by the load balancer. This name - /// can be used to access the resource. + /// Gets or sets whether the specific ipconfiguration is IPv4 or IPv6. Default + /// is taken as IPv4. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the reference to the Public IP resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } /// - /// Gets type of the resource. + /// Gets or sets the reference to the Public IP Prefix resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } /// - /// Gets or sets a list of availability zones denoting the IP allocated - /// for the resource needs to come from. + /// Gets or sets the reference to gateway load balancer frontend IP. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] + public SubResource GatewayLoadBalancer {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..69228a74ee5d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/FrontendIPConfigurationPropertiesFormat.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Frontend IP Configuration of the load balancer. + /// + public partial class FrontendIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the FrontendIPConfigurationPropertiesFormat class. + /// + public FrontendIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FrontendIPConfigurationPropertiesFormat class. + /// + + /// An array of references to inbound rules that use this frontend IP. + /// + + /// An array of references to inbound pools that use this frontend IP. + /// + + /// An array of references to outbound rules that use this frontend IP. + /// + + /// An array of references to load balancing rules that use this frontend IP. + /// + + /// The private IP address of the IP configuration. + /// + + /// The Private IP allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. + /// Possible values include: 'IPv4', 'IPv6' + + /// The reference to the subnet resource. + /// + + /// The reference to the Public IP resource. + /// + + /// The reference to the Public IP Prefix resource. + /// + + /// The reference to gateway load balancer frontend IP. + /// + + /// The provisioning state of the frontend IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public FrontendIPConfigurationPropertiesFormat(System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), SubResource publicIPPrefix = default(SubResource), SubResource gatewayLoadBalancer = default(SubResource), string provisioningState = default(string)) + + { + this.InboundNatRules = inboundNatRules; + this.InboundNatPools = inboundNatPools; + this.OutboundRules = outboundRules; + this.LoadBalancingRules = loadBalancingRules; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.PublicIPPrefix = publicIPPrefix; + this.GatewayLoadBalancer = gatewayLoadBalancer; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets an array of references to inbound rules that use this frontend IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; private set; } + + /// + /// Gets an array of references to inbound pools that use this frontend IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatPools")] + public System.Collections.Generic.IList InboundNatPools {get; private set; } + + /// + /// Gets an array of references to outbound rules that use this frontend IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outboundRules")] + public System.Collections.Generic.IList OutboundRules {get; private set; } + + /// + /// Gets an array of references to load balancing rules that use this frontend + /// IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; private set; } + + /// + /// Gets or sets the private IP address of the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the Private IP allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets whether the specific ipconfiguration is IPv4 or IPv6. Default + /// is taken as IPv4. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } + + /// + /// Gets or sets the reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets or sets the reference to the Public IP resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } + + /// + /// Gets or sets the reference to the Public IP Prefix resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } + + /// + /// Gets or sets the reference to gateway load balancer frontend IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayLoadBalancer")] + public SubResource GatewayLoadBalancer {get; set; } + + /// + /// Gets the provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GatewayCustomBgpIpAddressIpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/GatewayCustomBgpIpAddressIpConfiguration.cs index 942bc34d1a8b..da8f8d33d77b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GatewayCustomBgpIpAddressIpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GatewayCustomBgpIpAddressIpConfiguration.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -21,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class GatewayCustomBgpIpAddressIpConfiguration { /// - /// Initializes a new instance of the - /// GatewayCustomBgpIpAddressIpConfiguration class. + /// Initializes a new instance of the GatewayCustomBgpIpAddressIpConfiguration class. /// public GatewayCustomBgpIpAddressIpConfiguration() { @@ -30,17 +22,19 @@ public GatewayCustomBgpIpAddressIpConfiguration() } /// - /// Initializes a new instance of the - /// GatewayCustomBgpIpAddressIpConfiguration class. + /// Initializes a new instance of the GatewayCustomBgpIpAddressIpConfiguration class. /// - /// The IpconfigurationId of - /// ipconfiguration which belongs to gateway. - /// The custom BgpPeeringAddress which - /// belongs to IpconfigurationId. - public GatewayCustomBgpIpAddressIpConfiguration(string ipConfigurationId, string customBgpIpAddress) + + /// The IpconfigurationId of ipconfiguration which belongs to gateway. + /// + + /// The custom BgpPeeringAddress which belongs to IpconfigurationId. + /// + public GatewayCustomBgpIpAddressIpConfiguration(string ipConfigurationId, string customBgpIPAddress) + { - IpConfigurationId = ipConfigurationId; - CustomBgpIpAddress = customBgpIpAddress; + this.IPConfigurationId = ipConfigurationId; + this.CustomBgpIPAddress = customBgpIPAddress; CustomInit(); } @@ -49,36 +43,38 @@ public GatewayCustomBgpIpAddressIpConfiguration(string ipConfigurationId, string /// partial void CustomInit(); + /// - /// Gets or sets the IpconfigurationId of ipconfiguration which belongs - /// to gateway. + /// Gets or sets the IpconfigurationId of ipconfiguration which belongs to + /// gateway. /// - [JsonProperty(PropertyName = "ipConfigurationId")] - public string IpConfigurationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurationId")] + public string IPConfigurationId {get; set; } /// /// Gets or sets the custom BgpPeeringAddress which belongs to /// IpconfigurationId. /// - [JsonProperty(PropertyName = "customBgpIpAddress")] - public string CustomBgpIpAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "customBgpIpAddress")] + public string CustomBgpIPAddress {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (IpConfigurationId == null) + if (this.IPConfigurationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpConfigurationId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IPConfigurationId"); } - if (CustomBgpIpAddress == null) + if (this.CustomBgpIPAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CustomBgpIpAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CustomBgpIPAddress"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterface.cs b/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterface.cs index e074a3f6dfce..b7a93d0cc958 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterface.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterface.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Gateway load balancer tunnel interface of a load balancer backend - /// address pool. + /// Gateway load balancer tunnel interface of a load balancer backend address + /// pool. /// public partial class GatewayLoadBalancerTunnelInterface { /// - /// Initializes a new instance of the - /// GatewayLoadBalancerTunnelInterface class. + /// Initializes a new instance of the GatewayLoadBalancerTunnelInterface class. /// public GatewayLoadBalancerTunnelInterface() { @@ -29,25 +22,27 @@ public GatewayLoadBalancerTunnelInterface() } /// - /// Initializes a new instance of the - /// GatewayLoadBalancerTunnelInterface class. + /// Initializes a new instance of the GatewayLoadBalancerTunnelInterface class. /// - /// Port of gateway load balancer tunnel - /// interface. - /// Identifier of gateway load balancer tunnel - /// interface. - /// Protocol of gateway load balancer tunnel - /// interface. Possible values include: 'None', 'Native', - /// 'VXLAN' - /// Traffic type of gateway load balancer tunnel - /// interface. Possible values include: 'None', 'Internal', - /// 'External' + + /// Port of gateway load balancer tunnel interface. + /// + + /// Identifier of gateway load balancer tunnel interface. + /// + + /// Protocol of gateway load balancer tunnel interface. + /// Possible values include: 'None', 'Native', 'VXLAN' + + /// Traffic type of gateway load balancer tunnel interface. + /// Possible values include: 'None', 'Internal', 'External' public GatewayLoadBalancerTunnelInterface(int? port = default(int?), int? identifier = default(int?), string protocol = default(string), string type = default(string)) + { - Port = port; - Identifier = identifier; - Protocol = protocol; - Type = type; + this.Port = port; + this.Identifier = identifier; + this.Protocol = protocol; + this.Type = type; CustomInit(); } @@ -56,31 +51,29 @@ public GatewayLoadBalancerTunnelInterface() /// partial void CustomInit(); + /// /// Gets or sets port of gateway load balancer tunnel interface. /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int? Port {get; set; } /// /// Gets or sets identifier of gateway load balancer tunnel interface. /// - [JsonProperty(PropertyName = "identifier")] - public int? Identifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier")] + public int? Identifier {get; set; } /// - /// Gets or sets protocol of gateway load balancer tunnel interface. - /// Possible values include: 'None', 'Native', 'VXLAN' + /// Gets or sets protocol of gateway load balancer tunnel interface. Possible values include: 'None', 'Native', 'VXLAN' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets traffic type of gateway load balancer tunnel - /// interface. Possible values include: 'None', 'Internal', 'External' + /// Gets or sets traffic type of gateway load balancer tunnel interface. Possible values include: 'None', 'Internal', 'External' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs b/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs index 849a8b8eeb01..065c16ffdd7a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for GatewayLoadBalancerTunnelInterfaceType. /// + + public static class GatewayLoadBalancerTunnelInterfaceType { public const string None = "None"; public const string Internal = "Internal"; public const string External = "External"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs index a4972933b927..886fe9a62d84 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for GatewayLoadBalancerTunnelProtocol. /// + + public static class GatewayLoadBalancerTunnelProtocol { public const string None = "None"; public const string Native = "Native"; - public const string VXLAN = "VXLAN"; + public const string Vxlan = "VXLAN"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GatewayRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/GatewayRoute.cs index edb0940ebbb2..329ef1913a76 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GatewayRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GatewayRoute.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,24 +23,37 @@ public GatewayRoute() /// /// Initializes a new instance of the GatewayRoute class. /// - /// The gateway's local address. - /// The route's network prefix. - /// The route's next hop. - /// The peer this route was learned - /// from. - /// The source this route was learned - /// from. - /// The route's AS path sequence. - /// The route's weight. + + /// The gateway's local address. + /// + + /// The route's network prefix. + /// + + /// The route's next hop. + /// + + /// The peer this route was learned from. + /// + + /// The source this route was learned from. + /// + + /// The route's AS path sequence. + /// + + /// The route's weight. + /// public GatewayRoute(string localAddress = default(string), string network = default(string), string nextHop = default(string), string sourcePeer = default(string), string origin = default(string), string asPath = default(string), int? weight = default(int?)) + { - LocalAddress = localAddress; - Network = network; - NextHop = nextHop; - SourcePeer = sourcePeer; - Origin = origin; - AsPath = asPath; - Weight = weight; + this.LocalAddress = localAddress; + this.Network = network; + this.NextHop = nextHop; + this.SourcePeer = sourcePeer; + this.Origin = origin; + this.AsPath = asPath; + this.Weight = weight; CustomInit(); } @@ -55,47 +62,47 @@ public GatewayRoute() /// partial void CustomInit(); + /// - /// Gets the gateway's local address. + /// Gets the gateway's local address. /// - [JsonProperty(PropertyName = "localAddress")] - public string LocalAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localAddress")] + public string LocalAddress {get; private set; } /// - /// Gets the route's network prefix. + /// Gets the route's network prefix. /// - [JsonProperty(PropertyName = "network")] - public string Network { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "network")] + public string Network {get; private set; } /// - /// Gets the route's next hop. + /// Gets the route's next hop. /// - [JsonProperty(PropertyName = "nextHop")] - public string NextHop { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] + public string NextHop {get; private set; } /// /// Gets the peer this route was learned from. /// - [JsonProperty(PropertyName = "sourcePeer")] - public string SourcePeer { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePeer")] + public string SourcePeer {get; private set; } /// /// Gets the source this route was learned from. /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; private set; } /// - /// Gets the route's AS path sequence. + /// Gets the route's AS path sequence. /// - [JsonProperty(PropertyName = "asPath")] - public string AsPath { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asPath")] + public string AsPath {get; private set; } /// - /// Gets the route's weight. + /// Gets the route's weight. /// - [JsonProperty(PropertyName = "weight")] - public int? Weight { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "weight")] + public int? Weight {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GatewayRouteListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/GatewayRouteListResult.cs index d9a6814bcf51..21f518c35a57 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GatewayRouteListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GatewayRouteListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public GatewayRouteListResult() /// /// Initializes a new instance of the GatewayRouteListResult class. /// - /// List of gateway routes. - public GatewayRouteListResult(IList value = default(IList)) + + /// List of gateway routes. + /// + public GatewayRouteListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public GatewayRouteListResult() /// partial void CustomInit(); + /// /// Gets or sets list of gateway routes. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOARequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOARequest.cs index 7c1c8c97a42a..075954d1baae 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOARequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOARequest.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class GenerateExpressRoutePortsLOARequest { /// - /// Initializes a new instance of the - /// GenerateExpressRoutePortsLOARequest class. + /// Initializes a new instance of the GenerateExpressRoutePortsLOARequest class. /// public GenerateExpressRoutePortsLOARequest() { @@ -29,13 +21,15 @@ public GenerateExpressRoutePortsLOARequest() } /// - /// Initializes a new instance of the - /// GenerateExpressRoutePortsLOARequest class. + /// Initializes a new instance of the GenerateExpressRoutePortsLOARequest class. /// - /// The customer name. + + /// The customer name. + /// public GenerateExpressRoutePortsLOARequest(string customerName) + { - CustomerName = customerName; + this.CustomerName = customerName; CustomInit(); } @@ -44,24 +38,25 @@ public GenerateExpressRoutePortsLOARequest(string customerName) /// partial void CustomInit(); + /// /// Gets or sets the customer name. /// - [JsonProperty(PropertyName = "customerName")] - public string CustomerName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "customerName")] + public string CustomerName {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CustomerName == null) + if (this.CustomerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CustomerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CustomerName"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOAResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOAResult.cs index 977f46d9d80b..d86408e72d95 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOAResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GenerateExpressRoutePortsLOAResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class GenerateExpressRoutePortsLOAResult { /// - /// Initializes a new instance of the - /// GenerateExpressRoutePortsLOAResult class. + /// Initializes a new instance of the GenerateExpressRoutePortsLOAResult class. /// public GenerateExpressRoutePortsLOAResult() { @@ -28,14 +21,15 @@ public GenerateExpressRoutePortsLOAResult() } /// - /// Initializes a new instance of the - /// GenerateExpressRoutePortsLOAResult class. + /// Initializes a new instance of the GenerateExpressRoutePortsLOAResult class. /// - /// The content as a base64 encoded - /// string. + + /// The content as a base64 encoded string. + /// public GenerateExpressRoutePortsLOAResult(string encodedContent = default(string)) + { - EncodedContent = encodedContent; + this.EncodedContent = encodedContent; CustomInit(); } @@ -44,11 +38,11 @@ public GenerateExpressRoutePortsLOAResult() /// partial void CustomInit(); + /// /// Gets or sets the content as a base64 encoded string. /// - [JsonProperty(PropertyName = "encodedContent")] - public string EncodedContent { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "encodedContent")] + public string EncodedContent {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Geo.cs b/src/Network/Network.Management.Sdk/Generated/Models/Geo.cs index 092f5a24d7dd..b5fc6a360308 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Geo.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Geo.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,16 +9,18 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for Geo. /// + + public static class Geo { - public const string GLOBAL = "GLOBAL"; - public const string AFRI = "AFRI"; - public const string APAC = "APAC"; - public const string EURO = "EURO"; - public const string LATAM = "LATAM"; + public const string Global = "GLOBAL"; + public const string Afri = "AFRI"; + public const string Apac = "APAC"; + public const string Euro = "EURO"; + public const string Latam = "LATAM"; public const string NAM = "NAM"; public const string ME = "ME"; - public const string OCEANIA = "OCEANIA"; + public const string Oceania = "OCEANIA"; public const string AQ = "AQ"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GetInboundRoutesParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/GetInboundRoutesParameters.cs index 562034309048..0c7c31c96b49 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GetInboundRoutesParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GetInboundRoutesParameters.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The parameters specifying the connection resource whose inbound routes - /// are being requested. + /// The parameters specifying the connection resource whose inbound routes are + /// being requested. /// public partial class GetInboundRoutesParameters { @@ -30,15 +24,18 @@ public GetInboundRoutesParameters() /// /// Initializes a new instance of the GetInboundRoutesParameters class. /// - /// The connection resource whose inbound - /// routes are being requested. - /// The type of the specified connection - /// resource like ExpressRouteConnection, HubVirtualNetworkConnection, - /// VpnConnection and P2SConnection. + + /// The connection resource whose inbound routes are being requested. + /// + + /// The type of the specified connection resource like ExpressRouteConnection, + /// HubVirtualNetworkConnection, VpnConnection and P2SConnection. + /// public GetInboundRoutesParameters(string resourceUri = default(string), string connectionType = default(string)) + { - ResourceUri = resourceUri; - ConnectionType = connectionType; + this.ResourceUri = resourceUri; + this.ConnectionType = connectionType; CustomInit(); } @@ -47,20 +44,20 @@ public GetInboundRoutesParameters() /// partial void CustomInit(); + /// /// Gets or sets the connection resource whose inbound routes are being /// requested. /// - [JsonProperty(PropertyName = "resourceUri")] - public string ResourceUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUri")] + public string ResourceUri {get; set; } /// /// Gets or sets the type of the specified connection resource like - /// ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection - /// and P2SConnection. + /// ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + /// P2SConnection. /// - [JsonProperty(PropertyName = "connectionType")] - public string ConnectionType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionType")] + public string ConnectionType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GetOutboundRoutesParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/GetOutboundRoutesParameters.cs index c37b1ffed7df..ae1c18b9cb63 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GetOutboundRoutesParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GetOutboundRoutesParameters.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The parameters specifying the connection resource whose outbound routes - /// are being requested. + /// The parameters specifying the connection resource whose outbound routes are + /// being requested. /// public partial class GetOutboundRoutesParameters { /// - /// Initializes a new instance of the GetOutboundRoutesParameters - /// class. + /// Initializes a new instance of the GetOutboundRoutesParameters class. /// public GetOutboundRoutesParameters() { @@ -29,18 +22,20 @@ public GetOutboundRoutesParameters() } /// - /// Initializes a new instance of the GetOutboundRoutesParameters - /// class. + /// Initializes a new instance of the GetOutboundRoutesParameters class. /// - /// The connection resource whose outbound - /// routes are being requested. - /// The type of the specified connection - /// resource like ExpressRouteConnection, HubVirtualNetworkConnection, - /// VpnConnection and P2SConnection. + + /// The connection resource whose outbound routes are being requested. + /// + + /// The type of the specified connection resource like ExpressRouteConnection, + /// HubVirtualNetworkConnection, VpnConnection and P2SConnection. + /// public GetOutboundRoutesParameters(string resourceUri = default(string), string connectionType = default(string)) + { - ResourceUri = resourceUri; - ConnectionType = connectionType; + this.ResourceUri = resourceUri; + this.ConnectionType = connectionType; CustomInit(); } @@ -49,20 +44,20 @@ public GetOutboundRoutesParameters() /// partial void CustomInit(); + /// - /// Gets or sets the connection resource whose outbound routes are - /// being requested. + /// Gets or sets the connection resource whose outbound routes are being + /// requested. /// - [JsonProperty(PropertyName = "resourceUri")] - public string ResourceUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUri")] + public string ResourceUri {get; set; } /// /// Gets or sets the type of the specified connection resource like - /// ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection - /// and P2SConnection. + /// ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + /// P2SConnection. /// - [JsonProperty(PropertyName = "connectionType")] - public string ConnectionType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionType")] + public string ConnectionType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GetVpnSitesConfigurationRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/GetVpnSitesConfigurationRequest.cs index 07bb1f2585b2..2c1f52ca6afa 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GetVpnSitesConfigurationRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GetVpnSitesConfigurationRequest.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class GetVpnSitesConfigurationRequest { /// - /// Initializes a new instance of the GetVpnSitesConfigurationRequest - /// class. + /// Initializes a new instance of the GetVpnSitesConfigurationRequest class. /// public GetVpnSitesConfigurationRequest() { @@ -31,17 +21,19 @@ public GetVpnSitesConfigurationRequest() } /// - /// Initializes a new instance of the GetVpnSitesConfigurationRequest - /// class. + /// Initializes a new instance of the GetVpnSitesConfigurationRequest class. /// - /// The sas-url to download the - /// configurations for vpn-sites. - /// List of resource-ids of the vpn-sites for - /// which config is to be downloaded. - public GetVpnSitesConfigurationRequest(string outputBlobSasUrl, IList vpnSites = default(IList)) + + /// List of resource-ids of the vpn-sites for which config is to be downloaded. + /// + + /// The sas-url to download the configurations for vpn-sites. + /// + public GetVpnSitesConfigurationRequest(string outputBlobSasUrl, System.Collections.Generic.IList vpnSites = default(System.Collections.Generic.IList)) + { - VpnSites = vpnSites; - OutputBlobSasUrl = outputBlobSasUrl; + this.VpnSites = vpnSites; + this.OutputBlobSasUrl = outputBlobSasUrl; CustomInit(); } @@ -50,32 +42,33 @@ public GetVpnSitesConfigurationRequest() /// partial void CustomInit(); + /// - /// Gets or sets list of resource-ids of the vpn-sites for which config - /// is to be downloaded. + /// Gets or sets list of resource-ids of the vpn-sites for which config is to + /// be downloaded. /// - [JsonProperty(PropertyName = "vpnSites")] - public IList VpnSites { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnSites")] + public System.Collections.Generic.IList VpnSites {get; set; } /// - /// Gets or sets the sas-url to download the configurations for - /// vpn-sites. + /// Gets or sets the sas-url to download the configurations for vpn-sites. /// - [JsonProperty(PropertyName = "outputBlobSasUrl")] - public string OutputBlobSasUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "outputBlobSasUrl")] + public string OutputBlobSasUrl {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OutputBlobSasUrl == null) + if (this.OutputBlobSasUrl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "OutputBlobSasUrl"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OutputBlobSasUrl"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GroupByUserSession.cs b/src/Network/Network.Management.Sdk/Generated/Models/GroupByUserSession.cs index 9d8db6b5436a..5678b7aa0b37 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GroupByUserSession.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GroupByUserSession.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,11 +23,13 @@ public GroupByUserSession() /// /// Initializes a new instance of the GroupByUserSession class. /// - /// List of group by clause - /// variables. - public GroupByUserSession(IList groupByVariables) + + /// List of group by clause variables. + /// + public GroupByUserSession(System.Collections.Generic.IList groupByVariables) + { - GroupByVariables = groupByVariables; + this.GroupByVariables = groupByVariables; CustomInit(); } @@ -45,27 +38,27 @@ public GroupByUserSession(IList groupByVariables) /// partial void CustomInit(); + /// /// Gets or sets list of group by clause variables. /// - [JsonProperty(PropertyName = "groupByVariables")] - public IList GroupByVariables { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByVariables")] + public System.Collections.Generic.IList GroupByVariables {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (GroupByVariables == null) + if (this.GroupByVariables == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "GroupByVariables"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "GroupByVariables"); } - if (GroupByVariables != null) + if (this.GroupByVariables != null) { - foreach (var element in GroupByVariables) + foreach (var element in this.GroupByVariables) { if (element != null) { @@ -75,4 +68,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GroupByVariable.cs b/src/Network/Network.Management.Sdk/Generated/Models/GroupByVariable.cs index 5493e4872f1d..52d750ecdc2a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GroupByVariable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GroupByVariable.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,11 +23,13 @@ public GroupByVariable() /// /// Initializes a new instance of the GroupByVariable class. /// - /// User Session clause variable. Possible - /// values include: 'ClientAddr', 'GeoLocation', 'None' + + /// User Session clause variable. + /// Possible values include: 'ClientAddr', 'GeoLocation', 'None' public GroupByVariable(string variableName) + { - VariableName = variableName; + this.VariableName = variableName; CustomInit(); } @@ -43,25 +38,25 @@ public GroupByVariable(string variableName) /// partial void CustomInit(); + /// - /// Gets or sets user Session clause variable. Possible values include: - /// 'ClientAddr', 'GeoLocation', 'None' + /// Gets or sets user Session clause variable. Possible values include: 'ClientAddr', 'GeoLocation', 'None' /// - [JsonProperty(PropertyName = "variableName")] - public string VariableName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "variableName")] + public string VariableName {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VariableName == null) + if (this.VariableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VariableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VariableName"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/GroupConnectivity.cs b/src/Network/Network.Management.Sdk/Generated/Models/GroupConnectivity.cs index 1887920ed507..47762f0252c9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/GroupConnectivity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/GroupConnectivity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for GroupConnectivity. /// + + public static class GroupConnectivity { public const string None = "None"; public const string DirectlyConnected = "DirectlyConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfiguration.cs index e0fcef0e8b7d..a66140a90532 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfiguration.cs @@ -1,45 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// HTTP configuration of the connectivity check. /// - public partial class HTTPConfiguration + public partial class HttpConfiguration { /// - /// Initializes a new instance of the HTTPConfiguration class. + /// Initializes a new instance of the HttpConfiguration class. /// - public HTTPConfiguration() + public HttpConfiguration() { CustomInit(); } /// - /// Initializes a new instance of the HTTPConfiguration class. + /// Initializes a new instance of the HttpConfiguration class. /// - /// HTTP method. Possible values include: - /// 'Get' - /// List of HTTP headers. - /// Valid status codes. - public HTTPConfiguration(string method = default(string), IList headers = default(IList), IList validStatusCodes = default(IList)) + + /// HTTP method. + /// Possible values include: 'Get' + + /// List of HTTP headers. + /// + + /// Valid status codes. + /// + public HttpConfiguration(string method = default(string), System.Collections.Generic.IList headers = default(System.Collections.Generic.IList), System.Collections.Generic.IList validStatusCodes = default(System.Collections.Generic.IList)) + { - Method = method; - Headers = headers; - ValidStatusCodes = validStatusCodes; + this.Method = method; + this.Headers = headers; + this.ValidStatusCodes = validStatusCodes; CustomInit(); } @@ -48,23 +46,23 @@ public HTTPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets HTTP method. Possible values include: 'Get' + /// Gets or sets hTTP method. Possible values include: 'Get' /// - [JsonProperty(PropertyName = "method")] - public string Method { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "method")] + public string Method {get; set; } /// /// Gets or sets list of HTTP headers. /// - [JsonProperty(PropertyName = "headers")] - public IList Headers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "headers")] + public System.Collections.Generic.IList Headers {get; set; } /// /// Gets or sets valid status codes. /// - [JsonProperty(PropertyName = "validStatusCodes")] - public IList ValidStatusCodes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "validStatusCodes")] + public System.Collections.Generic.IList ValidStatusCodes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfigurationMethod.cs b/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfigurationMethod.cs index 7613d51f586e..1d6883c96e09 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfigurationMethod.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HTTPConfigurationMethod.cs @@ -1,22 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for HTTPConfigurationMethod. + /// Defines values for HttpConfigurationMethod. /// - public static class HTTPConfigurationMethod + + + public static class HttpConfigurationMethod { public const string Get = "Get"; public const string Post = "Post"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HTTPHeader.cs b/src/Network/Network.Management.Sdk/Generated/Models/HTTPHeader.cs index 9fa58986ba05..9358bcb5b55d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HTTPHeader.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HTTPHeader.cs @@ -1,40 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// /// The HTTP header. /// - public partial class HTTPHeader + public partial class HttpHeader { /// - /// Initializes a new instance of the HTTPHeader class. + /// Initializes a new instance of the HttpHeader class. /// - public HTTPHeader() + public HttpHeader() { CustomInit(); } /// - /// Initializes a new instance of the HTTPHeader class. + /// Initializes a new instance of the HttpHeader class. /// - /// The name in HTTP header. - /// The value in HTTP header. - public HTTPHeader(string name = default(string), string value = default(string)) + + /// The name in HTTP header. + /// + + /// The value in HTTP header. + /// + public HttpHeader(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -43,17 +42,17 @@ public HTTPHeader() /// partial void CustomInit(); + /// /// Gets or sets the name in HTTP header. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value in HTTP header. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HTTPMethod.cs b/src/Network/Network.Management.Sdk/Generated/Models/HTTPMethod.cs index 5247c370e25d..b6a8c1914409 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HTTPMethod.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HTTPMethod.cs @@ -1,21 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for HTTPMethod. + /// Defines values for HttpMethod. /// - public static class HTTPMethod + + + public static class HttpMethod { public const string Get = "Get"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HopLink.cs b/src/Network/Network.Management.Sdk/Generated/Models/HopLink.cs index cfec5a05915c..481954ffe491 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HopLink.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HopLink.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Hop link. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class HopLink { /// @@ -34,27 +24,41 @@ public HopLink() /// /// Initializes a new instance of the HopLink class. /// - /// The ID of the next hop. - /// Link type. - /// Minimum roundtrip time in - /// milliseconds. - /// Average roundtrip time in - /// milliseconds. - /// Maximum roundtrip time in - /// milliseconds. - /// List of issues. - /// Provides additional context on links. - /// Resource ID. - public HopLink(string nextHopId = default(string), string linkType = default(string), long? roundTripTimeMin = default(long?), long? roundTripTimeAvg = default(long?), long? roundTripTimeMax = default(long?), IList issues = default(IList), IDictionary context = default(IDictionary), string resourceId = default(string)) + + /// The ID of the next hop. + /// + + /// Link type. + /// + + /// List of issues. + /// + + /// Provides additional context on links. + /// + + /// Resource ID. + /// + + /// Minimum roundtrip time in milliseconds. + /// + + /// Average roundtrip time in milliseconds. + /// + + /// Maximum roundtrip time in milliseconds. + /// + public HopLink(string nextHopId = default(string), string linkType = default(string), System.Collections.Generic.IList issues = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary context = default(System.Collections.Generic.IDictionary), string resourceId = default(string), long? roundTripTimeMin = default(long?), long? roundTripTimeAvg = default(long?), long? roundTripTimeMax = default(long?)) + { - NextHopId = nextHopId; - LinkType = linkType; - RoundTripTimeMin = roundTripTimeMin; - RoundTripTimeAvg = roundTripTimeAvg; - RoundTripTimeMax = roundTripTimeMax; - Issues = issues; - Context = context; - ResourceId = resourceId; + this.NextHopId = nextHopId; + this.LinkType = linkType; + this.Issues = issues; + this.Context = context; + this.ResourceId = resourceId; + this.RoundTripTimeMin = roundTripTimeMin; + this.RoundTripTimeAvg = roundTripTimeAvg; + this.RoundTripTimeMax = roundTripTimeMax; CustomInit(); } @@ -63,95 +67,100 @@ public HopLink() /// partial void CustomInit(); + /// /// Gets the ID of the next hop. /// - [JsonProperty(PropertyName = "nextHopId")] - public string NextHopId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopId")] + public string NextHopId {get; private set; } /// /// Gets link type. /// - [JsonProperty(PropertyName = "linkType")] - public string LinkType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "linkType")] + public string LinkType {get; private set; } /// - /// Gets minimum roundtrip time in milliseconds. + /// Gets list of issues. /// - [JsonProperty(PropertyName = "properties.roundTripTimeMin")] - public long? RoundTripTimeMin { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "issues")] + public System.Collections.Generic.IList Issues {get; private set; } /// - /// Gets average roundtrip time in milliseconds. + /// Gets provides additional context on links. /// - [JsonProperty(PropertyName = "properties.roundTripTimeAvg")] - public long? RoundTripTimeAvg { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "context")] + public System.Collections.Generic.IDictionary Context {get; private set; } /// - /// Gets maximum roundtrip time in milliseconds. + /// Gets resource ID. /// - [JsonProperty(PropertyName = "properties.roundTripTimeMax")] - public long? RoundTripTimeMax { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; private set; } /// - /// Gets list of issues. + /// Gets minimum roundtrip time in milliseconds. /// - [JsonProperty(PropertyName = "issues")] - public IList Issues { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roundTripTimeMin")] + public long? RoundTripTimeMin {get; private set; } /// - /// Gets provides additional context on links. + /// Gets average roundtrip time in milliseconds. /// - [JsonProperty(PropertyName = "context")] - public IDictionary Context { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roundTripTimeAvg")] + public long? RoundTripTimeAvg {get; private set; } /// - /// Gets resource ID. + /// Gets maximum roundtrip time in milliseconds. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roundTripTimeMax")] + public long? RoundTripTimeMax {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RoundTripTimeMin != null) + + + + + + if (this.RoundTripTimeMin != null) { - if (RoundTripTimeMin > 4294967295) + if (this.RoundTripTimeMin > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeMin", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RoundTripTimeMin", 4294967295); } - if (RoundTripTimeMin < 0) + if (this.RoundTripTimeMin < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeMin", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RoundTripTimeMin", 0); } } - if (RoundTripTimeAvg != null) + if (this.RoundTripTimeAvg != null) { - if (RoundTripTimeAvg > 4294967295) + if (this.RoundTripTimeAvg > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeAvg", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RoundTripTimeAvg", 4294967295); } - if (RoundTripTimeAvg < 0) + if (this.RoundTripTimeAvg < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeAvg", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RoundTripTimeAvg", 0); } } - if (RoundTripTimeMax != null) + if (this.RoundTripTimeMax != null) { - if (RoundTripTimeMax > 4294967295) + if (this.RoundTripTimeMax > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeMax", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RoundTripTimeMax", 4294967295); } - if (RoundTripTimeMax < 0) + if (this.RoundTripTimeMax < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeMax", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RoundTripTimeMax", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HopLinkProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/HopLinkProperties.cs new file mode 100644 index 000000000000..da3d3b44a8bb --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/HopLinkProperties.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Hop link properties. + /// + public partial class HopLinkProperties + { + /// + /// Initializes a new instance of the HopLinkProperties class. + /// + public HopLinkProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HopLinkProperties class. + /// + + /// Minimum roundtrip time in milliseconds. + /// + + /// Average roundtrip time in milliseconds. + /// + + /// Maximum roundtrip time in milliseconds. + /// + public HopLinkProperties(long? roundTripTimeMin = default(long?), long? roundTripTimeAvg = default(long?), long? roundTripTimeMax = default(long?)) + + { + this.RoundTripTimeMin = roundTripTimeMin; + this.RoundTripTimeAvg = roundTripTimeAvg; + this.RoundTripTimeMax = roundTripTimeMax; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets minimum roundtrip time in milliseconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roundTripTimeMin")] + public long? RoundTripTimeMin {get; private set; } + + /// + /// Gets average roundtrip time in milliseconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roundTripTimeAvg")] + public long? RoundTripTimeAvg {get; private set; } + + /// + /// Gets maximum roundtrip time in milliseconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roundTripTimeMax")] + public long? RoundTripTimeMax {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RoundTripTimeMin != null) + { + if (this.RoundTripTimeMin > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RoundTripTimeMin", 4294967295); + } + if (this.RoundTripTimeMin < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RoundTripTimeMin", 0); + } + } + if (this.RoundTripTimeAvg != null) + { + if (this.RoundTripTimeAvg > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RoundTripTimeAvg", 4294967295); + } + if (this.RoundTripTimeAvg < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RoundTripTimeAvg", 0); + } + } + if (this.RoundTripTimeMax != null) + { + if (this.RoundTripTimeMax > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RoundTripTimeMax", 4294967295); + } + if (this.RoundTripTimeMax < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RoundTripTimeMax", 0); + } + } + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Hub.cs b/src/Network/Network.Management.Sdk/Generated/Models/Hub.cs index a086b9d5dd9a..7e2a6e9ec455 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Hub.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Hub.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public Hub() /// /// Initializes a new instance of the Hub class. /// - /// Resource Id. - /// Resource Type. + + /// Resource Id. + /// + + /// Resource Type. + /// public Hub(string resourceId = default(string), string resourceType = default(string)) + { - ResourceId = resourceId; - ResourceType = resourceType; + this.ResourceId = resourceId; + this.ResourceType = resourceType; CustomInit(); } @@ -43,17 +42,17 @@ public Hub() /// partial void CustomInit(); + /// /// Gets or sets resource Id. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets resource Type. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubBgpConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubBgpConnectionStatus.cs index ec48fbe3ca53..f7ab9dff0423 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubBgpConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubBgpConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for HubBgpConnectionStatus. /// + + public static class HubBgpConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class HubBgpConnectionStatus public const string Connected = "Connected"; public const string NotConnected = "NotConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubIPAddresses.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubIPAddresses.cs index 43406327f25b..bed2e14a0408 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubIPAddresses.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubIPAddresses.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public HubIPAddresses() /// /// Initializes a new instance of the HubIPAddresses class. /// - /// Public IP addresses associated with azure - /// firewall. - /// Private IP Address associated with - /// azure firewall. + + /// Public IP addresses associated with azure firewall. + /// + + /// Private IP Address associated with azure firewall. + /// public HubIPAddresses(HubPublicIPAddresses publicIPs = default(HubPublicIPAddresses), string privateIPAddress = default(string)) + { - PublicIPs = publicIPs; - PrivateIPAddress = privateIPAddress; + this.PublicIPs = publicIPs; + this.PrivateIPAddress = privateIPAddress; CustomInit(); } @@ -45,17 +42,17 @@ public HubIPAddresses() /// partial void CustomInit(); + /// /// Gets or sets public IP addresses associated with azure firewall. /// - [JsonProperty(PropertyName = "publicIPs")] - public HubPublicIPAddresses PublicIPs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPs")] + public HubPublicIPAddresses PublicIPs {get; set; } /// /// Gets or sets private IP Address associated with azure firewall. /// - [JsonProperty(PropertyName = "privateIPAddress")] - public string PrivateIPAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..9f16a2712928 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubIPConfigurationPropertiesFormat.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of IP configuration. + /// + public partial class HubIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the HubIPConfigurationPropertiesFormat class. + /// + public HubIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HubIPConfigurationPropertiesFormat class. + /// + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the subnet resource. + /// + + /// The reference to the public IP resource. + /// + + /// The provisioning state of the IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public HubIPConfigurationPropertiesFormat(string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string)) + + { + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the private IP address of the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets the reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets or sets the reference to the public IP resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } + + /// + /// Gets the provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubIpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubIpConfiguration.cs index fd8a90ac97a1..28b7de4f8954 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubIpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubIpConfiguration.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IpConfigurations. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class HubIpConfiguration : SubResource { /// @@ -32,33 +24,45 @@ public HubIpConfiguration() /// /// Initializes a new instance of the HubIpConfiguration class. /// - /// Resource ID. - /// The private IP address of the IP - /// configuration. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// The reference to the subnet resource. - /// The reference to the public IP - /// resource. - /// The provisioning state of the IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Name of the Ip Configuration. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Ipconfiguration type. - public HubIpConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the Ip Configuration. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Ipconfiguration type. + /// + + /// The reference to the subnet resource. + /// + + /// The provisioning state of the IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the public IP resource. + /// + public HubIpConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), PublicIPAddress publicIPAddress = default(PublicIPAddress)) + + : base(id) { - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - Subnet = subnet; - PublicIPAddress = publicIPAddress; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.PublicIPAddress = publicIPAddress; CustomInit(); } @@ -67,57 +71,54 @@ public HubIpConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the private IP address of the IP configuration. + /// Gets or sets name of the Ip Configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the subnet resource. + /// Gets ipconfiguration type. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the reference to the public IP resource. + /// Gets or sets the reference to the subnet resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public PublicIPAddress PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets the provisioning state of the IP configuration resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets name of the Ip Configuration. + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets ipconfiguration type. + /// Gets or sets the reference to the public IP resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubPublicIPAddresses.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubPublicIPAddresses.cs index 613fba8f9cad..9eba0dc326af 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubPublicIPAddresses.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubPublicIPAddresses.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,18 @@ public HubPublicIPAddresses() /// /// Initializes a new instance of the HubPublicIPAddresses class. /// - /// The list of Public IP addresses associated - /// with azure firewall or IP addresses to be retained. - /// The number of Public IP addresses associated - /// with azure firewall. - public HubPublicIPAddresses(IList addresses = default(IList), int? count = default(int?)) + + /// The list of Public IP addresses associated with azure firewall or IP + /// addresses to be retained. + /// + + /// The number of Public IP addresses associated with azure firewall. + /// + public HubPublicIPAddresses(System.Collections.Generic.IList addresses = default(System.Collections.Generic.IList), int? count = default(int?)) + { - Addresses = addresses; - Count = count; + this.Addresses = addresses; + this.Count = count; CustomInit(); } @@ -47,19 +43,19 @@ public HubPublicIPAddresses() /// partial void CustomInit(); + /// - /// Gets or sets the list of Public IP addresses associated with azure - /// firewall or IP addresses to be retained. + /// Gets or sets the list of Public IP addresses associated with azure firewall + /// or IP addresses to be retained. /// - [JsonProperty(PropertyName = "addresses")] - public IList Addresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addresses")] + public System.Collections.Generic.IList Addresses {get; set; } /// - /// Gets or sets the number of Public IP addresses associated with - /// azure firewall. + /// Gets or sets the number of Public IP addresses associated with azure + /// firewall. /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public int? Count {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubRoute.cs index 56c4ce2aecfe..aff8b95e104f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubRoute.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,21 +23,30 @@ public HubRoute() /// /// Initializes a new instance of the HubRoute class. /// - /// The name of the Route that is unique within a - /// RouteTable. This name can be used to access this route. - /// The type of destinations (eg: CIDR, - /// ResourceId, Service). - /// List of all destinations. - /// The type of next hop (eg: - /// ResourceId). - /// NextHop resource ID. - public HubRoute(string name, string destinationType, IList destinations, string nextHopType, string nextHop) + + /// The name of the Route that is unique within a RouteTable. This name can be + /// used to access this route. + /// + + /// The type of destinations (eg: CIDR, ResourceId, Service). + /// + + /// List of all destinations. + /// + + /// The type of next hop (eg: ResourceId). + /// + + /// NextHop resource ID. + /// + public HubRoute(string name, string destinationType, System.Collections.Generic.IList destinations, string nextHopType, string nextHop) + { - Name = name; - DestinationType = destinationType; - Destinations = destinations; - NextHopType = nextHopType; - NextHop = nextHop; + this.Name = name; + this.DestinationType = destinationType; + this.Destinations = destinations; + this.NextHopType = nextHopType; + this.NextHop = nextHop; CustomInit(); } @@ -55,66 +55,70 @@ public HubRoute(string name, string destinationType, IList destinations, /// partial void CustomInit(); + /// - /// Gets or sets the name of the Route that is unique within a - /// RouteTable. This name can be used to access this route. + /// Gets or sets the name of the Route that is unique within a RouteTable. This + /// name can be used to access this route. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the type of destinations (eg: CIDR, ResourceId, - /// Service). + /// Gets or sets the type of destinations (eg: CIDR, ResourceId, Service). /// - [JsonProperty(PropertyName = "destinationType")] - public string DestinationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationType")] + public string DestinationType {get; set; } /// /// Gets or sets list of all destinations. /// - [JsonProperty(PropertyName = "destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Gets or sets the type of next hop (eg: ResourceId). /// - [JsonProperty(PropertyName = "nextHopType")] - public string NextHopType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + public string NextHopType {get; set; } /// /// Gets or sets nextHop resource ID. /// - [JsonProperty(PropertyName = "nextHop")] - public string NextHop { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] + public string NextHop {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (DestinationType == null) + if (this.DestinationType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationType"); } - if (Destinations == null) + if (this.Destinations == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Destinations"); } - if (NextHopType == null) + if (this.NextHopType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NextHopType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NextHopType"); } - if (NextHop == null) + if (this.NextHop == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NextHop"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NextHop"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTable.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTable.cs index 6af63b5da34f..e653e883a01a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTable.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// RouteTable resource in a virtual hub. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class HubRouteTable : SubResource { /// @@ -34,34 +24,46 @@ public HubRouteTable() /// /// Initializes a new instance of the HubRouteTable class. /// - /// Resource ID. - /// List of all routes. - /// List of labels associated with this route - /// table. - /// List of all connections - /// associated with this route table. - /// List of all connections that - /// advertise to this route table. - /// The provisioning state of the - /// RouteTable resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public HubRouteTable(string id = default(string), IList routes = default(IList), IList labels = default(IList), IList associatedConnections = default(IList), IList propagatingConnections = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the RouteTable resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of all routes. + /// + + /// List of labels associated with this route table. + /// + + /// List of all connections associated with this route table. + /// + + /// List of all connections that advertise to this route table. + /// + public HubRouteTable(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList labels = default(System.Collections.Generic.IList), System.Collections.Generic.IList associatedConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList propagatingConnections = default(System.Collections.Generic.IList)) + + : base(id) { - Routes = routes; - Labels = labels; - AssociatedConnections = associatedConnections; - PropagatingConnections = propagatingConnections; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Routes = routes; + this.Labels = labels; + this.AssociatedConnections = associatedConnections; + this.PropagatingConnections = propagatingConnections; CustomInit(); } @@ -70,56 +72,55 @@ public HubRouteTable() /// partial void CustomInit(); + /// - /// Gets or sets list of all routes. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.routes")] - public IList Routes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets list of labels associated with this route table. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.labels")] - public IList Labels { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets list of all connections associated with this route table. + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.associatedConnections")] - public IList AssociatedConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets list of all connections that advertise to this route table. + /// Gets the provisioning state of the RouteTable resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.propagatingConnections")] - public IList PropagatingConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the RouteTable resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets list of all routes. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routes")] + public System.Collections.Generic.IList Routes {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets list of labels associated with this route table. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labels")] + public System.Collections.Generic.IList Labels {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets list of all connections associated with this route table. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.associatedConnections")] + public System.Collections.Generic.IList AssociatedConnections {get; private set; } /// - /// Gets resource type. + /// Gets list of all connections that advertise to this route table. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.propagatingConnections")] + public System.Collections.Generic.IList PropagatingConnections {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTableProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTableProperties.cs new file mode 100644 index 000000000000..830d4e3edf9e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubRouteTableProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for RouteTable. + /// + public partial class HubRouteTableProperties + { + /// + /// Initializes a new instance of the HubRouteTableProperties class. + /// + public HubRouteTableProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HubRouteTableProperties class. + /// + + /// List of all routes. + /// + + /// List of labels associated with this route table. + /// + + /// List of all connections associated with this route table. + /// + + /// List of all connections that advertise to this route table. + /// + + /// The provisioning state of the RouteTable resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public HubRouteTableProperties(System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList labels = default(System.Collections.Generic.IList), System.Collections.Generic.IList associatedConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList propagatingConnections = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Routes = routes; + this.Labels = labels; + this.AssociatedConnections = associatedConnections; + this.PropagatingConnections = propagatingConnections; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of all routes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routes")] + public System.Collections.Generic.IList Routes {get; set; } + + /// + /// Gets or sets list of labels associated with this route table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labels")] + public System.Collections.Generic.IList Labels {get; set; } + + /// + /// Gets list of all connections associated with this route table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedConnections")] + public System.Collections.Generic.IList AssociatedConnections {get; private set; } + + /// + /// Gets list of all connections that advertise to this route table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "propagatingConnections")] + public System.Collections.Generic.IList PropagatingConnections {get; private set; } + + /// + /// Gets the provisioning state of the RouteTable resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubRoutingPreference.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubRoutingPreference.cs index c0f53faa5fd3..1a5faf5aa103 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubRoutingPreference.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubRoutingPreference.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for HubRoutingPreference. /// + + public static class HubRoutingPreference { public const string ExpressRoute = "ExpressRoute"; public const string VpnGateway = "VpnGateway"; public const string ASPath = "ASPath"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnection.cs index eb800f9533fb..024697067231 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnection.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// HubVirtualNetworkConnection Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class HubVirtualNetworkConnection : SubResource { /// - /// Initializes a new instance of the HubVirtualNetworkConnection - /// class. + /// Initializes a new instance of the HubVirtualNetworkConnection class. /// public HubVirtualNetworkConnection() { @@ -31,40 +22,49 @@ public HubVirtualNetworkConnection() } /// - /// Initializes a new instance of the HubVirtualNetworkConnection - /// class. + /// Initializes a new instance of the HubVirtualNetworkConnection class. /// - /// Resource ID. - /// Reference to the remote virtual - /// network. - /// Deprecated: VirtualHub to - /// RemoteVnet transit to enabled or not. - /// Deprecated: Allow - /// RemoteVnet to use Virtual Hub's gateways. - /// Enable internet - /// security. - /// The Routing Configuration - /// indicating the associated and propagated route tables on this - /// connection. - /// The provisioning state of the hub - /// virtual network connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public HubVirtualNetworkConnection(string id = default(string), SubResource remoteVirtualNetwork = default(SubResource), bool? allowHubToRemoteVnetTransit = default(bool?), bool? allowRemoteVnetToUseHubVnetGateways = default(bool?), bool? enableInternetSecurity = default(bool?), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// The provisioning state of the hub virtual network connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Reference to the remote virtual network. + /// + + /// Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + /// + + /// Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + /// + + /// Enable internet security. + /// + public HubVirtualNetworkConnection(string id = default(string), string name = default(string), string etag = default(string), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string provisioningState = default(string), SubResource remoteVirtualNetwork = default(SubResource), bool? allowHubToRemoteVnetTransit = default(bool?), bool? allowRemoteVnetToUseHubVnetGateways = default(bool?), bool? enableInternetSecurity = default(bool?)) + + : base(id) { - RemoteVirtualNetwork = remoteVirtualNetwork; - AllowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; - AllowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; - EnableInternetSecurity = enableInternetSecurity; - RoutingConfiguration = routingConfiguration; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.RoutingConfiguration = routingConfiguration; + this.ProvisioningState = provisioningState; + this.RemoteVirtualNetwork = remoteVirtualNetwork; + this.AllowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + this.AllowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + this.EnableInternetSecurity = enableInternetSecurity; CustomInit(); } @@ -73,60 +73,57 @@ public HubVirtualNetworkConnection() /// partial void CustomInit(); + /// - /// Gets or sets reference to the remote virtual network. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] - public SubResource RemoteVirtualNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets deprecated: VirtualHub to RemoteVnet transit to - /// enabled or not. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.allowHubToRemoteVnetTransit")] - public bool? AllowHubToRemoteVnetTransit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets deprecated: Allow RemoteVnet to use Virtual Hub's - /// gateways. + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. /// - [JsonProperty(PropertyName = "properties.allowRemoteVnetToUseHubVnetGateways")] - public bool? AllowRemoteVnetToUseHubVnetGateways { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } /// - /// Gets or sets enable internet security. + /// Gets the provisioning state of the hub virtual network connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.enableInternetSecurity")] - public bool? EnableInternetSecurity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the Routing Configuration indicating the associated - /// and propagated route tables on this connection. + /// Gets or sets reference to the remote virtual network. /// - [JsonProperty(PropertyName = "properties.routingConfiguration")] - public RoutingConfiguration RoutingConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] + public SubResource RemoteVirtualNetwork {get; set; } /// - /// Gets the provisioning state of the hub virtual network connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets deprecated: VirtualHub to RemoteVnet transit to enabled or + /// not. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowHubToRemoteVnetTransit")] + public bool? AllowHubToRemoteVnetTransit {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets deprecated: Allow RemoteVnet to use Virtual Hub's gateways. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowRemoteVnetToUseHubVnetGateways")] + public bool? AllowRemoteVnetToUseHubVnetGateways {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets enable internet security. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionProperties.cs new file mode 100644 index 000000000000..baf7bda0f507 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for HubVirtualNetworkConnection. + /// + public partial class HubVirtualNetworkConnectionProperties + { + /// + /// Initializes a new instance of the HubVirtualNetworkConnectionProperties class. + /// + public HubVirtualNetworkConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HubVirtualNetworkConnectionProperties class. + /// + + /// Reference to the remote virtual network. + /// + + /// Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + /// + + /// Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + /// + + /// Enable internet security. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// The provisioning state of the hub virtual network connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public HubVirtualNetworkConnectionProperties(SubResource remoteVirtualNetwork = default(SubResource), bool? allowHubToRemoteVnetTransit = default(bool?), bool? allowRemoteVnetToUseHubVnetGateways = default(bool?), bool? enableInternetSecurity = default(bool?), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string provisioningState = default(string)) + + { + this.RemoteVirtualNetwork = remoteVirtualNetwork; + this.AllowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + this.AllowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + this.EnableInternetSecurity = enableInternetSecurity; + this.RoutingConfiguration = routingConfiguration; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets reference to the remote virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVirtualNetwork")] + public SubResource RemoteVirtualNetwork {get; set; } + + /// + /// Gets or sets deprecated: VirtualHub to RemoteVnet transit to enabled or + /// not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowHubToRemoteVnetTransit")] + public bool? AllowHubToRemoteVnetTransit {get; set; } + + /// + /// Gets or sets deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowRemoteVnetToUseHubVnetGateways")] + public bool? AllowRemoteVnetToUseHubVnetGateways {get; set; } + + /// + /// Gets or sets enable internet security. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } + + /// + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } + + /// + /// Gets the provisioning state of the hub virtual network connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionStatus.cs index d28b1f32ce0f..d3ccea26333c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/HubVirtualNetworkConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for HubVirtualNetworkConnectionStatus. /// + + public static class HubVirtualNetworkConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class HubVirtualNetworkConnectionStatus public const string Connected = "Connected"; public const string NotConnected = "NotConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IDPSQueryObject.cs b/src/Network/Network.Management.Sdk/Generated/Models/IDPSQueryObject.cs index ec03cea63422..9982ce3c8b06 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IDPSQueryObject.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IDPSQueryObject.cs @@ -1,51 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Will describe the query to run against the IDPS signatures DB /// - public partial class IDPSQueryObject + public partial class IdpsQueryObject { /// - /// Initializes a new instance of the IDPSQueryObject class. + /// Initializes a new instance of the IdpsQueryObject class. /// - public IDPSQueryObject() + public IdpsQueryObject() { CustomInit(); } /// - /// Initializes a new instance of the IDPSQueryObject class. + /// Initializes a new instance of the IdpsQueryObject class. /// - /// Contain all filters names and values - /// Search term in all columns - /// Column to sort response by - /// The number of the results to return in - /// each page - /// The number of records matching the filter to - /// skip - public IDPSQueryObject(IList filters = default(IList), string search = default(string), OrderBy orderBy = default(OrderBy), int? resultsPerPage = default(int?), int? skip = default(int?)) + + /// Contain all filters names and values + /// + + /// Search term in all columns + /// + + /// Column to sort response by + /// + + /// The number of the results to return in each page + /// + + /// The number of records matching the filter to skip + /// + public IdpsQueryObject(System.Collections.Generic.IList filters = default(System.Collections.Generic.IList), string search = default(string), OrderBy orderBy = default(OrderBy), int? resultsPerPage = default(int?), int? skip = default(int?)) + { - Filters = filters; - Search = search; - OrderBy = orderBy; - ResultsPerPage = resultsPerPage; - Skip = skip; + this.Filters = filters; + this.Search = search; + this.OrderBy = orderBy; + this.ResultsPerPage = resultsPerPage; + this.Skip = skip; CustomInit(); } @@ -54,55 +54,58 @@ public IDPSQueryObject() /// partial void CustomInit(); + /// /// Gets or sets contain all filters names and values /// - [JsonProperty(PropertyName = "filters")] - public IList Filters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "filters")] + public System.Collections.Generic.IList Filters {get; set; } /// /// Gets or sets search term in all columns /// - [JsonProperty(PropertyName = "search")] - public string Search { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "search")] + public string Search {get; set; } /// /// Gets or sets column to sort response by /// - [JsonProperty(PropertyName = "orderBy")] - public OrderBy OrderBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "orderBy")] + public OrderBy OrderBy {get; set; } /// /// Gets or sets the number of the results to return in each page /// - [JsonProperty(PropertyName = "resultsPerPage")] - public int? ResultsPerPage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resultsPerPage")] + public int? ResultsPerPage {get; set; } /// /// Gets or sets the number of records matching the filter to skip /// - [JsonProperty(PropertyName = "skip")] - public int? Skip { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skip")] + public int? Skip {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ResultsPerPage != null) + + + + if (this.ResultsPerPage != null) { - if (ResultsPerPage > 1000) + if (this.ResultsPerPage > 1000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ResultsPerPage", 1000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "ResultsPerPage", 1000); } - if (ResultsPerPage < 1) + if (this.ResultsPerPage < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ResultsPerPage", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ResultsPerPage", 1); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPAddressAvailabilityResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPAddressAvailabilityResult.cs index 52b88a8b52b6..37f5e9fa7d75 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPAddressAvailabilityResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPAddressAvailabilityResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class IPAddressAvailabilityResult { /// - /// Initializes a new instance of the IPAddressAvailabilityResult - /// class. + /// Initializes a new instance of the IPAddressAvailabilityResult class. /// public IPAddressAvailabilityResult() { @@ -30,19 +21,24 @@ public IPAddressAvailabilityResult() } /// - /// Initializes a new instance of the IPAddressAvailabilityResult - /// class. + /// Initializes a new instance of the IPAddressAvailabilityResult class. /// - /// Private IP address availability. - /// Contains other available private - /// IP addresses if the asked for address is taken. - /// Private IP address platform - /// reserved. - public IPAddressAvailabilityResult(bool? available = default(bool?), IList availableIPAddresses = default(IList), bool? isPlatformReserved = default(bool?)) + + /// Private IP address availability. + /// + + /// Contains other available private IP addresses if the asked for address is + /// taken. + /// + + /// Private IP address platform reserved. + /// + public IPAddressAvailabilityResult(bool? available = default(bool?), System.Collections.Generic.IList availableIPAddresses = default(System.Collections.Generic.IList), bool? isPlatformReserved = default(bool?)) + { - Available = available; - AvailableIPAddresses = availableIPAddresses; - IsPlatformReserved = isPlatformReserved; + this.Available = available; + this.AvailableIPAddresses = availableIPAddresses; + this.IsPlatformReserved = isPlatformReserved; CustomInit(); } @@ -51,24 +47,24 @@ public IPAddressAvailabilityResult() /// partial void CustomInit(); + /// /// Gets or sets private IP address availability. /// - [JsonProperty(PropertyName = "available")] - public bool? Available { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "available")] + public bool? Available {get; set; } /// - /// Gets or sets contains other available private IP addresses if the - /// asked for address is taken. + /// Gets or sets contains other available private IP addresses if the asked for + /// address is taken. /// - [JsonProperty(PropertyName = "availableIPAddresses")] - public IList AvailableIPAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availableIPAddresses")] + public System.Collections.Generic.IList AvailableIPAddresses {get; set; } /// /// Gets or sets private IP address platform reserved. /// - [JsonProperty(PropertyName = "isPlatformReserved")] - public bool? IsPlatformReserved { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isPlatformReserved")] + public bool? IsPlatformReserved {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPAllocationMethod.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPAllocationMethod.cs index 9c29b92df192..410993a14e6e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPAllocationMethod.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPAllocationMethod.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IPAllocationMethod. /// + + public static class IPAllocationMethod { public const string Static = "Static"; public const string Dynamic = "Dynamic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPConfiguration.cs index 7141647772af..2e61eadd26a5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPConfiguration.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IP configuration. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class IPConfiguration : SubResource { /// @@ -32,33 +24,42 @@ public IPConfiguration() /// /// Initializes a new instance of the IPConfiguration class. /// - /// Resource ID. - /// The private IP address of the IP - /// configuration. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// The reference to the subnet resource. - /// The reference to the public IP - /// resource. - /// The provisioning state of the IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public IPConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The reference to the subnet resource. + /// + + /// The provisioning state of the IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the public IP resource. + /// + public IPConfiguration(string id = default(string), string name = default(string), string etag = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), PublicIPAddress publicIPAddress = default(PublicIPAddress)) + + : base(id) { - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - Subnet = subnet; - PublicIPAddress = publicIPAddress; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.PublicIPAddress = publicIPAddress; CustomInit(); } @@ -67,52 +68,49 @@ public IPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the private IP address of the IP configuration. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Gets or sets the reference to the subnet resource. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets or sets the reference to the public IP resource. + /// Gets the provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public PublicIPAddress PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the IP configuration resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the reference to the public IP resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationBgpPeeringAddress.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationBgpPeeringAddress.cs index 53c75c04c364..dd4716070f51 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationBgpPeeringAddress.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationBgpPeeringAddress.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class IPConfigurationBgpPeeringAddress { /// - /// Initializes a new instance of the IPConfigurationBgpPeeringAddress - /// class. + /// Initializes a new instance of the IPConfigurationBgpPeeringAddress class. /// public IPConfigurationBgpPeeringAddress() { @@ -30,23 +21,27 @@ public IPConfigurationBgpPeeringAddress() } /// - /// Initializes a new instance of the IPConfigurationBgpPeeringAddress - /// class. + /// Initializes a new instance of the IPConfigurationBgpPeeringAddress class. /// - /// The ID of IP configuration which - /// belongs to gateway. - /// The list of default BGP peering - /// addresses which belong to IP configuration. - /// The list of custom BGP peering - /// addresses which belong to IP configuration. - /// The list of tunnel public IP - /// addresses which belong to IP configuration. - public IPConfigurationBgpPeeringAddress(string ipconfigurationId = default(string), IList defaultBgpIpAddresses = default(IList), IList customBgpIpAddresses = default(IList), IList tunnelIpAddresses = default(IList)) + + /// The ID of IP configuration which belongs to gateway. + /// + + /// The list of default BGP peering addresses which belong to IP configuration. + /// + + /// The list of custom BGP peering addresses which belong to IP configuration. + /// + + /// The list of tunnel public IP addresses which belong to IP configuration. + /// + public IPConfigurationBgpPeeringAddress(string ipconfigurationId = default(string), System.Collections.Generic.IList defaultBgpIPAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList customBgpIPAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList tunnelIPAddresses = default(System.Collections.Generic.IList)) + { - IpconfigurationId = ipconfigurationId; - DefaultBgpIpAddresses = defaultBgpIpAddresses; - CustomBgpIpAddresses = customBgpIpAddresses; - TunnelIpAddresses = tunnelIpAddresses; + this.IpconfigurationId = ipconfigurationId; + this.DefaultBgpIPAddresses = defaultBgpIPAddresses; + this.CustomBgpIPAddresses = customBgpIPAddresses; + this.TunnelIPAddresses = tunnelIPAddresses; CustomInit(); } @@ -55,32 +50,32 @@ public IPConfigurationBgpPeeringAddress() /// partial void CustomInit(); + /// /// Gets or sets the ID of IP configuration which belongs to gateway. /// - [JsonProperty(PropertyName = "ipconfigurationId")] - public string IpconfigurationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipconfigurationId")] + public string IpconfigurationId {get; set; } /// /// Gets the list of default BGP peering addresses which belong to IP /// configuration. /// - [JsonProperty(PropertyName = "defaultBgpIpAddresses")] - public IList DefaultBgpIpAddresses { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultBgpIpAddresses")] + public System.Collections.Generic.IList DefaultBgpIPAddresses {get; private set; } /// - /// Gets or sets the list of custom BGP peering addresses which belong - /// to IP configuration. + /// Gets or sets the list of custom BGP peering addresses which belong to IP + /// configuration. /// - [JsonProperty(PropertyName = "customBgpIpAddresses")] - public IList CustomBgpIpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customBgpIpAddresses")] + public System.Collections.Generic.IList CustomBgpIPAddresses {get; set; } /// /// Gets the list of tunnel public IP addresses which belong to IP /// configuration. /// - [JsonProperty(PropertyName = "tunnelIpAddresses")] - public IList TunnelIpAddresses { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnelIpAddresses")] + public System.Collections.Generic.IList TunnelIPAddresses {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfile.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfile.cs index 775e2edd5735..ae327285d963 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfile.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfile.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IP configuration profile child resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class IPConfigurationProfile : SubResource { /// @@ -32,25 +24,34 @@ public IPConfigurationProfile() /// /// Initializes a new instance of the IPConfigurationProfile class. /// - /// Resource ID. - /// The reference to the subnet resource to create - /// a container network interface ip configuration. - /// The provisioning state of the IP - /// configuration profile resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource. This name can be used - /// to access the resource. - /// Sub Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public IPConfigurationProfile(string id = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource. This name can be used to access the resource. + /// + + /// Sub Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The reference to the subnet resource to create a container network + /// interface ip configuration. + /// + + /// The provisioning state of the IP configuration profile resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public IPConfigurationProfile(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string)) + + : base(id) { - Subnet = subnet; - ProvisioningState = provisioningState; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -59,40 +60,38 @@ public IPConfigurationProfile() /// partial void CustomInit(); + /// - /// Gets or sets the reference to the subnet resource to create a - /// container network interface ip configuration. + /// Gets or sets the name of the resource. This name can be used to access the + /// resource. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the IP configuration profile - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets sub Resource type. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the name of the resource. This name can be used to - /// access the resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets sub Resource type. + /// Gets or sets the reference to the subnet resource to create a container + /// network interface ip configuration. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the IP configuration profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfilePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfilePropertiesFormat.cs new file mode 100644 index 000000000000..015838067a39 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationProfilePropertiesFormat.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// IP configuration profile properties. + /// + public partial class IPConfigurationProfilePropertiesFormat + { + /// + /// Initializes a new instance of the IPConfigurationProfilePropertiesFormat class. + /// + public IPConfigurationProfilePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IPConfigurationProfilePropertiesFormat class. + /// + + /// The reference to the subnet resource to create a container network + /// interface ip configuration. + /// + + /// The provisioning state of the IP configuration profile resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public IPConfigurationProfilePropertiesFormat(Subnet subnet = default(Subnet), string provisioningState = default(string)) + + { + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the reference to the subnet resource to create a container + /// network interface ip configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets the provisioning state of the IP configuration profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..5fd82f357c16 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPConfigurationPropertiesFormat.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of IP configuration. + /// + public partial class IPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the IPConfigurationPropertiesFormat class. + /// + public IPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IPConfigurationPropertiesFormat class. + /// + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the subnet resource. + /// + + /// The reference to the public IP resource. + /// + + /// The provisioning state of the IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public IPConfigurationPropertiesFormat(string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string)) + + { + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the private IP address of the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets the reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets or sets the reference to the public IP resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } + + /// + /// Gets the provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPPrefixesList.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPPrefixesList.cs index c139f41975f5..65d01cbe3db8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPPrefixesList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPPrefixesList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public IPPrefixesList() /// /// Initializes a new instance of the IPPrefixesList class. /// - /// IP Prefix value. - public IPPrefixesList(IList ipPrefixes = default(IList)) + + /// IP Prefix value. + /// + public IPPrefixesList(System.Collections.Generic.IList ipPrefixes = default(System.Collections.Generic.IList)) + { - IpPrefixes = ipPrefixes; + this.IPPrefixes = ipPrefixes; CustomInit(); } @@ -43,11 +38,11 @@ public IPPrefixesList() /// partial void CustomInit(); + /// - /// Gets or sets IP Prefix value. + /// Gets or sets iP Prefix value. /// - [JsonProperty(PropertyName = "ipPrefixes")] - public IList IpPrefixes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ipPrefixes")] + public System.Collections.Generic.IList IPPrefixes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPRule.cs index ecffa1329407..b8e0ba523713 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPRule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; public partial class IPRule @@ -26,11 +20,13 @@ public IPRule() /// /// Initializes a new instance of the IPRule class. /// - /// Specifies the IP or IP range in CIDR - /// format. Only IPV4 address is allowed. + + /// Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + /// public IPRule(string addressPrefix = default(string)) + { - AddressPrefix = addressPrefix; + this.AddressPrefix = addressPrefix; CustomInit(); } @@ -39,12 +35,12 @@ public IPRule() /// partial void CustomInit(); + /// - /// Gets or sets specifies the IP or IP range in CIDR format. Only IPV4 - /// address is allowed. + /// Gets or sets specifies the IP or IP range in CIDR format. Only IPV4 address + /// is allowed. /// - [JsonProperty(PropertyName = "addressPrefix")] - public string AddressPrefix { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IPVersion.cs b/src/Network/Network.Management.Sdk/Generated/Models/IPVersion.cs index 093b14cbc787..8b1422e812a4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IPVersion.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IPVersion.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IPVersion. /// + + public static class IPVersion { public const string IPv4 = "IPv4"; public const string IPv6 = "IPv6"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IkeEncryption.cs b/src/Network/Network.Management.Sdk/Generated/Models/IkeEncryption.cs index 0ba8cd89d0ec..57c483cca03d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IkeEncryption.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IkeEncryption.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IkeEncryption. /// + + public static class IkeEncryption { public const string DES = "DES"; @@ -21,7 +18,7 @@ public static class IkeEncryption public const string AES128 = "AES128"; public const string AES192 = "AES192"; public const string AES256 = "AES256"; - public const string GCMAES256 = "GCMAES256"; - public const string GCMAES128 = "GCMAES128"; + public const string Gcmaes256 = "GCMAES256"; + public const string Gcmaes128 = "GCMAES128"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IkeIntegrity.cs b/src/Network/Network.Management.Sdk/Generated/Models/IkeIntegrity.cs index a2987970a876..938d5c4133c1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IkeIntegrity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IkeIntegrity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,13 +9,15 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IkeIntegrity. /// + + public static class IkeIntegrity { public const string MD5 = "MD5"; public const string SHA1 = "SHA1"; public const string SHA256 = "SHA256"; public const string SHA384 = "SHA384"; - public const string GCMAES256 = "GCMAES256"; - public const string GCMAES128 = "GCMAES128"; + public const string Gcmaes256 = "GCMAES256"; + public const string Gcmaes128 = "GCMAES128"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPool.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPool.cs index aeb0a2b0230f..ce7e5965be27 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPool.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPool.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Inbound NAT pool of the load balancer. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class InboundNatPool : SubResource { /// @@ -32,58 +24,74 @@ public InboundNatPool() /// /// Initializes a new instance of the InboundNatPool class. /// - /// The reference to the transport protocol used - /// by the inbound NAT pool. Possible values include: 'Udp', 'Tcp', - /// 'All' - /// 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. - /// 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. - /// The port used for internal connections on - /// the endpoint. Acceptable values are between 1 and 65535. - /// Resource ID. - /// A reference to frontend IP - /// addresses. - /// 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. - /// 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. - /// 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. - /// The provisioning state of the - /// inbound NAT pool resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the set of inbound NAT pools used by the load balancer. This name - /// can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public InboundNatPool(string protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of inbound NAT pools + /// used by the load balancer. This name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the inbound NAT pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A reference to frontend IP addresses. + /// + + /// The reference to the transport protocol used by the inbound NAT pool. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// 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. + /// + + /// 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. + /// + + /// The port used for internal connections on the endpoint. Acceptable values + /// are between 1 and 65535. + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + public InboundNatPool(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource frontendIPConfiguration = default(SubResource), string protocol = default(string), int? frontendPortRangeStart = default(int?), int? frontendPortRangeEnd = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?)) + + : base(id) { - FrontendIPConfiguration = frontendIPConfiguration; - Protocol = protocol; - FrontendPortRangeStart = frontendPortRangeStart; - FrontendPortRangeEnd = frontendPortRangeEnd; - BackendPort = backendPort; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableFloatingIP = enableFloatingIP; - EnableTcpReset = enableTcpReset; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.FrontendIPConfiguration = frontendIPConfiguration; + this.Protocol = protocol; + this.FrontendPortRangeStart = frontendPortRangeStart; + this.FrontendPortRangeEnd = frontendPortRangeEnd; + this.BackendPort = backendPort; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.EnableFloatingIP = enableFloatingIP; + this.EnableTcpReset = enableTcpReset; CustomInit(); } @@ -92,109 +100,93 @@ public InboundNatPool() /// partial void CustomInit(); - /// - /// Gets or sets a reference to frontend IP addresses. - /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] - public SubResource FrontendIPConfiguration { get; set; } /// - /// Gets or sets the reference to the transport protocol used by the - /// inbound NAT pool. Possible values include: 'Udp', 'Tcp', 'All' + /// Gets or sets the name of the resource that is unique within the set of + /// inbound NAT pools used by the load balancer. This name can be used to + /// access the resource. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets 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. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.frontendPortRangeStart")] - public int FrontendPortRangeStart { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets 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. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] - public int FrontendPortRangeEnd { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the port used for internal connections on the - /// endpoint. Acceptable values are between 1 and 65535. + /// Gets the provisioning state of the inbound NAT pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.backendPort")] - public int BackendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets 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. + /// Gets or sets a reference to frontend IP addresses. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } /// - /// Gets or sets 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. + /// Gets or sets the reference to the transport protocol used by the inbound + /// NAT pool. Possible values include: 'Udp', 'Tcp', 'All' /// - [JsonProperty(PropertyName = "properties.enableFloatingIP")] - public bool? EnableFloatingIP { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.enableTcpReset")] - public bool? EnableTcpReset { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeStart")] + public int? FrontendPortRangeStart {get; set; } /// - /// Gets the provisioning state of the inbound NAT pool resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] + public int? FrontendPortRangeEnd {get; set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of inbound NAT pools used by the load balancer. This name can be - /// used to access the resource. + /// Gets or sets the port used for internal connections on the endpoint. + /// Acceptable values are between 1 and 65535. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] + public int? BackendPort {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets type of the resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] + public bool? EnableFloatingIP {get; set; } /// - /// Validate the object. + /// Gets or sets 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. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPoolPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPoolPropertiesFormat.cs new file mode 100644 index 000000000000..f9c2a3f6597d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatPoolPropertiesFormat.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Inbound NAT pool. + /// + public partial class InboundNatPoolPropertiesFormat + { + /// + /// Initializes a new instance of the InboundNatPoolPropertiesFormat class. + /// + public InboundNatPoolPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InboundNatPoolPropertiesFormat class. + /// + + /// A reference to frontend IP addresses. + /// + + /// The reference to the transport protocol used by the inbound NAT pool. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// 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. + /// + + /// 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. + /// + + /// The port used for internal connections on the endpoint. Acceptable values + /// are between 1 and 65535. + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + + /// The provisioning state of the inbound NAT pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public InboundNatPoolPropertiesFormat(string protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, SubResource frontendIPConfiguration = default(SubResource), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), string provisioningState = default(string)) + + { + this.FrontendIPConfiguration = frontendIPConfiguration; + this.Protocol = protocol; + this.FrontendPortRangeStart = frontendPortRangeStart; + this.FrontendPortRangeEnd = frontendPortRangeEnd; + this.BackendPort = backendPort; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.EnableFloatingIP = enableFloatingIP; + this.EnableTcpReset = enableTcpReset; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a reference to frontend IP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } + + /// + /// Gets or sets the reference to the transport protocol used by the inbound + /// NAT pool. Possible values include: 'Udp', 'Tcp', 'All' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPortRangeStart")] + public int FrontendPortRangeStart {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPortRangeEnd")] + public int FrontendPortRangeEnd {get; set; } + + /// + /// Gets or sets the port used for internal connections on the endpoint. + /// Acceptable values are between 1 and 65535. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int BackendPort {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFloatingIP")] + public bool? EnableFloatingIP {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableTcpReset")] + public bool? EnableTcpReset {get; set; } + + /// + /// Gets the provisioning state of the inbound NAT pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Protocol == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRule.cs index 0b3e1fd64a2c..0a347bba6231 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRule.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Inbound NAT rule of the load balancer. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class InboundNatRule : SubResource { /// @@ -32,74 +24,91 @@ public InboundNatRule() /// /// Initializes a new instance of the InboundNatRule class. /// - /// Resource ID. - /// A reference to frontend IP - /// addresses. - /// 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. - /// The reference to the transport protocol used - /// by the load balancing rule. Possible values include: 'Udp', 'Tcp', - /// 'All' - /// 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. - /// The port used for the internal endpoint. - /// Acceptable values range from 1 to 65535. - /// 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. - /// 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. - /// 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. - /// The port range start for the - /// external endpoint. This property is used together with - /// BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT - /// rule port mappings will be created for each backend address from - /// BackendAddressPool. Acceptable values range from 1 to - /// 65534. - /// The port range end for the - /// external endpoint. This property is used together with - /// BackendAddressPool and FrontendPortRangeStart. Individual inbound - /// NAT rule port mappings will be created for each backend address - /// from BackendAddressPool. Acceptable values range from 1 to - /// 65534. - /// A reference to backendAddressPool - /// resource. - /// The provisioning state of the - /// inbound NAT rule resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the set of inbound NAT rules used by the load balancer. This name - /// can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public InboundNatRule(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), int? frontendPortRangeStart = default(int?), int? frontendPortRangeEnd = default(int?), SubResource backendAddressPool = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of inbound NAT rules + /// used by the load balancer. This name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the inbound NAT rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A reference to frontend IP addresses. + /// + + /// 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. + /// + + /// The reference to the transport protocol used by the load balancing rule. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// 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. + /// + + /// The port used for the internal endpoint. Acceptable values range from 1 to + /// 65535. + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + + /// The port range start for the external endpoint. This property is used + /// together with BackendAddressPool and FrontendPortRangeEnd. Individual + /// inbound NAT rule port mappings will be created for each backend address + /// from BackendAddressPool. Acceptable values range from 1 to 65534. + /// + + /// The port range end for the external endpoint. This property is used + /// together with BackendAddressPool and FrontendPortRangeStart. Individual + /// inbound NAT rule port mappings will be created for each backend address + /// from BackendAddressPool. Acceptable values range from 1 to 65534. + /// + + /// A reference to backendAddressPool resource. + /// + public InboundNatRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), int? frontendPortRangeStart = default(int?), int? frontendPortRangeEnd = default(int?), SubResource backendAddressPool = default(SubResource)) + + : base(id) { - FrontendIPConfiguration = frontendIPConfiguration; - BackendIPConfiguration = backendIPConfiguration; - Protocol = protocol; - FrontendPort = frontendPort; - BackendPort = backendPort; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableFloatingIP = enableFloatingIP; - EnableTcpReset = enableTcpReset; - FrontendPortRangeStart = frontendPortRangeStart; - FrontendPortRangeEnd = frontendPortRangeEnd; - BackendAddressPool = backendAddressPool; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.FrontendIPConfiguration = frontendIPConfiguration; + this.BackendIPConfiguration = backendIPConfiguration; + this.Protocol = protocol; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.EnableFloatingIP = enableFloatingIP; + this.EnableTcpReset = enableTcpReset; + this.FrontendPortRangeStart = frontendPortRangeStart; + this.FrontendPortRangeEnd = frontendPortRangeEnd; + this.BackendAddressPool = backendAddressPool; CustomInit(); } @@ -108,122 +117,117 @@ public InboundNatRule() /// partial void CustomInit(); + /// - /// Gets or sets a reference to frontend IP addresses. + /// Gets or sets the name of the resource that is unique within the set of + /// inbound NAT rules used by the load balancer. This name can be used to + /// access the resource. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] - public SubResource FrontendIPConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets 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. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.backendIPConfiguration")] - public NetworkInterfaceIPConfiguration BackendIPConfiguration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the transport protocol used by the - /// load balancing rule. Possible values include: 'Udp', 'Tcp', 'All' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets 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. + /// Gets the provisioning state of the inbound NAT rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.frontendPort")] - public int? FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the port used for the internal endpoint. Acceptable - /// values range from 1 to 65535. + /// Gets or sets a reference to frontend IP addresses. /// - [JsonProperty(PropertyName = "properties.backendPort")] - public int? BackendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } /// - /// Gets or sets 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. + /// Gets 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. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfiguration")] + public NetworkInterfaceIPConfiguration BackendIPConfiguration {get; private set; } /// - /// Gets or sets 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. + /// Gets or sets the reference to the transport protocol used by the load + /// balancing rule. Possible values include: 'Udp', 'Tcp', 'All' /// - [JsonProperty(PropertyName = "properties.enableFloatingIP")] - public bool? EnableFloatingIP { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.enableTcpReset")] - public bool? EnableTcpReset { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + public int? FrontendPort {get; set; } /// - /// Gets or sets the port range start for the external endpoint. This - /// property is used together with BackendAddressPool and - /// FrontendPortRangeEnd. Individual inbound NAT rule port mappings - /// will be created for each backend address from BackendAddressPool. - /// Acceptable values range from 1 to 65534. + /// Gets or sets the port used for the internal endpoint. Acceptable values + /// range from 1 to 65535. /// - [JsonProperty(PropertyName = "properties.frontendPortRangeStart")] - public int? FrontendPortRangeStart { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] + public int? BackendPort {get; set; } /// - /// Gets or sets the port range end for the external endpoint. This - /// property is used together with BackendAddressPool and - /// FrontendPortRangeStart. Individual inbound NAT rule port mappings - /// will be created for each backend address from BackendAddressPool. - /// Acceptable values range from 1 to 65534. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] - public int? FrontendPortRangeEnd { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets or sets a reference to backendAddressPool resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] + public bool? EnableFloatingIP {get; set; } /// - /// Gets the provisioning state of the inbound NAT rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset {get; set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of inbound NAT rules used by the load balancer. This name can be - /// used to access the resource. + /// Gets or sets the port range start for the external endpoint. This property + /// is used together with BackendAddressPool and FrontendPortRangeEnd. + /// Individual inbound NAT rule port mappings will be created for each backend + /// address from BackendAddressPool. Acceptable values range from 1 to 65534. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeStart")] + public int? FrontendPortRangeStart {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the port range end for the external endpoint. This property is + /// used together with BackendAddressPool and FrontendPortRangeStart. + /// Individual inbound NAT rule port mappings will be created for each backend + /// address from BackendAddressPool. Acceptable values range from 1 to 65534. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] + public int? FrontendPortRangeEnd {get; set; } /// - /// Gets type of the resource. + /// Gets or sets a reference to backendAddressPool resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePortMapping.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePortMapping.cs index a0eb775fd6ba..6d2e5c1fe614 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePortMapping.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePortMapping.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public InboundNatRulePortMapping() /// /// Initializes a new instance of the InboundNatRulePortMapping class. /// - /// Name of inbound NAT rule. - /// The reference to the transport protocol used - /// by the inbound NAT rule. Possible values include: 'Udp', 'Tcp', - /// 'All' - /// Frontend port. - /// Backend port. + + /// Name of inbound NAT rule. + /// + + /// The reference to the transport protocol used by the inbound NAT rule. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// Frontend port. + /// + + /// Backend port. + /// public InboundNatRulePortMapping(string inboundNatRuleName = default(string), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?)) + { - InboundNatRuleName = inboundNatRuleName; - Protocol = protocol; - FrontendPort = frontendPort; - BackendPort = backendPort; + this.InboundNatRuleName = inboundNatRuleName; + this.Protocol = protocol; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; CustomInit(); } @@ -49,30 +50,29 @@ public InboundNatRulePortMapping() /// partial void CustomInit(); + /// /// Gets name of inbound NAT rule. /// - [JsonProperty(PropertyName = "inboundNatRuleName")] - public string InboundNatRuleName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRuleName")] + public string InboundNatRuleName {get; private set; } /// - /// Gets the reference to the transport protocol used by the inbound - /// NAT rule. Possible values include: 'Udp', 'Tcp', 'All' + /// Gets the reference to the transport protocol used by the inbound NAT rule. Possible values include: 'Udp', 'Tcp', 'All' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; private set; } /// /// Gets frontend port. /// - [JsonProperty(PropertyName = "frontendPort")] - public int? FrontendPort { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public int? FrontendPort {get; private set; } /// /// Gets backend port. /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePropertiesFormat.cs new file mode 100644 index 000000000000..d5b5673a99ae --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundNatRulePropertiesFormat.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the inbound NAT rule. + /// + public partial class InboundNatRulePropertiesFormat + { + /// + /// Initializes a new instance of the InboundNatRulePropertiesFormat class. + /// + public InboundNatRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InboundNatRulePropertiesFormat class. + /// + + /// A reference to frontend IP addresses. + /// + + /// 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. + /// + + /// The reference to the transport protocol used by the load balancing rule. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// 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. + /// + + /// The port used for the internal endpoint. Acceptable values range from 1 to + /// 65535. + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + + /// The port range start for the external endpoint. This property is used + /// together with BackendAddressPool and FrontendPortRangeEnd. Individual + /// inbound NAT rule port mappings will be created for each backend address + /// from BackendAddressPool. Acceptable values range from 1 to 65534. + /// + + /// The port range end for the external endpoint. This property is used + /// together with BackendAddressPool and FrontendPortRangeStart. Individual + /// inbound NAT rule port mappings will be created for each backend address + /// from BackendAddressPool. Acceptable values range from 1 to 65534. + /// + + /// A reference to backendAddressPool resource. + /// + + /// The provisioning state of the inbound NAT rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public InboundNatRulePropertiesFormat(SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), int? frontendPortRangeStart = default(int?), int? frontendPortRangeEnd = default(int?), SubResource backendAddressPool = default(SubResource), string provisioningState = default(string)) + + { + this.FrontendIPConfiguration = frontendIPConfiguration; + this.BackendIPConfiguration = backendIPConfiguration; + this.Protocol = protocol; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.EnableFloatingIP = enableFloatingIP; + this.EnableTcpReset = enableTcpReset; + this.FrontendPortRangeStart = frontendPortRangeStart; + this.FrontendPortRangeEnd = frontendPortRangeEnd; + this.BackendAddressPool = backendAddressPool; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a reference to frontend IP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } + + /// + /// Gets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendIPConfiguration")] + public NetworkInterfaceIPConfiguration BackendIPConfiguration {get; private set; } + + /// + /// Gets or sets the reference to the transport protocol used by the load + /// balancing rule. Possible values include: 'Udp', 'Tcp', 'All' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public int? FrontendPort {get; set; } + + /// + /// Gets or sets the port used for the internal endpoint. Acceptable values + /// range from 1 to 65535. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFloatingIP")] + public bool? EnableFloatingIP {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableTcpReset")] + public bool? EnableTcpReset {get; set; } + + /// + /// Gets or sets the port range start for the external endpoint. This property + /// is used together with BackendAddressPool and FrontendPortRangeEnd. + /// Individual inbound NAT rule port mappings will be created for each backend + /// address from BackendAddressPool. Acceptable values range from 1 to 65534. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPortRangeStart")] + public int? FrontendPortRangeStart {get; set; } + + /// + /// Gets or sets the port range end for the external endpoint. This property is + /// used together with BackendAddressPool and FrontendPortRangeStart. + /// Individual inbound NAT rule port mappings will be created for each backend + /// address from BackendAddressPool. Acceptable values range from 1 to 65534. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPortRangeEnd")] + public int? FrontendPortRangeEnd {get; set; } + + /// + /// Gets or sets a reference to backendAddressPool resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + + /// + /// Gets the provisioning state of the inbound NAT rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRule.cs index fc607a5a8160..527cf977e551 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NVA Inbound Security Rule resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class InboundSecurityRule : SubResource { /// @@ -34,23 +24,33 @@ public InboundSecurityRule() /// /// Initializes a new instance of the InboundSecurityRule class. /// - /// Resource ID. - /// List of allowed rules. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Name of security rule collection. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// NVA inbound security rule type. - public InboundSecurityRule(string id = default(string), IList rules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of security rule collection. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// NVA inbound security rule type. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of allowed rules. + /// + public InboundSecurityRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(id) { - Rules = rules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Rules = rules; CustomInit(); } @@ -59,37 +59,36 @@ public InboundSecurityRule() /// partial void CustomInit(); + /// - /// Gets or sets list of allowed rules. + /// Gets or sets name of security rule collection. /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets name of security rule collection. + /// Gets nVA inbound security rule type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets NVA inbound security rule type. + /// Gets or sets list of allowed rules. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRuleProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRuleProperties.cs new file mode 100644 index 000000000000..21dfc18dcef2 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRuleProperties.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the Inbound Security Rules resource. + /// + public partial class InboundSecurityRuleProperties + { + /// + /// Initializes a new instance of the InboundSecurityRuleProperties class. + /// + public InboundSecurityRuleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InboundSecurityRuleProperties class. + /// + + /// List of allowed rules. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public InboundSecurityRuleProperties(System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Rules = rules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of allowed rules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRules.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRules.cs index 133d8fe7975e..33305a342a7e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRules.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRules.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,17 +23,21 @@ public InboundSecurityRules() /// /// Initializes a new instance of the InboundSecurityRules class. /// + /// Protocol. This should be either TCP or UDP. - /// Possible values include: 'TCP', 'UDP' - /// The CIDR or source IP range. Only - /// /30, /31 and /32 Ip ranges are allowed. - /// NVA port ranges to be opened up. - /// One needs to provide specific ports. + /// Possible values include: 'TCP', 'UDP' + + /// The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + /// + + /// NVA port ranges to be opened up. One needs to provide specific ports. + /// public InboundSecurityRules(string protocol = default(string), string sourceAddressPrefix = default(string), int? destinationPortRange = default(int?)) + { - Protocol = protocol; - SourceAddressPrefix = sourceAddressPrefix; - DestinationPortRange = destinationPortRange; + this.Protocol = protocol; + this.SourceAddressPrefix = sourceAddressPrefix; + this.DestinationPortRange = destinationPortRange; CustomInit(); } @@ -49,46 +46,47 @@ public InboundSecurityRules() /// partial void CustomInit(); + /// - /// Gets or sets protocol. This should be either TCP or UDP. Possible - /// values include: 'TCP', 'UDP' + /// Gets or sets protocol. This should be either TCP or UDP. Possible values include: 'TCP', 'UDP' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets the CIDR or source IP range. Only /30, /31 and /32 Ip - /// ranges are allowed. + /// Gets or sets the CIDR or source IP range. Only /30, /31 and /32 Ip ranges + /// are allowed. /// - [JsonProperty(PropertyName = "sourceAddressPrefix")] - public string SourceAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefix")] + public string SourceAddressPrefix {get; set; } /// - /// Gets or sets NVA port ranges to be opened up. One needs to provide - /// specific ports. + /// Gets or sets nVA port ranges to be opened up. One needs to provide specific + /// ports. /// - [JsonProperty(PropertyName = "destinationPortRange")] - public int? DestinationPortRange { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRange")] + public int? DestinationPortRange {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DestinationPortRange != null) + + + if (this.DestinationPortRange != null) { - if (DestinationPortRange > 65535) + if (this.DestinationPortRange > 65535) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "DestinationPortRange", 65535); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "DestinationPortRange", 65535); } - if (DestinationPortRange < 0) + if (this.DestinationPortRange < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DestinationPortRange", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "DestinationPortRange", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRulesProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRulesProtocol.cs index dd4ff80c3873..e0452b1bcf87 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRulesProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InboundSecurityRulesProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for InboundSecurityRulesProtocol. /// + + public static class InboundSecurityRulesProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/InternetIngressPublicIpsProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/InternetIngressPublicIpsProperties.cs index c50929cd2c89..02db3f25c725 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/InternetIngressPublicIpsProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/InternetIngressPublicIpsProperties.cs @@ -1,20 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Internet Ingress Public Ip Properties + /// Resource Uri of Public Ip for Standard Load Balancer Frontend End. /// /// /// Resource Uri of Public Ip for Standard Load Balancer Frontend End. @@ -22,8 +16,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class InternetIngressPublicIpsProperties { /// - /// Initializes a new instance of the - /// InternetIngressPublicIpsProperties class. + /// Initializes a new instance of the InternetIngressPublicIpsProperties class. /// public InternetIngressPublicIpsProperties() { @@ -31,13 +24,15 @@ public InternetIngressPublicIpsProperties() } /// - /// Initializes a new instance of the - /// InternetIngressPublicIpsProperties class. + /// Initializes a new instance of the InternetIngressPublicIpsProperties class. /// - /// Resource Uri of Public Ip + + /// Resource Uri of Public Ip + /// public InternetIngressPublicIpsProperties(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -46,11 +41,11 @@ public InternetIngressPublicIpsProperties() /// partial void CustomInit(); + /// /// Gets or sets resource Uri of Public Ip /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpAllocation.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpAllocation.cs index ed245a6c35cb..877751c4c488 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpAllocation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpAllocation.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// IpAllocation resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class IpAllocation : Resource { /// @@ -34,39 +24,61 @@ public IpAllocation() /// /// Initializes a new instance of the IpAllocation class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The Subnet that using the prefix of this - /// IpAllocation resource. - /// The VirtualNetwork that using the - /// prefix of this IpAllocation resource. - /// The type for the IpAllocation. - /// Possible values include: 'Undefined', 'Hypernet' - /// The address prefix for the - /// IpAllocation. - /// The address prefix length for the - /// IpAllocation. - /// The address prefix Type for the - /// IpAllocation. Possible values include: 'IPv4', 'IPv6' - /// The IPAM allocation ID. - /// IpAllocation tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - public IpAllocation(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource subnet = default(SubResource), SubResource virtualNetwork = default(SubResource), string ipAllocationType = default(string), string prefix = default(string), int? prefixLength = default(int?), string prefixType = default(string), string ipamAllocationId = default(string), IDictionary allocationTags = default(IDictionary), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The Subnet that using the prefix of this IpAllocation resource. + /// + + /// The VirtualNetwork that using the prefix of this IpAllocation resource. + /// + + /// The type for the IpAllocation. + /// Possible values include: 'Undefined', 'Hypernet' + + /// The address prefix for the IpAllocation. + /// + + /// The address prefix length for the IpAllocation. + /// + + /// The address prefix Type for the IpAllocation. + /// Possible values include: 'IPv4', 'IPv6' + + /// The IPAM allocation ID. + /// + + /// IpAllocation tags. + /// + public IpAllocation(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), SubResource subnet = default(SubResource), SubResource virtualNetwork = default(SubResource), string propertiesType = default(string), string prefix = default(string), int? prefixLength = default(int?), string prefixType = default(string), string ipamAllocationId = default(string), System.Collections.Generic.IDictionary allocationTags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, location, tags) { - Subnet = subnet; - VirtualNetwork = virtualNetwork; - IpAllocationType = ipAllocationType; - Prefix = prefix; - PrefixLength = prefixLength; - PrefixType = prefixType; - IpamAllocationId = ipamAllocationId; - AllocationTags = allocationTags; - Etag = etag; + this.Etag = etag; + this.Subnet = subnet; + this.VirtualNetwork = virtualNetwork; + this.PropertiesType = propertiesType; + this.Prefix = prefix; + this.PrefixLength = prefixLength; + this.PrefixType = prefixType; + this.IpamAllocationId = ipamAllocationId; + this.AllocationTags = allocationTags; CustomInit(); } @@ -75,64 +87,61 @@ public IpAllocation() /// partial void CustomInit(); + /// - /// Gets the Subnet that using the prefix of this IpAllocation - /// resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the Subnet that using the prefix of this IpAllocation resource. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; private set; } /// /// Gets the VirtualNetwork that using the prefix of this IpAllocation /// resource. /// - [JsonProperty(PropertyName = "properties.virtualNetwork")] - public SubResource VirtualNetwork { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetwork")] + public SubResource VirtualNetwork {get; private set; } /// - /// Gets or sets the type for the IpAllocation. Possible values - /// include: 'Undefined', 'Hypernet' + /// Gets or sets the type for the IpAllocation. Possible values include: 'Undefined', 'Hypernet' /// - [JsonProperty(PropertyName = "properties.type")] - public string IpAllocationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string PropertiesType {get; set; } /// /// Gets or sets the address prefix for the IpAllocation. /// - [JsonProperty(PropertyName = "properties.prefix")] - public string Prefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.prefix")] + public string Prefix {get; set; } /// /// Gets or sets the address prefix length for the IpAllocation. /// - [JsonProperty(PropertyName = "properties.prefixLength")] - public int? PrefixLength { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.prefixLength")] + public int? PrefixLength {get; set; } /// - /// Gets or sets the address prefix Type for the IpAllocation. Possible - /// values include: 'IPv4', 'IPv6' + /// Gets or sets the address prefix Type for the IpAllocation. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.prefixType")] - public string PrefixType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.prefixType")] + public string PrefixType {get; set; } /// /// Gets or sets the IPAM allocation ID. /// - [JsonProperty(PropertyName = "properties.ipamAllocationId")] - public string IpamAllocationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipamAllocationId")] + public string IpamAllocationId {get; set; } /// /// Gets or sets ipAllocation tags. /// - [JsonProperty(PropertyName = "properties.allocationTags")] - public IDictionary AllocationTags { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allocationTags")] + public System.Collections.Generic.IDictionary AllocationTags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationPropertiesFormat.cs new file mode 100644 index 000000000000..428f168c7c22 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationPropertiesFormat.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the IpAllocation. + /// + public partial class IpAllocationPropertiesFormat + { + /// + /// Initializes a new instance of the IpAllocationPropertiesFormat class. + /// + public IpAllocationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IpAllocationPropertiesFormat class. + /// + + /// The Subnet that using the prefix of this IpAllocation resource. + /// + + /// The VirtualNetwork that using the prefix of this IpAllocation resource. + /// + + /// The type for the IpAllocation. + /// Possible values include: 'Undefined', 'Hypernet' + + /// The address prefix for the IpAllocation. + /// + + /// The address prefix length for the IpAllocation. + /// + + /// The address prefix Type for the IpAllocation. + /// Possible values include: 'IPv4', 'IPv6' + + /// The IPAM allocation ID. + /// + + /// IpAllocation tags. + /// + public IpAllocationPropertiesFormat(SubResource subnet = default(SubResource), SubResource virtualNetwork = default(SubResource), string type = default(string), string prefix = default(string), int? prefixLength = default(int?), string prefixType = default(string), string ipamAllocationId = default(string), System.Collections.Generic.IDictionary allocationTags = default(System.Collections.Generic.IDictionary)) + + { + this.Subnet = subnet; + this.VirtualNetwork = virtualNetwork; + this.Type = type; + this.Prefix = prefix; + this.PrefixLength = prefixLength; + this.PrefixType = prefixType; + this.IpamAllocationId = ipamAllocationId; + this.AllocationTags = allocationTags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the Subnet that using the prefix of this IpAllocation resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; private set; } + + /// + /// Gets the VirtualNetwork that using the prefix of this IpAllocation + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetwork")] + public SubResource VirtualNetwork {get; private set; } + + /// + /// Gets or sets the type for the IpAllocation. Possible values include: 'Undefined', 'Hypernet' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets the address prefix for the IpAllocation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "prefix")] + public string Prefix {get; set; } + + /// + /// Gets or sets the address prefix length for the IpAllocation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "prefixLength")] + public int? PrefixLength {get; set; } + + /// + /// Gets or sets the address prefix Type for the IpAllocation. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "prefixType")] + public string PrefixType {get; set; } + + /// + /// Gets or sets the IPAM allocation ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipamAllocationId")] + public string IpamAllocationId {get; set; } + + /// + /// Gets or sets ipAllocation tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allocationTags")] + public System.Collections.Generic.IDictionary AllocationTags {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationType.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationType.cs index 8f9b9fd312b4..359e64578c83 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpAllocationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IpAllocationType. /// + + public static class IpAllocationType { public const string Undefined = "Undefined"; public const string Hypernet = "Hypernet"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpFlowProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpFlowProtocol.cs index a591a33afa22..b68979d5196c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpFlowProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpFlowProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IpFlowProtocol. /// + + public static class IpFlowProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpGroup.cs index 95a4a7ca07ea..2ec8d48fcf47 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpGroup.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The IpGroups resource information. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class IpGroup : Resource { /// @@ -34,30 +24,47 @@ public IpGroup() /// /// Initializes a new instance of the IpGroup class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The provisioning state of the - /// IpGroups resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// IpAddresses/IpAddressPrefixes in the - /// IpGroups resource. - /// List of references to Firewall resources - /// that this IpGroups is associated with. - /// List of references to Firewall - /// Policies resources that this IpGroups is associated with. - /// A unique read-only string that changes whenever - /// the resource is updated. - public IpGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList ipAddresses = default(IList), IList firewalls = default(IList), IList firewallPolicies = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the IpGroups resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// IpAddresses/IpAddressPrefixes in the IpGroups resource. + /// + + /// List of references to Firewall resources that this IpGroups is associated + /// with. + /// + + /// List of references to Firewall Policies resources that this IpGroups is + /// associated with. + /// + public IpGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList ipAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList firewalls = default(System.Collections.Generic.IList), System.Collections.Generic.IList firewallPolicies = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - ProvisioningState = provisioningState; - IpAddresses = ipAddresses; - Firewalls = firewalls; - FirewallPolicies = firewallPolicies; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.IPAddresses = ipAddresses; + this.Firewalls = firewalls; + this.FirewallPolicies = firewallPolicies; CustomInit(); } @@ -66,40 +73,38 @@ public IpGroup() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the IpGroups resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets ipAddresses/IpAddressPrefixes in the IpGroups - /// resource. + /// Gets the provisioning state of the IpGroups resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.ipAddresses")] - public IList IpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets list of references to Firewall resources that this IpGroups is - /// associated with. + /// Gets or sets ipAddresses/IpAddressPrefixes in the IpGroups resource. /// - [JsonProperty(PropertyName = "properties.firewalls")] - public IList Firewalls { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddresses")] + public System.Collections.Generic.IList IPAddresses {get; set; } /// - /// Gets list of references to Firewall Policies resources that this - /// IpGroups is associated with. + /// Gets list of references to Firewall resources that this IpGroups is + /// associated with. /// - [JsonProperty(PropertyName = "properties.firewallPolicies")] - public IList FirewallPolicies { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewalls")] + public System.Collections.Generic.IList Firewalls {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets list of references to Firewall Policies resources that this IpGroups + /// is associated with. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.firewallPolicies")] + public System.Collections.Generic.IList FirewallPolicies {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpGroupPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpGroupPropertiesFormat.cs new file mode 100644 index 000000000000..ee1ce6c1dd79 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpGroupPropertiesFormat.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// The IpGroups property information. + /// + public partial class IpGroupPropertiesFormat + { + /// + /// Initializes a new instance of the IpGroupPropertiesFormat class. + /// + public IpGroupPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IpGroupPropertiesFormat class. + /// + + /// The provisioning state of the IpGroups resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// IpAddresses/IpAddressPrefixes in the IpGroups resource. + /// + + /// List of references to Firewall resources that this IpGroups is associated + /// with. + /// + + /// List of references to Firewall Policies resources that this IpGroups is + /// associated with. + /// + public IpGroupPropertiesFormat(string provisioningState = default(string), System.Collections.Generic.IList ipAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList firewalls = default(System.Collections.Generic.IList), System.Collections.Generic.IList firewallPolicies = default(System.Collections.Generic.IList)) + + { + this.ProvisioningState = provisioningState; + this.IPAddresses = ipAddresses; + this.Firewalls = firewalls; + this.FirewallPolicies = firewallPolicies; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the IpGroups resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets ipAddresses/IpAddressPrefixes in the IpGroups resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddresses")] + public System.Collections.Generic.IList IPAddresses {get; set; } + + /// + /// Gets list of references to Firewall resources that this IpGroups is + /// associated with. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewalls")] + public System.Collections.Generic.IList Firewalls {get; private set; } + + /// + /// Gets list of references to Firewall Policies resources that this IpGroups + /// is associated with. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallPolicies")] + public System.Collections.Generic.IList FirewallPolicies {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpTag.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpTag.cs index cfd11534ab2c..6c8fb9225a51 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpTag.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpTag.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public IpTag() /// /// Initializes a new instance of the IpTag class. /// - /// The IP tag type. Example: - /// FirstPartyUsage. - /// The value of the IP tag associated with the - /// public IP. Example: SQL. + + /// The IP tag type. Example: FirstPartyUsage. + /// + + /// The value of the IP tag associated with the public IP. Example: SQL. + /// public IpTag(string ipTagType = default(string), string tag = default(string)) + { - IpTagType = ipTagType; - Tag = tag; + this.IPTagType = ipTagType; + this.Tag = tag; CustomInit(); } @@ -45,18 +42,18 @@ public IpTag() /// partial void CustomInit(); + /// /// Gets or sets the IP tag type. Example: FirstPartyUsage. /// - [JsonProperty(PropertyName = "ipTagType")] - public string IpTagType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTagType")] + public string IPTagType {get; set; } /// /// Gets or sets the value of the IP tag associated with the public IP. /// Example: SQL. /// - [JsonProperty(PropertyName = "tag")] - public string Tag { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tag")] + public string Tag {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpsecEncryption.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpsecEncryption.cs index 443018b5be37..366c89ffaeb3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpsecEncryption.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpsecEncryption.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IpsecEncryption. /// + + public static class IpsecEncryption { public const string None = "None"; @@ -22,8 +19,8 @@ public static class IpsecEncryption public const string AES128 = "AES128"; public const string AES192 = "AES192"; public const string AES256 = "AES256"; - public const string GCMAES128 = "GCMAES128"; - public const string GCMAES192 = "GCMAES192"; - public const string GCMAES256 = "GCMAES256"; + public const string Gcmaes128 = "GCMAES128"; + public const string Gcmaes192 = "GCMAES192"; + public const string Gcmaes256 = "GCMAES256"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpsecIntegrity.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpsecIntegrity.cs index 41b59f4110a6..3d2e5fe3b717 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpsecIntegrity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpsecIntegrity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,13 +9,15 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IpsecIntegrity. /// + + public static class IpsecIntegrity { public const string MD5 = "MD5"; public const string SHA1 = "SHA1"; public const string SHA256 = "SHA256"; - public const string GCMAES128 = "GCMAES128"; - public const string GCMAES192 = "GCMAES192"; - public const string GCMAES256 = "GCMAES256"; + public const string Gcmaes128 = "GCMAES128"; + public const string Gcmaes192 = "GCMAES192"; + public const string Gcmaes256 = "GCMAES256"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IpsecPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/IpsecPolicy.cs index 74466bdd80d3..8d265fb76c27 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IpsecPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IpsecPolicy.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,40 +23,49 @@ public IpsecPolicy() /// /// Initializes a new instance of the IpsecPolicy class. /// - /// The IPSec Security Association - /// (also called Quick Mode or Phase 2 SA) lifetime in seconds for a - /// site to site VPN tunnel. - /// The IPSec Security Association - /// (also called Quick Mode or Phase 2 SA) payload size in KB for a - /// site to site VPN tunnel. - /// The IPSec encryption algorithm (IKE - /// phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', - /// 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - /// The IPSec integrity algorithm (IKE - /// phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - /// 'GCMAES128', 'GCMAES192', 'GCMAES256' - /// The IKE encryption algorithm (IKE phase - /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256', 'GCMAES256', 'GCMAES128' - /// The IKE integrity algorithm (IKE phase - /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', - /// 'GCMAES256', 'GCMAES128' - /// The DH Group used in IKE Phase 1 for initial - /// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - /// The Pfs Group used in IKE Phase 2 for new - /// child SA. Possible values include: 'None', 'PFS1', 'PFS2', - /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + + /// The IPSec Security Association (also called Quick Mode or Phase 2 SA) + /// lifetime in seconds for a site to site VPN tunnel. + /// + + /// The IPSec Security Association (also called Quick Mode or Phase 2 SA) + /// payload size in KB for a site to site VPN tunnel. + /// + + /// The IPSec encryption algorithm (IKE phase 1). + /// Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + /// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + + /// The IPSec integrity algorithm (IKE phase 1). + /// Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', + /// 'GCMAES256' + + /// The IKE encryption algorithm (IKE phase 2). + /// Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + /// 'GCMAES256', 'GCMAES128' + + /// The IKE integrity algorithm (IKE phase 2). + /// Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + /// 'GCMAES128' + + /// The DH Group used in IKE Phase 1 for initial SA. + /// Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + /// 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + + /// The Pfs Group used in IKE Phase 2 for new child SA. + /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', + /// 'ECP384', 'PFS24', 'PFS14', 'PFSMM' public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup) + { - SaLifeTimeSeconds = saLifeTimeSeconds; - SaDataSizeKilobytes = saDataSizeKilobytes; - IpsecEncryption = ipsecEncryption; - IpsecIntegrity = ipsecIntegrity; - IkeEncryption = ikeEncryption; - IkeIntegrity = ikeIntegrity; - DhGroup = dhGroup; - PfsGroup = pfsGroup; + this.SaLifeTimeSeconds = saLifeTimeSeconds; + this.SaDataSizeKilobytes = saDataSizeKilobytes; + this.IpsecEncryption = ipsecEncryption; + this.IpsecIntegrity = ipsecIntegrity; + this.IkeEncryption = ikeEncryption; + this.IkeIntegrity = ikeIntegrity; + this.DhGroup = dhGroup; + this.PfsGroup = pfsGroup; CustomInit(); } @@ -72,100 +74,94 @@ public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecE /// partial void CustomInit(); + /// - /// Gets or sets the IPSec Security Association (also called Quick Mode - /// or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + /// Gets or sets the IPSec Security Association (also called Quick Mode or + /// Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. /// - [JsonProperty(PropertyName = "saLifeTimeSeconds")] - public int SaLifeTimeSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "saLifeTimeSeconds")] + public int SaLifeTimeSeconds {get; set; } /// - /// Gets or sets the IPSec Security Association (also called Quick Mode - /// or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + /// Gets or sets the IPSec Security Association (also called Quick Mode or + /// Phase 2 SA) payload size in KB for a site to site VPN tunnel. /// - [JsonProperty(PropertyName = "saDataSizeKilobytes")] - public int SaDataSizeKilobytes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "saDataSizeKilobytes")] + public int SaDataSizeKilobytes {get; set; } /// - /// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible - /// values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' /// - [JsonProperty(PropertyName = "ipsecEncryption")] - public string IpsecEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecEncryption")] + public string IpsecEncryption {get; set; } /// - /// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible - /// values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', - /// 'GCMAES256' + /// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' /// - [JsonProperty(PropertyName = "ipsecIntegrity")] - public string IpsecIntegrity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecIntegrity")] + public string IpsecIntegrity {get; set; } /// - /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible - /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', - /// 'GCMAES256', 'GCMAES128' + /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' /// - [JsonProperty(PropertyName = "ikeEncryption")] - public string IkeEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ikeEncryption")] + public string IkeEncryption {get; set; } /// - /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible - /// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', - /// 'GCMAES128' + /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128' /// - [JsonProperty(PropertyName = "ikeIntegrity")] - public string IkeIntegrity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ikeIntegrity")] + public string IkeIntegrity {get; set; } /// - /// Gets or sets the DH Group used in IKE Phase 1 for initial SA. - /// Possible values include: 'None', 'DHGroup1', 'DHGroup2', - /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + /// Gets or sets the DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' /// - [JsonProperty(PropertyName = "dhGroup")] - public string DhGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dhGroup")] + public string DhGroup {get; set; } /// - /// Gets or sets the Pfs Group used in IKE Phase 2 for new child SA. - /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', - /// 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + /// Gets or sets the Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' /// - [JsonProperty(PropertyName = "pfsGroup")] - public string PfsGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "pfsGroup")] + public string PfsGroup {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (IpsecEncryption == null) + if (this.IpsecEncryption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpsecEncryption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpsecEncryption"); } - if (IpsecIntegrity == null) + if (this.IpsecIntegrity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpsecIntegrity"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpsecIntegrity"); } - if (IkeEncryption == null) + if (this.IkeEncryption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IkeEncryption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IkeEncryption"); } - if (IkeIntegrity == null) + if (this.IkeIntegrity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IkeIntegrity"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IkeIntegrity"); } - if (DhGroup == null) + if (this.DhGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DhGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DhGroup"); } - if (PfsGroup == null) + if (this.PfsGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PfsGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PfsGroup"); } + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Ipv6CircuitConnectionConfig.cs b/src/Network/Network.Management.Sdk/Generated/Models/Ipv6CircuitConnectionConfig.cs index 930b22d91790..6bfbe0c87330 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Ipv6CircuitConnectionConfig.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Ipv6CircuitConnectionConfig.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class Ipv6CircuitConnectionConfig { /// - /// Initializes a new instance of the Ipv6CircuitConnectionConfig - /// class. + /// Initializes a new instance of the Ipv6CircuitConnectionConfig class. /// public Ipv6CircuitConnectionConfig() { @@ -28,18 +21,19 @@ public Ipv6CircuitConnectionConfig() } /// - /// Initializes a new instance of the Ipv6CircuitConnectionConfig - /// class. + /// Initializes a new instance of the Ipv6CircuitConnectionConfig class. /// - /// /125 IP address space to carve out - /// customer addresses for global reach. - /// Express Route Circuit - /// connection state. Possible values include: 'Connected', - /// 'Connecting', 'Disconnected' + + /// /125 IP address space to carve out customer addresses for global reach. + /// + + /// Express Route Circuit connection state. + /// Possible values include: 'Connected', 'Connecting', 'Disconnected' public Ipv6CircuitConnectionConfig(string addressPrefix = default(string), string circuitConnectionStatus = default(string)) + { - AddressPrefix = addressPrefix; - CircuitConnectionStatus = circuitConnectionStatus; + this.AddressPrefix = addressPrefix; + this.CircuitConnectionStatus = circuitConnectionStatus; CustomInit(); } @@ -48,19 +42,18 @@ public Ipv6CircuitConnectionConfig() /// partial void CustomInit(); + /// - /// Gets or sets /125 IP address space to carve out customer addresses - /// for global reach. + /// Gets or sets /125 IP address space to carve out customer addresses for + /// global reach. /// - [JsonProperty(PropertyName = "addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets express Route Circuit connection state. Possible values - /// include: 'Connected', 'Connecting', 'Disconnected' + /// Gets express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' /// - [JsonProperty(PropertyName = "circuitConnectionStatus")] - public string CircuitConnectionStatus { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "circuitConnectionStatus")] + public string CircuitConnectionStatus {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Ipv6ExpressRouteCircuitPeeringConfig.cs b/src/Network/Network.Management.Sdk/Generated/Models/Ipv6ExpressRouteCircuitPeeringConfig.cs index 8e332cad1db2..1bb0933bec20 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Ipv6ExpressRouteCircuitPeeringConfig.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Ipv6ExpressRouteCircuitPeeringConfig.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class Ipv6ExpressRouteCircuitPeeringConfig { /// - /// Initializes a new instance of the - /// Ipv6ExpressRouteCircuitPeeringConfig class. + /// Initializes a new instance of the Ipv6ExpressRouteCircuitPeeringConfig class. /// public Ipv6ExpressRouteCircuitPeeringConfig() { @@ -28,26 +21,31 @@ public Ipv6ExpressRouteCircuitPeeringConfig() } /// - /// Initializes a new instance of the - /// Ipv6ExpressRouteCircuitPeeringConfig class. + /// Initializes a new instance of the Ipv6ExpressRouteCircuitPeeringConfig class. /// - /// The primary address - /// prefix. - /// The secondary address - /// prefix. - /// The Microsoft peering - /// configuration. - /// The reference to the RouteFilter - /// resource. - /// The state of peering. Possible values include: - /// 'Disabled', 'Enabled' + + /// The primary address prefix. + /// + + /// The secondary address prefix. + /// + + /// The Microsoft peering configuration. + /// + + /// The reference to the RouteFilter resource. + /// + + /// The state of peering. + /// Possible values include: 'Disabled', 'Enabled' public Ipv6ExpressRouteCircuitPeeringConfig(string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), SubResource routeFilter = default(SubResource), string state = default(string)) + { - PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; - SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; - MicrosoftPeeringConfig = microsoftPeeringConfig; - RouteFilter = routeFilter; - State = state; + this.PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + this.SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + this.MicrosoftPeeringConfig = microsoftPeeringConfig; + this.RouteFilter = routeFilter; + this.State = state; CustomInit(); } @@ -56,36 +54,35 @@ public Ipv6ExpressRouteCircuitPeeringConfig() /// partial void CustomInit(); + /// /// Gets or sets the primary address prefix. /// - [JsonProperty(PropertyName = "primaryPeerAddressPrefix")] - public string PrimaryPeerAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix {get; set; } /// /// Gets or sets the secondary address prefix. /// - [JsonProperty(PropertyName = "secondaryPeerAddressPrefix")] - public string SecondaryPeerAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix {get; set; } /// /// Gets or sets the Microsoft peering configuration. /// - [JsonProperty(PropertyName = "microsoftPeeringConfig")] - public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig {get; set; } /// /// Gets or sets the reference to the RouteFilter resource. /// - [JsonProperty(PropertyName = "routeFilter")] - public SubResource RouteFilter { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "routeFilter")] + public SubResource RouteFilter {get; set; } /// - /// Gets or sets the state of peering. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets or sets the state of peering. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IsGlobal.cs b/src/Network/Network.Management.Sdk/Generated/Models/IsGlobal.cs index 11c8db830ff0..7c786b1a3bd2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IsGlobal.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IsGlobal.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IsGlobal. /// + + public static class IsGlobal { public const string False = "False"; public const string True = "True"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IsWorkloadProtected.cs b/src/Network/Network.Management.Sdk/Generated/Models/IsWorkloadProtected.cs index 7a14d67c9d55..2ee3815ab75e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IsWorkloadProtected.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IsWorkloadProtected.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IsWorkloadProtected. /// + + public static class IsWorkloadProtected { public const string False = "False"; public const string True = "True"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/IssueType.cs b/src/Network/Network.Management.Sdk/Generated/Models/IssueType.cs index 27fd781ff05d..ea58e31a1e30 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/IssueType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/IssueType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for IssueType. /// + + public static class IssueType { public const string Unknown = "Unknown"; @@ -26,4 +23,4 @@ public static class IssueType public const string PortThrottled = "PortThrottled"; public const string Platform = "Platform"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancer.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancer.cs index 065e14de579b..801930ec52b1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancer.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancer.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// LoadBalancer resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LoadBalancer : Resource { /// @@ -34,62 +24,86 @@ public LoadBalancer() /// /// Initializes a new instance of the LoadBalancer class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the load - /// balancer. - /// The load balancer SKU. - /// Object representing the - /// frontend IPs to be used for the load balancer. - /// Collection of backend address - /// pools used by a load balancer. - /// Object collection representing the - /// load balancing rules Gets the provisioning. - /// Collection of probe objects used in the load - /// balancer. - /// 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. - /// 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 + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the load balancer. + /// + + /// The load balancer SKU. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the load balancer resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Object representing the frontend IPs to be used for the load balancer. + /// + + /// Collection of backend address pools used by a load balancer. + /// + + /// Object collection representing the load balancing rules Gets the + /// provisioning. + /// + + /// Collection of probe objects used in the load balancer. + /// + + /// 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. + /// + + /// 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. - /// The outbound rules. - /// The resource GUID property of the load - /// balancer resource. - /// The provisioning state of the load - /// balancer resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), LoadBalancerSku sku = default(LoadBalancerSku), IList frontendIPConfigurations = default(IList), IList backendAddressPools = default(IList), IList loadBalancingRules = default(IList), IList probes = default(IList), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundRules = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + /// associated with individual virtual machines cannot reference an inbound NAT + /// pool. They have to reference individual inbound NAT rules. + /// + + /// The outbound rules. + /// + + /// The resource GUID property of the load balancer resource. + /// + public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), LoadBalancerSku sku = default(LoadBalancerSku), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundRules = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - Sku = sku; - FrontendIPConfigurations = frontendIPConfigurations; - BackendAddressPools = backendAddressPools; - LoadBalancingRules = loadBalancingRules; - Probes = probes; - InboundNatRules = inboundNatRules; - InboundNatPools = inboundNatPools; - OutboundRules = outboundRules; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.ExtendedLocation = extendedLocation; + this.Sku = sku; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.FrontendIPConfigurations = frontendIPConfigurations; + this.BackendAddressPools = backendAddressPools; + this.LoadBalancingRules = loadBalancingRules; + this.Probes = probes; + this.InboundNatRules = inboundNatRules; + this.InboundNatPools = inboundNatPools; + this.OutboundRules = outboundRules; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -98,97 +112,92 @@ public LoadBalancer() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the load balancer. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// /// Gets or sets the load balancer SKU. /// - [JsonProperty(PropertyName = "sku")] - public LoadBalancerSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public LoadBalancerSku Sku {get; set; } /// - /// Gets or sets object representing the frontend IPs to be used for - /// the load balancer. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets collection of backend address pools used by a load - /// balancer. + /// Gets the provisioning state of the load balancer resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets object collection representing the load balancing - /// rules Gets the provisioning. + /// Gets or sets object representing the frontend IPs to be used for the load + /// balancer. /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } /// - /// Gets or sets collection of probe objects used in the load balancer. + /// Gets or sets collection of backend address pools used by a load balancer. /// - [JsonProperty(PropertyName = "properties.probes")] - public IList Probes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } /// - /// Gets or sets 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. + /// Gets or sets object collection representing the load balancing rules Gets + /// the provisioning. /// - [JsonProperty(PropertyName = "properties.inboundNatRules")] - public IList InboundNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; set; } /// - /// Gets or sets 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. + /// Gets or sets collection of probe objects used in the load balancer. /// - [JsonProperty(PropertyName = "properties.inboundNatPools")] - public IList InboundNatPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probes")] + public System.Collections.Generic.IList Probes {get; set; } /// - /// Gets or sets the outbound rules. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.outboundRules")] - public IList OutboundRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; set; } /// - /// Gets the resource GUID property of the load balancer resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatPools")] + public System.Collections.Generic.IList InboundNatPools {get; set; } /// - /// Gets the provisioning state of the load balancer resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the outbound rules. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundRules")] + public System.Collections.Generic.IList OutboundRules {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the load balancer resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddress.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddress.cs index de5f931c2401..0880d9bbe273 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddress.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddress.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Load balancer backend addresses. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LoadBalancerBackendAddress { /// @@ -34,34 +24,44 @@ public LoadBalancerBackendAddress() /// /// Initializes a new instance of the LoadBalancerBackendAddress class. /// - /// Reference to an existing virtual - /// network. - /// Reference to an existing subnet. - /// IP Address belonging to the referenced - /// virtual network. - /// Reference to IP - /// address defined in network interfaces. - /// Reference to the - /// frontend ip address configuration defined in regional - /// loadbalancer. - /// Collection of inbound NAT - /// rule port mappings. - /// A list of administrative states which once - /// set can override health probe so that Load Balancer will always - /// forward new connections to backend, or deny new connections and - /// reset existing connections. Possible values include: 'None', 'Up', - /// 'Down' - /// Name of the backend address. - public LoadBalancerBackendAddress(SubResource virtualNetwork = default(SubResource), SubResource subnet = default(SubResource), string ipAddress = default(string), SubResource networkInterfaceIPConfiguration = default(SubResource), SubResource loadBalancerFrontendIPConfiguration = default(SubResource), IList inboundNatRulesPortMapping = default(IList), string adminState = default(string), string name = default(string)) + + /// Name of the backend address. + /// + + /// Reference to an existing virtual network. + /// + + /// Reference to an existing subnet. + /// + + /// IP Address belonging to the referenced virtual network. + /// + + /// Reference to IP address defined in network interfaces. + /// + + /// Reference to the frontend ip address configuration defined in regional + /// loadbalancer. + /// + + /// Collection of inbound NAT rule port mappings. + /// + + /// A list of administrative states which once set can override health probe so + /// that Load Balancer will always forward new connections to backend, or deny + /// new connections and reset existing connections. + /// Possible values include: 'None', 'Up', 'Down' + public LoadBalancerBackendAddress(string name = default(string), SubResource virtualNetwork = default(SubResource), SubResource subnet = default(SubResource), string ipAddress = default(string), SubResource networkInterfaceIPConfiguration = default(SubResource), SubResource loadBalancerFrontendIPConfiguration = default(SubResource), System.Collections.Generic.IList inboundNatRulesPortMapping = default(System.Collections.Generic.IList), string adminState = default(string)) + { - VirtualNetwork = virtualNetwork; - Subnet = subnet; - IpAddress = ipAddress; - NetworkInterfaceIPConfiguration = networkInterfaceIPConfiguration; - LoadBalancerFrontendIPConfiguration = loadBalancerFrontendIPConfiguration; - InboundNatRulesPortMapping = inboundNatRulesPortMapping; - AdminState = adminState; - Name = name; + this.Name = name; + this.VirtualNetwork = virtualNetwork; + this.Subnet = subnet; + this.IPAddress = ipAddress; + this.NetworkInterfaceIPConfiguration = networkInterfaceIPConfiguration; + this.LoadBalancerFrontendIPConfiguration = loadBalancerFrontendIPConfiguration; + this.InboundNatRulesPortMapping = inboundNatRulesPortMapping; + this.AdminState = adminState; CustomInit(); } @@ -70,58 +70,56 @@ public LoadBalancerBackendAddress() /// partial void CustomInit(); + + /// + /// Gets or sets name of the backend address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + /// /// Gets or sets reference to an existing virtual network. /// - [JsonProperty(PropertyName = "properties.virtualNetwork")] - public SubResource VirtualNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetwork")] + public SubResource VirtualNetwork {get; set; } /// /// Gets or sets reference to an existing subnet. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets or sets IP Address belonging to the referenced virtual - /// network. + /// Gets or sets iP Address belonging to the referenced virtual network. /// - [JsonProperty(PropertyName = "properties.ipAddress")] - public string IpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] + public string IPAddress {get; set; } /// /// Gets reference to IP address defined in network interfaces. /// - [JsonProperty(PropertyName = "properties.networkInterfaceIPConfiguration")] - public SubResource NetworkInterfaceIPConfiguration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaceIPConfiguration")] + public SubResource NetworkInterfaceIPConfiguration {get; private set; } /// - /// Gets or sets reference to the frontend ip address configuration - /// defined in regional loadbalancer. + /// Gets or sets reference to the frontend ip address configuration defined in + /// regional loadbalancer. /// - [JsonProperty(PropertyName = "properties.loadBalancerFrontendIPConfiguration")] - public SubResource LoadBalancerFrontendIPConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerFrontendIPConfiguration")] + public SubResource LoadBalancerFrontendIPConfiguration {get; set; } /// /// Gets collection of inbound NAT rule port mappings. /// - [JsonProperty(PropertyName = "properties.inboundNatRulesPortMapping")] - public IList InboundNatRulesPortMapping { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRulesPortMapping")] + public System.Collections.Generic.IList InboundNatRulesPortMapping {get; private set; } /// - /// Gets or sets a list of administrative states which once set can - /// override health probe so that Load Balancer will always forward new - /// connections to backend, or deny new connections and reset existing - /// connections. Possible values include: 'None', 'Up', 'Down' + /// Gets or sets a list of administrative states which once set can override + /// health probe so that Load Balancer will always forward new connections to + /// backend, or deny new connections and reset existing connections. Possible values include: 'None', 'Up', 'Down' /// - [JsonProperty(PropertyName = "properties.adminState")] - public string AdminState { get; set; } - - /// - /// Gets or sets name of the backend address. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.adminState")] + public string AdminState {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressAdminState.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressAdminState.cs index 9a18bb62f86b..fb7fd4f6aceb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressAdminState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressAdminState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for LoadBalancerBackendAddressAdminState. /// + + public static class LoadBalancerBackendAddressAdminState { public const string None = "None"; public const string Up = "Up"; public const string Down = "Down"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressPropertiesFormat.cs new file mode 100644 index 000000000000..f857f3613c8b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerBackendAddressPropertiesFormat.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the load balancer backend addresses. + /// + public partial class LoadBalancerBackendAddressPropertiesFormat + { + /// + /// Initializes a new instance of the LoadBalancerBackendAddressPropertiesFormat class. + /// + public LoadBalancerBackendAddressPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancerBackendAddressPropertiesFormat class. + /// + + /// Reference to an existing virtual network. + /// + + /// Reference to an existing subnet. + /// + + /// IP Address belonging to the referenced virtual network. + /// + + /// Reference to IP address defined in network interfaces. + /// + + /// Reference to the frontend ip address configuration defined in regional + /// loadbalancer. + /// + + /// Collection of inbound NAT rule port mappings. + /// + + /// A list of administrative states which once set can override health probe so + /// that Load Balancer will always forward new connections to backend, or deny + /// new connections and reset existing connections. + /// Possible values include: 'None', 'Up', 'Down' + public LoadBalancerBackendAddressPropertiesFormat(SubResource virtualNetwork = default(SubResource), SubResource subnet = default(SubResource), string ipAddress = default(string), SubResource networkInterfaceIPConfiguration = default(SubResource), SubResource loadBalancerFrontendIPConfiguration = default(SubResource), System.Collections.Generic.IList inboundNatRulesPortMapping = default(System.Collections.Generic.IList), string adminState = default(string)) + + { + this.VirtualNetwork = virtualNetwork; + this.Subnet = subnet; + this.IPAddress = ipAddress; + this.NetworkInterfaceIPConfiguration = networkInterfaceIPConfiguration; + this.LoadBalancerFrontendIPConfiguration = loadBalancerFrontendIPConfiguration; + this.InboundNatRulesPortMapping = inboundNatRulesPortMapping; + this.AdminState = adminState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets reference to an existing virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetwork")] + public SubResource VirtualNetwork {get; set; } + + /// + /// Gets or sets reference to an existing subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets iP Address belonging to the referenced virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } + + /// + /// Gets reference to IP address defined in network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceIPConfiguration")] + public SubResource NetworkInterfaceIPConfiguration {get; private set; } + + /// + /// Gets or sets reference to the frontend ip address configuration defined in + /// regional loadbalancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerFrontendIPConfiguration")] + public SubResource LoadBalancerFrontendIPConfiguration {get; set; } + + /// + /// Gets collection of inbound NAT rule port mappings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRulesPortMapping")] + public System.Collections.Generic.IList InboundNatRulesPortMapping {get; private set; } + + /// + /// Gets or sets a list of administrative states which once set can override + /// health probe so that Load Balancer will always forward new connections to + /// backend, or deny new connections and reset existing connections. Possible values include: 'None', 'Up', 'Down' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "adminState")] + public string AdminState {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerOutboundRuleProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerOutboundRuleProtocol.cs index b07ba18a12b8..bce730a19481 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerOutboundRuleProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerOutboundRuleProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for LoadBalancerOutboundRuleProtocol. /// + + public static class LoadBalancerOutboundRuleProtocol { public const string Tcp = "Tcp"; public const string Udp = "Udp"; public const string All = "All"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerPropertiesFormat.cs new file mode 100644 index 000000000000..89d8b51a0d4d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerPropertiesFormat.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the load balancer. + /// + public partial class LoadBalancerPropertiesFormat + { + /// + /// Initializes a new instance of the LoadBalancerPropertiesFormat class. + /// + public LoadBalancerPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancerPropertiesFormat class. + /// + + /// Object representing the frontend IPs to be used for the load balancer. + /// + + /// Collection of backend address pools used by a load balancer. + /// + + /// Object collection representing the load balancing rules Gets the + /// provisioning. + /// + + /// Collection of probe objects used in the load balancer. + /// + + /// 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. + /// + + /// 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. + /// + + /// The outbound rules. + /// + + /// The resource GUID property of the load balancer resource. + /// + + /// The provisioning state of the load balancer resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public LoadBalancerPropertiesFormat(System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundRules = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.FrontendIPConfigurations = frontendIPConfigurations; + this.BackendAddressPools = backendAddressPools; + this.LoadBalancingRules = loadBalancingRules; + this.Probes = probes; + this.InboundNatRules = inboundNatRules; + this.InboundNatPools = inboundNatPools; + this.OutboundRules = outboundRules; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets object representing the frontend IPs to be used for the load + /// balancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } + + /// + /// Gets or sets collection of backend address pools used by a load balancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } + + /// + /// Gets or sets object collection representing the load balancing rules Gets + /// the provisioning. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; set; } + + /// + /// Gets or sets collection of probe objects used in the load balancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probes")] + public System.Collections.Generic.IList Probes {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatPools")] + public System.Collections.Generic.IList InboundNatPools {get; set; } + + /// + /// Gets or sets the outbound rules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outboundRules")] + public System.Collections.Generic.IList OutboundRules {get; set; } + + /// + /// Gets the resource GUID property of the load balancer resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the load balancer resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSku.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSku.cs index 17e411b38951..d0caebe5b8df 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public LoadBalancerSku() /// /// Initializes a new instance of the LoadBalancerSku class. /// - /// Name of a load balancer SKU. Possible values - /// include: 'Basic', 'Standard', 'Gateway' - /// Tier of a load balancer SKU. Possible values - /// include: 'Regional', 'Global' + + /// Name of a load balancer SKU. + /// Possible values include: 'Basic', 'Standard', 'Gateway' + + /// Tier of a load balancer SKU. + /// Possible values include: 'Regional', 'Global' public LoadBalancerSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -45,19 +42,17 @@ public LoadBalancerSku() /// partial void CustomInit(); + /// - /// Gets or sets name of a load balancer SKU. Possible values include: - /// 'Basic', 'Standard', 'Gateway' + /// Gets or sets name of a load balancer SKU. Possible values include: 'Basic', 'Standard', 'Gateway' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets tier of a load balancer SKU. Possible values include: - /// 'Regional', 'Global' + /// Gets or sets tier of a load balancer SKU. Possible values include: 'Regional', 'Global' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuName.cs index bad640c6edd2..44c8437515e1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for LoadBalancerSkuName. /// + + public static class LoadBalancerSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; public const string Gateway = "Gateway"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuTier.cs index f13adf92d538..e1cd35f9edd1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerSkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for LoadBalancerSkuTier. /// + + public static class LoadBalancerSkuTier { public const string Regional = "Regional"; public const string Global = "Global"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequest.cs index fd58d9f58f70..3bac793fc053 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,13 @@ public LoadBalancerVipSwapRequest() /// /// Initializes a new instance of the LoadBalancerVipSwapRequest class. /// - /// A list of frontend IP - /// configuration resources that should swap VIPs. - public LoadBalancerVipSwapRequest(IList frontendIPConfigurations = default(IList)) + + /// A list of frontend IP configuration resources that should swap VIPs. + /// + public LoadBalancerVipSwapRequest(System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList)) + { - FrontendIPConfigurations = frontendIPConfigurations; + this.FrontendIPConfigurations = frontendIPConfigurations; CustomInit(); } @@ -44,12 +38,12 @@ public LoadBalancerVipSwapRequest() /// partial void CustomInit(); + /// - /// Gets or sets a list of frontend IP configuration resources that - /// should swap VIPs. + /// Gets or sets a list of frontend IP configuration resources that should swap + /// VIPs. /// - [JsonProperty(PropertyName = "frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs index becef2a1e7ed..d141823dd43e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// - /// VIP swap request's frontend IP configuration object. + /// VIP swap request's frontend IP configuration object. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LoadBalancerVipSwapRequestFrontendIPConfiguration { /// - /// Initializes a new instance of the - /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. + /// Initializes a new instance of the LoadBalancerVipSwapRequestFrontendIPConfiguration class. /// public LoadBalancerVipSwapRequestFrontendIPConfiguration() { @@ -31,17 +22,19 @@ public LoadBalancerVipSwapRequestFrontendIPConfiguration() } /// - /// Initializes a new instance of the - /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. + /// Initializes a new instance of the LoadBalancerVipSwapRequestFrontendIPConfiguration class. /// - /// The ID of frontend IP configuration - /// resource. - /// A reference to public IP address - /// resource. + + /// The ID of frontend IP configuration resource. + /// + + /// A reference to public IP address resource. + /// public LoadBalancerVipSwapRequestFrontendIPConfiguration(string id = default(string), SubResource publicIPAddress = default(SubResource)) + { - Id = id; - PublicIPAddress = publicIPAddress; + this.Id = id; + this.PublicIPAddress = publicIPAddress; CustomInit(); } @@ -50,17 +43,17 @@ public LoadBalancerVipSwapRequestFrontendIPConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the ID of frontend IP configuration resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets a reference to public IP address resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public SubResource PublicIPAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public SubResource PublicIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfigurationProperties.cs new file mode 100644 index 000000000000..381fd9167fc9 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfigurationProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// The properties of VIP swap request's frontend IP configuration object. + /// + public partial class LoadBalancerVipSwapRequestFrontendIPConfigurationProperties + { + /// + /// Initializes a new instance of the LoadBalancerVipSwapRequestFrontendIPConfigurationProperties class. + /// + public LoadBalancerVipSwapRequestFrontendIPConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancerVipSwapRequestFrontendIPConfigurationProperties class. + /// + + /// A reference to public IP address resource. + /// + public LoadBalancerVipSwapRequestFrontendIPConfigurationProperties(SubResource publicIPAddress = default(SubResource)) + + { + this.PublicIPAddress = publicIPAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a reference to public IP address resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public SubResource PublicIPAddress {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRule.cs index 109185a6cc7e..22a9b5af1db8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A load balancing rule for a load balancer. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LoadBalancingRule : SubResource { /// @@ -34,72 +24,91 @@ public LoadBalancingRule() /// /// Initializes a new instance of the LoadBalancingRule class. /// - /// The reference to the transport protocol used - /// by the load balancing rule. Possible values include: 'Udp', 'Tcp', - /// 'All' - /// 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". - /// Resource ID. - /// A reference to frontend IP - /// addresses. - /// A reference to a pool of DIPs. - /// Inbound traffic is randomly load balanced across IPs in the backend - /// IPs. - /// An array of references to pool of - /// DIPs. - /// The reference to the load balancer probe used - /// by the load balancing rule. - /// The load distribution policy for - /// this rule. Possible values include: 'Default', 'SourceIP', - /// 'SourceIPProtocol' - /// The port used for internal connections on - /// the endpoint. Acceptable values are between 0 and 65535. Note that - /// value 0 enables "Any Port". - /// 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. - /// 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. - /// 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. - /// Configures SNAT for the VMs in - /// the backend pool to use the publicIP address specified in the - /// frontend of the load balancing rule. - /// The provisioning state of the load - /// balancing rule resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the set of load balancing rules used by the load balancer. This - /// name can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), IList backendAddressPools = default(IList), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of load balancing + /// rules used by the load balancer. This name can be used to access the + /// resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The load distribution policy for this rule. + /// Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + + /// The provisioning state of the load balancing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A reference to frontend IP addresses. + /// + + /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced + /// across IPs in the backend IPs. + /// + + /// An array of references to pool of DIPs. + /// + + /// The reference to the load balancer probe used by the load balancing rule. + /// + + /// The reference to the transport protocol used by the load balancing rule. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// 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". + /// + + /// The port used for internal connections on the endpoint. Acceptable values + /// are between 0 and 65535. Note that value 0 enables "Any Port". + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + + /// Configures SNAT for the VMs in the backend pool to use the publicIP address + /// specified in the frontend of the load balancing rule. + /// + public LoadBalancingRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string loadDistribution = default(string), string provisioningState = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), SubResource probe = default(SubResource), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?)) + + : base(id) { - FrontendIPConfiguration = frontendIPConfiguration; - BackendAddressPool = backendAddressPool; - BackendAddressPools = backendAddressPools; - Probe = probe; - Protocol = protocol; - LoadDistribution = loadDistribution; - FrontendPort = frontendPort; - BackendPort = backendPort; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableFloatingIP = enableFloatingIP; - EnableTcpReset = enableTcpReset; - DisableOutboundSnat = disableOutboundSnat; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.LoadDistribution = loadDistribution; + this.ProvisioningState = provisioningState; + this.FrontendIPConfiguration = frontendIPConfiguration; + this.BackendAddressPool = backendAddressPool; + this.BackendAddressPools = backendAddressPools; + this.Probe = probe; + this.Protocol = protocol; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.EnableFloatingIP = enableFloatingIP; + this.EnableTcpReset = enableTcpReset; + this.DisableOutboundSnat = disableOutboundSnat; CustomInit(); } @@ -108,138 +117,119 @@ public LoadBalancingRule() /// partial void CustomInit(); - /// - /// Gets or sets a reference to frontend IP addresses. - /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] - public SubResource FrontendIPConfiguration { get; set; } /// - /// Gets or sets a reference to a pool of DIPs. Inbound traffic is - /// randomly load balanced across IPs in the backend IPs. + /// Gets or sets the name of the resource that is unique within the set of load + /// balancing rules used by the load balancer. This name can be used to access + /// the resource. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets an array of references to pool of DIPs. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the load balancer probe used by the - /// load balancing rule. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.probe")] - public SubResource Probe { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the reference to the transport protocol used by the - /// load balancing rule. Possible values include: 'Udp', 'Tcp', 'All' + /// Gets or sets the load distribution policy for this rule. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistribution")] + public string LoadDistribution {get; set; } /// - /// Gets or sets the load distribution policy for this rule. Possible - /// values include: 'Default', 'SourceIP', 'SourceIPProtocol' + /// Gets the provisioning state of the load balancing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.loadDistribution")] - public string LoadDistribution { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets 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". + /// Gets or sets a reference to frontend IP addresses. /// - [JsonProperty(PropertyName = "properties.frontendPort")] - public int FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } /// - /// Gets or sets the port used for internal connections on the - /// endpoint. Acceptable values are between 0 and 65535. Note that - /// value 0 enables "Any Port". + /// Gets or sets a reference to a pool of DIPs. Inbound traffic is randomly + /// load balanced across IPs in the backend IPs. /// - [JsonProperty(PropertyName = "properties.backendPort")] - public int? BackendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// - /// Gets or sets 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. + /// Gets or sets an array of references to pool of DIPs. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } /// - /// Gets or sets 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. + /// Gets or sets the reference to the load balancer probe used by the load + /// balancing rule. /// - [JsonProperty(PropertyName = "properties.enableFloatingIP")] - public bool? EnableFloatingIP { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] + public SubResource Probe {get; set; } /// - /// Gets or sets 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. + /// Gets or sets the reference to the transport protocol used by the load + /// balancing rule. Possible values include: 'Udp', 'Tcp', 'All' /// - [JsonProperty(PropertyName = "properties.enableTcpReset")] - public bool? EnableTcpReset { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets configures SNAT for the VMs in the backend pool to use - /// the publicIP address specified in the frontend of the load - /// balancing rule. + /// Gets or sets 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". /// - [JsonProperty(PropertyName = "properties.disableOutboundSnat")] - public bool? DisableOutboundSnat { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + public int? FrontendPort {get; set; } /// - /// Gets the provisioning state of the load balancing rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets the port used for internal connections on the endpoint. + /// Acceptable values are between 0 and 65535. Note that value 0 enables "Any + /// Port". /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] + public int? BackendPort {get; set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of load balancing rules used by the load balancer. This name can be - /// used to access the resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] + public bool? EnableFloatingIP {get; set; } /// - /// Gets type of the resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset {get; set; } /// - /// Validate the object. + /// Gets or sets configures SNAT for the VMs in the backend pool to use the + /// publicIP address specified in the frontend of the load balancing rule. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableOutboundSnat")] + public bool? DisableOutboundSnat {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRulePropertiesFormat.cs new file mode 100644 index 000000000000..0bbdcef51c30 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadBalancingRulePropertiesFormat.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the load balancer. + /// + public partial class LoadBalancingRulePropertiesFormat + { + /// + /// Initializes a new instance of the LoadBalancingRulePropertiesFormat class. + /// + public LoadBalancingRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancingRulePropertiesFormat class. + /// + + /// A reference to frontend IP addresses. + /// + + /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced + /// across IPs in the backend IPs. + /// + + /// An array of references to pool of DIPs. + /// + + /// The reference to the load balancer probe used by the load balancing rule. + /// + + /// The reference to the transport protocol used by the load balancing rule. + /// Possible values include: 'Udp', 'Tcp', 'All' + + /// The load distribution policy for this rule. + /// Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + + /// 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". + /// + + /// The port used for internal connections on the endpoint. Acceptable values + /// are between 0 and 65535. Note that value 0 enables "Any Port". + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + + /// Configures SNAT for the VMs in the backend pool to use the publicIP address + /// specified in the frontend of the load balancing rule. + /// + + /// The provisioning state of the load balancing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public LoadBalancingRulePropertiesFormat(string protocol, int frontendPort, SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), string provisioningState = default(string)) + + { + this.FrontendIPConfiguration = frontendIPConfiguration; + this.BackendAddressPool = backendAddressPool; + this.BackendAddressPools = backendAddressPools; + this.Probe = probe; + this.Protocol = protocol; + this.LoadDistribution = loadDistribution; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.EnableFloatingIP = enableFloatingIP; + this.EnableTcpReset = enableTcpReset; + this.DisableOutboundSnat = disableOutboundSnat; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a reference to frontend IP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfiguration")] + public SubResource FrontendIPConfiguration {get; set; } + + /// + /// Gets or sets a reference to a pool of DIPs. Inbound traffic is randomly + /// load balanced across IPs in the backend IPs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + + /// + /// Gets or sets an array of references to pool of DIPs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools {get; set; } + + /// + /// Gets or sets the reference to the load balancer probe used by the load + /// balancing rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probe")] + public SubResource Probe {get; set; } + + /// + /// Gets or sets the reference to the transport protocol used by the load + /// balancing rule. Possible values include: 'Udp', 'Tcp', 'All' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets the load distribution policy for this rule. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadDistribution")] + public string LoadDistribution {get; set; } + + /// + /// Gets or sets 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". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public int FrontendPort {get; set; } + + /// + /// Gets or sets the port used for internal connections on the endpoint. + /// Acceptable values are between 0 and 65535. Note that value 0 enables "Any + /// Port". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFloatingIP")] + public bool? EnableFloatingIP {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableTcpReset")] + public bool? EnableTcpReset {get; set; } + + /// + /// Gets or sets configures SNAT for the VMs in the backend pool to use the + /// publicIP address specified in the frontend of the load balancing rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableOutboundSnat")] + public bool? DisableOutboundSnat {get; set; } + + /// + /// Gets the provisioning state of the load balancing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Protocol == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LoadDistribution.cs b/src/Network/Network.Management.Sdk/Generated/Models/LoadDistribution.cs index 57b7e6a8109e..bce55fd6164f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LoadDistribution.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LoadDistribution.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for LoadDistribution. /// + + public static class LoadDistribution { public const string Default = "Default"; public const string SourceIP = "SourceIP"; public const string SourceIPProtocol = "SourceIPProtocol"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGateway.cs index 81af6d8c5887..a5fb32eeb2f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LocalNetworkGateway : Resource { /// @@ -34,35 +24,53 @@ public LocalNetworkGateway() /// /// Initializes a new instance of the LocalNetworkGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Local network site address - /// space. - /// IP address of local network - /// gateway. - /// FQDN of local network gateway. - /// Local network gateway's BGP speaker - /// settings. - /// The resource GUID property of the local - /// network gateway resource. - /// The provisioning state of the local - /// network gateway resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public LocalNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), AddressSpace localNetworkAddressSpace = default(AddressSpace), string gatewayIpAddress = default(string), string fqdn = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Local network gateway's BGP speaker settings. + /// + + /// The provisioning state of the local network gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Local network site address space. + /// + + /// IP address of local network gateway. + /// + + /// FQDN of local network gateway. + /// + + /// The resource GUID property of the local network gateway resource. + /// + public LocalNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), BgpSettings bgpSettings = default(BgpSettings), string provisioningState = default(string), AddressSpace localNetworkAddressSpace = default(AddressSpace), string gatewayIPAddress = default(string), string fqdn = default(string), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - LocalNetworkAddressSpace = localNetworkAddressSpace; - GatewayIpAddress = gatewayIpAddress; - Fqdn = fqdn; - BgpSettings = bgpSettings; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.BgpSettings = bgpSettings; + this.ProvisioningState = provisioningState; + this.LocalNetworkAddressSpace = localNetworkAddressSpace; + this.GatewayIPAddress = gatewayIPAddress; + this.Fqdn = fqdn; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -71,64 +79,67 @@ public LocalNetworkGateway() /// partial void CustomInit(); + /// - /// Gets or sets local network site address space. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] - public AddressSpace LocalNetworkAddressSpace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets IP address of local network gateway. + /// Gets or sets local network gateway's BGP speaker settings. /// - [JsonProperty(PropertyName = "properties.gatewayIpAddress")] - public string GatewayIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] + public BgpSettings BgpSettings {get; set; } /// - /// Gets or sets FQDN of local network gateway. + /// Gets the provisioning state of the local network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets local network gateway's BGP speaker settings. + /// Gets or sets local network site address space. /// - [JsonProperty(PropertyName = "properties.bgpSettings")] - public BgpSettings BgpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] + public AddressSpace LocalNetworkAddressSpace {get; set; } /// - /// Gets the resource GUID property of the local network gateway - /// resource. + /// Gets or sets iP address of local network gateway. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayIpAddress")] + public string GatewayIPAddress {get; set; } /// - /// Gets the provisioning state of the local network gateway resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets fQDN of local network gateway. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdn")] + public string Fqdn {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the local network gateway resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BgpSettings != null) + + if (this.BgpSettings != null) { - BgpSettings.Validate(); + this.BgpSettings.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGatewayPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGatewayPropertiesFormat.cs new file mode 100644 index 000000000000..cb5cbaf52cf0 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/LocalNetworkGatewayPropertiesFormat.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// LocalNetworkGateway properties. + /// + public partial class LocalNetworkGatewayPropertiesFormat + { + /// + /// Initializes a new instance of the LocalNetworkGatewayPropertiesFormat class. + /// + public LocalNetworkGatewayPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LocalNetworkGatewayPropertiesFormat class. + /// + + /// Local network site address space. + /// + + /// IP address of local network gateway. + /// + + /// FQDN of local network gateway. + /// + + /// Local network gateway's BGP speaker settings. + /// + + /// The resource GUID property of the local network gateway resource. + /// + + /// The provisioning state of the local network gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public LocalNetworkGatewayPropertiesFormat(AddressSpace localNetworkAddressSpace = default(AddressSpace), string gatewayIPAddress = default(string), string fqdn = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.LocalNetworkAddressSpace = localNetworkAddressSpace; + this.GatewayIPAddress = gatewayIPAddress; + this.Fqdn = fqdn; + this.BgpSettings = bgpSettings; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets local network site address space. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "localNetworkAddressSpace")] + public AddressSpace LocalNetworkAddressSpace {get; set; } + + /// + /// Gets or sets iP address of local network gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayIpAddress")] + public string GatewayIPAddress {get; set; } + + /// + /// Gets or sets fQDN of local network gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } + + /// + /// Gets or sets local network gateway's BGP speaker settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpSettings")] + public BgpSettings BgpSettings {get; set; } + + /// + /// Gets the resource GUID property of the local network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the local network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.BgpSettings != null) + { + this.BgpSettings.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/LogSpecification.cs b/src/Network/Network.Management.Sdk/Generated/Models/LogSpecification.cs index d38b20e45e3b..c74a4682ffaf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/LogSpecification.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/LogSpecification.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public LogSpecification() /// /// Initializes a new instance of the LogSpecification class. /// - /// The name of the specification. - /// The display name of the - /// specification. - /// Duration of the blob. + + /// The name of the specification. + /// + + /// The display name of the specification. + /// + + /// Duration of the blob. + /// public LogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string)) + { - Name = name; - DisplayName = displayName; - BlobDuration = blobDuration; + this.Name = name; + this.DisplayName = displayName; + this.BlobDuration = blobDuration; CustomInit(); } @@ -46,23 +46,23 @@ public LogSpecification() /// partial void CustomInit(); + /// /// Gets or sets the name of the specification. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the display name of the specification. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets duration of the blob. /// - [JsonProperty(PropertyName = "blobDuration")] - public string BlobDuration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleEnabledState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleEnabledState.cs index 1a7775193d7d..dfb62d09a762 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleEnabledState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleEnabledState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ManagedRuleEnabledState. /// + + public static class ManagedRuleEnabledState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleGroupOverride.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleGroupOverride.cs index 567730e5ab22..ca0532ab5903 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleGroupOverride.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleGroupOverride.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,14 +23,18 @@ public ManagedRuleGroupOverride() /// /// Initializes a new instance of the ManagedRuleGroupOverride class. /// - /// The managed rule group to - /// override. - /// List of rules that will be disabled. If none - /// specified, all rules in the group will be disabled. - public ManagedRuleGroupOverride(string ruleGroupName, IList rules = default(IList)) + + /// The managed rule group to override. + /// + + /// List of rules that will be disabled. If none specified, all rules in the + /// group will be disabled. + /// + public ManagedRuleGroupOverride(string ruleGroupName, System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + { - RuleGroupName = ruleGroupName; - Rules = rules; + this.RuleGroupName = ruleGroupName; + this.Rules = rules; CustomInit(); } @@ -48,34 +43,35 @@ public ManagedRuleGroupOverride() /// partial void CustomInit(); + /// /// Gets or sets the managed rule group to override. /// - [JsonProperty(PropertyName = "ruleGroupName")] - public string RuleGroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroupName")] + public string RuleGroupName {get; set; } /// - /// Gets or sets list of rules that will be disabled. If none - /// specified, all rules in the group will be disabled. + /// Gets or sets list of rules that will be disabled. If none specified, all + /// rules in the group will be disabled. /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleGroupName == null) + if (this.RuleGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleGroupName"); } - if (Rules != null) + + if (this.Rules != null) { - foreach (var element in Rules) + foreach (var element in this.Rules) { if (element != null) { @@ -85,4 +81,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleOverride.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleOverride.cs index 5749a2e54556..191cebb194e0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleOverride.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleOverride.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,18 +23,22 @@ public ManagedRuleOverride() /// /// Initializes a new instance of the ManagedRuleOverride class. /// - /// Identifier for the managed rule. - /// The state of the managed rule. Defaults to - /// Disabled if not specified. Possible values include: 'Disabled', - /// 'Enabled' - /// Describes the override action to be applied - /// when rule matches. Possible values include: 'AnomalyScoring', - /// 'Allow', 'Block', 'Log', 'JSChallenge' + + /// Identifier for the managed rule. + /// + + /// The state of the managed rule. Defaults to Disabled if not specified. + /// Possible values include: 'Disabled', 'Enabled' + + /// Describes the override action to be applied when rule matches. + /// Possible values include: 'AnomalyScoring', 'Allow', 'Block', 'Log', + /// 'JSChallenge' public ManagedRuleOverride(string ruleId, string state = default(string), string action = default(string)) + { - RuleId = ruleId; - State = state; - Action = action; + this.RuleId = ruleId; + this.State = state; + this.Action = action; CustomInit(); } @@ -50,39 +47,40 @@ public ManagedRuleOverride() /// partial void CustomInit(); + /// /// Gets or sets identifier for the managed rule. /// - [JsonProperty(PropertyName = "ruleId")] - public string RuleId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleId")] + public string RuleId {get; set; } /// - /// Gets or sets the state of the managed rule. Defaults to Disabled if - /// not specified. Possible values include: 'Disabled', 'Enabled' + /// Gets or sets the state of the managed rule. Defaults to Disabled if not + /// specified. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// - /// Gets or sets describes the override action to be applied when rule - /// matches. Possible values include: 'AnomalyScoring', 'Allow', - /// 'Block', 'Log', 'JSChallenge' + /// Gets or sets describes the override action to be applied when rule matches. Possible values include: 'AnomalyScoring', 'Allow', 'Block', 'Log', 'JSChallenge' /// - [JsonProperty(PropertyName = "action")] - public string Action { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public string Action {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleId == null) + if (this.RuleId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleId"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleSet.cs index da73bd1b4299..f61ef45af703 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRuleSet.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,16 +23,21 @@ public ManagedRuleSet() /// /// Initializes a new instance of the ManagedRuleSet class. /// - /// Defines the rule set type to use. - /// Defines the version of the rule set to - /// use. - /// Defines the rule group overrides - /// to apply to the rule set. - public ManagedRuleSet(string ruleSetType, string ruleSetVersion, IList ruleGroupOverrides = default(IList)) + + /// Defines the rule set type to use. + /// + + /// Defines the version of the rule set to use. + /// + + /// Defines the rule group overrides to apply to the rule set. + /// + public ManagedRuleSet(string ruleSetType, string ruleSetVersion, System.Collections.Generic.IList ruleGroupOverrides = default(System.Collections.Generic.IList)) + { - RuleSetType = ruleSetType; - RuleSetVersion = ruleSetVersion; - RuleGroupOverrides = ruleGroupOverrides; + this.RuleSetType = ruleSetType; + this.RuleSetVersion = ruleSetVersion; + this.RuleGroupOverrides = ruleGroupOverrides; CustomInit(); } @@ -50,44 +46,45 @@ public ManagedRuleSet() /// partial void CustomInit(); + /// /// Gets or sets defines the rule set type to use. /// - [JsonProperty(PropertyName = "ruleSetType")] - public string RuleSetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetType")] + public string RuleSetType {get; set; } /// /// Gets or sets defines the version of the rule set to use. /// - [JsonProperty(PropertyName = "ruleSetVersion")] - public string RuleSetVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleSetVersion")] + public string RuleSetVersion {get; set; } /// - /// Gets or sets defines the rule group overrides to apply to the rule - /// set. + /// Gets or sets defines the rule group overrides to apply to the rule set. /// - [JsonProperty(PropertyName = "ruleGroupOverrides")] - public IList RuleGroupOverrides { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleGroupOverrides")] + public System.Collections.Generic.IList RuleGroupOverrides {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleSetType == null) + if (this.RuleSetType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetType"); } - if (RuleSetVersion == null) + if (this.RuleSetVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleSetVersion"); } - if (RuleGroupOverrides != null) + + + if (this.RuleGroupOverrides != null) { - foreach (var element in RuleGroupOverrides) + foreach (var element in this.RuleGroupOverrides) { if (element != null) { @@ -97,4 +94,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRulesDefinition.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRulesDefinition.cs index 434e935a2a47..3ded956c931f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedRulesDefinition.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedRulesDefinition.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,14 +23,17 @@ public ManagedRulesDefinition() /// /// Initializes a new instance of the ManagedRulesDefinition class. /// - /// The managed rule sets that are - /// associated with the policy. - /// The Exclusions that are applied on the - /// policy. - public ManagedRulesDefinition(IList managedRuleSets, IList exclusions = default(IList)) + + /// The Exclusions that are applied on the policy. + /// + + /// The managed rule sets that are associated with the policy. + /// + public ManagedRulesDefinition(System.Collections.Generic.IList managedRuleSets, System.Collections.Generic.IList exclusions = default(System.Collections.Generic.IList)) + { - Exclusions = exclusions; - ManagedRuleSets = managedRuleSets; + this.Exclusions = exclusions; + this.ManagedRuleSets = managedRuleSets; CustomInit(); } @@ -48,34 +42,33 @@ public ManagedRulesDefinition() /// partial void CustomInit(); + /// /// Gets or sets the Exclusions that are applied on the policy. /// - [JsonProperty(PropertyName = "exclusions")] - public IList Exclusions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "exclusions")] + public System.Collections.Generic.IList Exclusions {get; set; } /// - /// Gets or sets the managed rule sets that are associated with the - /// policy. + /// Gets or sets the managed rule sets that are associated with the policy. /// - [JsonProperty(PropertyName = "managedRuleSets")] - public IList ManagedRuleSets { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "managedRuleSets")] + public System.Collections.Generic.IList ManagedRuleSets {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ManagedRuleSets == null) + if (this.ManagedRuleSets == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ManagedRuleSets"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ManagedRuleSets"); } - if (Exclusions != null) + if (this.Exclusions != null) { - foreach (var element in Exclusions) + foreach (var element in this.Exclusions) { if (element != null) { @@ -83,16 +76,16 @@ public virtual void Validate() } } } - if (ManagedRuleSets != null) + if (this.ManagedRuleSets != null) { - foreach (var element1 in ManagedRuleSets) + foreach (var element in this.ManagedRuleSets) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs index b8113956da1e..587ebf805e9b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,28 +23,33 @@ public ManagedServiceIdentity() /// /// Initializes a new instance of the ManagedServiceIdentity class. /// - /// The principal id of the system assigned - /// identity. This property will only be provided for a system assigned - /// identity. - /// The tenant id of the system assigned - /// identity. This property will only be provided for a system assigned - /// identity. - /// 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' - /// 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}'. - public ManagedServiceIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The principal id of the system assigned identity. This property will only + /// be provided for a system assigned identity. + /// + + /// The tenant id of the system assigned identity. This property will only be + /// provided for a system assigned identity. + /// + + /// 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' + + /// 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}'. + /// + public ManagedServiceIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -61,39 +58,36 @@ public ManagedServiceIdentity() /// partial void CustomInit(); + /// - /// Gets the principal id of the system assigned identity. This - /// property will only be provided for a system assigned identity. + /// Gets the principal id of the system assigned identity. This property will + /// only be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// - /// Gets the tenant id of the system assigned identity. This property - /// will only be provided for a system assigned identity. + /// Gets the tenant id of the system assigned identity. This property will only + /// be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// /// Gets or sets 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' + /// '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' /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type {get; set; } /// - /// Gets or sets 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}'. + /// Gets or sets 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}'. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentitiesValue.cs b/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentitiesValue.cs index db66bb985b09..b94f475e8cec 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentitiesValue.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentitiesValue.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; public partial class ManagedServiceIdentityUserAssignedIdentitiesValue { /// - /// Initializes a new instance of the - /// ManagedServiceIdentityUserAssignedIdentitiesValue class. + /// Initializes a new instance of the ManagedServiceIdentityUserAssignedIdentitiesValue class. /// public ManagedServiceIdentityUserAssignedIdentitiesValue() { @@ -25,17 +18,19 @@ public ManagedServiceIdentityUserAssignedIdentitiesValue() } /// - /// Initializes a new instance of the - /// ManagedServiceIdentityUserAssignedIdentitiesValue class. + /// Initializes a new instance of the ManagedServiceIdentityUserAssignedIdentitiesValue class. /// - /// The principal id of user assigned - /// identity. - /// The client id of user assigned - /// identity. + + /// The principal id of user assigned identity. + /// + + /// The client id of user assigned identity. + /// public ManagedServiceIdentityUserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) + { - PrincipalId = principalId; - ClientId = clientId; + this.PrincipalId = principalId; + this.ClientId = clientId; CustomInit(); } @@ -44,17 +39,17 @@ public ManagedServiceIdentityUserAssignedIdentitiesValue() /// partial void CustomInit(); + /// /// Gets the principal id of user assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets the client id of user assigned identity. /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/MatchCondition.cs b/src/Network/Network.Management.Sdk/Generated/Models/MatchCondition.cs index 9fbd7d10886e..cd4be004cb85 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/MatchCondition.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/MatchCondition.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,22 +23,31 @@ public MatchCondition() /// /// Initializes a new instance of the MatchCondition class. /// - /// List of match variables. - /// The operator to be matched. Possible - /// values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', - /// 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', - /// 'BeginsWith', 'EndsWith', 'Regex', 'GeoMatch', 'Any' - /// Match value. - /// Whether this is negate condition or - /// not. - /// List of transforms. - public MatchCondition(IList matchVariables, string operatorProperty, IList matchValues, bool? negationConditon = default(bool?), IList transforms = default(IList)) + + /// List of match variables. + /// + + /// The operator to be matched. + /// Possible values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', + /// 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', + /// 'EndsWith', 'Regex', 'GeoMatch', 'Any' + + /// Whether this is negate condition or not. + /// + + /// Match value. + /// + + /// List of transforms. + /// + public MatchCondition(System.Collections.Generic.IList matchVariables, string operatorProperty, System.Collections.Generic.IList matchValues, bool? negationConditon = default(bool?), System.Collections.Generic.IList transforms = default(System.Collections.Generic.IList)) + { - MatchVariables = matchVariables; - OperatorProperty = operatorProperty; - NegationConditon = negationConditon; - MatchValues = matchValues; - Transforms = transforms; + this.MatchVariables = matchVariables; + this.OperatorProperty = operatorProperty; + this.NegationConditon = negationConditon; + this.MatchValues = matchValues; + this.Transforms = transforms; CustomInit(); } @@ -56,62 +56,59 @@ public MatchCondition() /// partial void CustomInit(); + /// /// Gets or sets list of match variables. /// - [JsonProperty(PropertyName = "matchVariables")] - public IList MatchVariables { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchVariables")] + public System.Collections.Generic.IList MatchVariables {get; set; } /// - /// Gets or sets the operator to be matched. Possible values include: - /// 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', - /// 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', - /// 'Regex', 'GeoMatch', 'Any' + /// Gets or sets the operator to be matched. Possible values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex', 'GeoMatch', 'Any' /// - [JsonProperty(PropertyName = "operator")] - public string OperatorProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public string OperatorProperty {get; set; } /// /// Gets or sets whether this is negate condition or not. /// - [JsonProperty(PropertyName = "negationConditon")] - public bool? NegationConditon { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "negationConditon")] + public bool? NegationConditon {get; set; } /// /// Gets or sets match value. /// - [JsonProperty(PropertyName = "matchValues")] - public IList MatchValues { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchValues")] + public System.Collections.Generic.IList MatchValues {get; set; } /// /// Gets or sets list of transforms. /// - [JsonProperty(PropertyName = "transforms")] - public IList Transforms { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "transforms")] + public System.Collections.Generic.IList Transforms {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MatchVariables == null) + if (this.MatchVariables == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchVariables"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MatchVariables"); } - if (OperatorProperty == null) + if (this.OperatorProperty == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "OperatorProperty"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OperatorProperty"); } - if (MatchValues == null) + if (this.MatchValues == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchValues"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MatchValues"); } - if (MatchVariables != null) + if (this.MatchVariables != null) { - foreach (var element in MatchVariables) + foreach (var element in this.MatchVariables) { if (element != null) { @@ -119,6 +116,9 @@ public virtual void Validate() } } } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/MatchVariable.cs b/src/Network/Network.Management.Sdk/Generated/Models/MatchVariable.cs index 9a72bef650cc..e6f06035b9ae 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/MatchVariable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/MatchVariable.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +23,18 @@ public MatchVariable() /// /// Initializes a new instance of the MatchVariable class. /// - /// Match Variable. Possible values include: - /// 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', - /// 'RequestUri', 'RequestHeaders', 'RequestBody', - /// 'RequestCookies' - /// The selector of match variable. + + /// Match Variable. + /// Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', + /// 'PostArgs', 'RequestUri', 'RequestHeaders', 'RequestBody', 'RequestCookies' + + /// The selector of match variable. + /// public MatchVariable(string variableName, string selector = default(string)) + { - VariableName = variableName; - Selector = selector; + this.VariableName = variableName; + this.Selector = selector; CustomInit(); } @@ -47,32 +43,32 @@ public MatchVariable() /// partial void CustomInit(); + /// - /// Gets or sets match Variable. Possible values include: 'RemoteAddr', - /// 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', - /// 'RequestHeaders', 'RequestBody', 'RequestCookies' + /// Gets or sets match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', 'RequestBody', 'RequestCookies' /// - [JsonProperty(PropertyName = "variableName")] - public string VariableName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "variableName")] + public string VariableName {get; set; } /// /// Gets or sets the selector of match variable. /// - [JsonProperty(PropertyName = "selector")] - public string Selector { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "selector")] + public string Selector {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VariableName == null) + if (this.VariableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VariableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VariableName"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/MatchedRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/MatchedRule.cs index 3292892dc3af..e874ac64e125 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/MatchedRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/MatchedRule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,18 @@ public MatchedRule() /// /// Initializes a new instance of the MatchedRule class. /// - /// Name of the matched network security - /// rule. - /// The network traffic is allowed or denied. - /// Possible values are 'Allow' and 'Deny'. + + /// Name of the matched network security rule. + /// + + /// The network traffic is allowed or denied. Possible values are 'Allow' and + /// 'Deny'. + /// public MatchedRule(string ruleName = default(string), string action = default(string)) + { - RuleName = ruleName; - Action = action; + this.RuleName = ruleName; + this.Action = action; CustomInit(); } @@ -45,18 +43,18 @@ public MatchedRule() /// partial void CustomInit(); + /// /// Gets or sets name of the matched network security rule. /// - [JsonProperty(PropertyName = "ruleName")] - public string RuleName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleName")] + public string RuleName {get; set; } /// - /// Gets or sets the network traffic is allowed or denied. Possible - /// values are 'Allow' and 'Deny'. + /// Gets or sets the network traffic is allowed or denied. Possible values are + /// 'Allow' and 'Deny'. /// - [JsonProperty(PropertyName = "action")] - public string Action { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public string Action {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/MetricSpecification.cs b/src/Network/Network.Management.Sdk/Generated/Models/MetricSpecification.cs index 207791a85b15..7e298aff1a81 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/MetricSpecification.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/MetricSpecification.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,41 +23,65 @@ public MetricSpecification() /// /// Initializes a new instance of the MetricSpecification class. /// - /// The name of the metric. - /// The display name of the metric. - /// The description of the - /// metric. - /// Units the metric to be displayed in. - /// The aggregation type. - /// List of availability. - /// Whether regional MDM account - /// enabled. - /// Whether gaps would be filled with - /// zeros. - /// Pattern for the filter of the - /// metric. - /// List of dimensions. - /// Whether the metric is internal. - /// The source MDM account. - /// The source MDM namespace. - /// The resource Id - /// dimension name override. - public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), IList availabilities = default(IList), bool? enableRegionalMdmAccount = default(bool?), bool? fillGapWithZero = default(bool?), string metricFilterPattern = default(string), IList dimensions = default(IList), bool? isInternal = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), string resourceIdDimensionNameOverride = default(string)) + + /// The name of the metric. + /// + + /// The display name of the metric. + /// + + /// The description of the metric. + /// + + /// Units the metric to be displayed in. + /// + + /// The aggregation type. + /// + + /// List of availability. + /// + + /// Whether regional MDM account enabled. + /// + + /// Whether gaps would be filled with zeros. + /// + + /// Pattern for the filter of the metric. + /// + + /// List of dimensions. + /// + + /// Whether the metric is internal. + /// + + /// The source MDM account. + /// + + /// The source MDM namespace. + /// + + /// The resource Id dimension name override. + /// + public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), System.Collections.Generic.IList availabilities = default(System.Collections.Generic.IList), bool? enableRegionalMdmAccount = default(bool?), bool? fillGapWithZero = default(bool?), string metricFilterPattern = default(string), System.Collections.Generic.IList dimensions = default(System.Collections.Generic.IList), bool? isInternal = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), string resourceIdDimensionNameOverride = default(string)) + { - Name = name; - DisplayName = displayName; - DisplayDescription = displayDescription; - Unit = unit; - AggregationType = aggregationType; - Availabilities = availabilities; - EnableRegionalMdmAccount = enableRegionalMdmAccount; - FillGapWithZero = fillGapWithZero; - MetricFilterPattern = metricFilterPattern; - Dimensions = dimensions; - IsInternal = isInternal; - SourceMdmAccount = sourceMdmAccount; - SourceMdmNamespace = sourceMdmNamespace; - ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + this.Name = name; + this.DisplayName = displayName; + this.DisplayDescription = displayDescription; + this.Unit = unit; + this.AggregationType = aggregationType; + this.Availabilities = availabilities; + this.EnableRegionalMdmAccount = enableRegionalMdmAccount; + this.FillGapWithZero = fillGapWithZero; + this.MetricFilterPattern = metricFilterPattern; + this.Dimensions = dimensions; + this.IsInternal = isInternal; + this.SourceMdmAccount = sourceMdmAccount; + this.SourceMdmNamespace = sourceMdmNamespace; + this.ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; CustomInit(); } @@ -74,89 +90,89 @@ public MetricSpecification() /// partial void CustomInit(); + /// /// Gets or sets the name of the metric. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the display name of the metric. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets the description of the metric. /// - [JsonProperty(PropertyName = "displayDescription")] - public string DisplayDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription {get; set; } /// /// Gets or sets units the metric to be displayed in. /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public string Unit {get; set; } /// /// Gets or sets the aggregation type. /// - [JsonProperty(PropertyName = "aggregationType")] - public string AggregationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregationType")] + public string AggregationType {get; set; } /// /// Gets or sets list of availability. /// - [JsonProperty(PropertyName = "availabilities")] - public IList Availabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilities")] + public System.Collections.Generic.IList Availabilities {get; set; } /// /// Gets or sets whether regional MDM account enabled. /// - [JsonProperty(PropertyName = "enableRegionalMdmAccount")] - public bool? EnableRegionalMdmAccount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableRegionalMdmAccount")] + public bool? EnableRegionalMdmAccount {get; set; } /// /// Gets or sets whether gaps would be filled with zeros. /// - [JsonProperty(PropertyName = "fillGapWithZero")] - public bool? FillGapWithZero { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fillGapWithZero")] + public bool? FillGapWithZero {get; set; } /// /// Gets or sets pattern for the filter of the metric. /// - [JsonProperty(PropertyName = "metricFilterPattern")] - public string MetricFilterPattern { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "metricFilterPattern")] + public string MetricFilterPattern {get; set; } /// /// Gets or sets list of dimensions. /// - [JsonProperty(PropertyName = "dimensions")] - public IList Dimensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dimensions")] + public System.Collections.Generic.IList Dimensions {get; set; } /// /// Gets or sets whether the metric is internal. /// - [JsonProperty(PropertyName = "isInternal")] - public bool? IsInternal { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isInternal")] + public bool? IsInternal {get; set; } /// /// Gets or sets the source MDM account. /// - [JsonProperty(PropertyName = "sourceMdmAccount")] - public string SourceMdmAccount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceMdmAccount")] + public string SourceMdmAccount {get; set; } /// /// Gets or sets the source MDM namespace. /// - [JsonProperty(PropertyName = "sourceMdmNamespace")] - public string SourceMdmNamespace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceMdmNamespace")] + public string SourceMdmNamespace {get; set; } /// /// Gets or sets the resource Id dimension name override. /// - [JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] - public string ResourceIdDimensionNameOverride { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] + public string ResourceIdDimensionNameOverride {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/MigrateLoadBalancerToIpBasedRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/MigrateLoadBalancerToIpBasedRequest.cs index 05caa02aa050..92a61e9f3dc3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/MigrateLoadBalancerToIpBasedRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/MigrateLoadBalancerToIpBasedRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class MigrateLoadBalancerToIpBasedRequest { /// - /// Initializes a new instance of the - /// MigrateLoadBalancerToIpBasedRequest class. + /// Initializes a new instance of the MigrateLoadBalancerToIpBasedRequest class. /// public MigrateLoadBalancerToIpBasedRequest() { @@ -30,14 +21,16 @@ public MigrateLoadBalancerToIpBasedRequest() } /// - /// Initializes a new instance of the - /// MigrateLoadBalancerToIpBasedRequest class. + /// Initializes a new instance of the MigrateLoadBalancerToIpBasedRequest class. /// - /// A list of pool names that should be migrated - /// from Nic based to IP based pool - public MigrateLoadBalancerToIpBasedRequest(IList pools = default(IList)) + + /// A list of pool names that should be migrated from Nic based to IP based + /// pool + /// + public MigrateLoadBalancerToIpBasedRequest(System.Collections.Generic.IList pools = default(System.Collections.Generic.IList)) + { - Pools = pools; + this.Pools = pools; CustomInit(); } @@ -46,12 +39,12 @@ public MigrateLoadBalancerToIpBasedRequest() /// partial void CustomInit(); + /// - /// Gets or sets a list of pool names that should be migrated from Nic - /// based to IP based pool + /// Gets or sets a list of pool names that should be migrated from Nic based to + /// IP based pool /// - [JsonProperty(PropertyName = "pools")] - public IList Pools { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "pools")] + public System.Collections.Generic.IList Pools {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/MigratedPools.cs b/src/Network/Network.Management.Sdk/Generated/Models/MigratedPools.cs index 89d7fcc8ab08..ef00a7898265 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/MigratedPools.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/MigratedPools.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,13 @@ public MigratedPools() /// /// Initializes a new instance of the MigratedPools class. /// - /// A list of pools migrated from - /// Nic based to IP based pool - public MigratedPools(IList migratedPoolsProperty = default(IList)) + + /// A list of pools migrated from Nic based to IP based pool + /// + public MigratedPools(System.Collections.Generic.IList migratedPoolsProperty = default(System.Collections.Generic.IList)) + { - MigratedPoolsProperty = migratedPoolsProperty; + this.MigratedPoolsProperty = migratedPoolsProperty; CustomInit(); } @@ -44,12 +38,11 @@ public MigratedPools() /// partial void CustomInit(); + /// - /// Gets or sets a list of pools migrated from Nic based to IP based - /// pool + /// Gets or sets a list of pools migrated from Nic based to IP based pool /// - [JsonProperty(PropertyName = "migratedPools")] - public IList MigratedPoolsProperty { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "migratedPools")] + public System.Collections.Generic.IList MigratedPoolsProperty {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NatGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/NatGateway.cs index 12a4453292b8..a5379bc674d8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NatGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NatGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Nat Gateway resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NatGateway : Resource { /// @@ -34,41 +24,62 @@ public NatGateway() /// /// Initializes a new instance of the NatGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The nat gateway SKU. - /// The idle timeout of the nat - /// gateway. - /// An array of public ip addresses - /// associated with the nat gateway resource. - /// An array of public ip prefixes - /// associated with the nat gateway resource. - /// An array of references to the subnets using - /// this nat gateway resource. - /// The resource GUID property of the NAT - /// gateway resource. - /// The provisioning state of the NAT - /// gateway resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// A list of availability zones denoting the zone - /// in which Nat Gateway should be deployed. - /// A unique read-only string that changes whenever - /// the resource is updated. - public NatGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), NatGatewaySku sku = default(NatGatewaySku), int? idleTimeoutInMinutes = default(int?), IList publicIpAddresses = default(IList), IList publicIpPrefixes = default(IList), IList subnets = default(IList), string resourceGuid = default(string), string provisioningState = default(string), IList zones = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The nat gateway SKU. + /// + + /// A list of availability zones denoting the zone in which Nat Gateway should + /// be deployed. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the NAT gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The idle timeout of the nat gateway. + /// + + /// An array of public ip addresses associated with the nat gateway resource. + /// + + /// An array of public ip prefixes associated with the nat gateway resource. + /// + + /// An array of references to the subnets using this nat gateway resource. + /// + + /// The resource GUID property of the NAT gateway resource. + /// + public NatGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), NatGatewaySku sku = default(NatGatewaySku), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string etag = default(string), string provisioningState = default(string), int? idleTimeoutInMinutes = default(int?), System.Collections.Generic.IList publicIPAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList publicIPPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - Sku = sku; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - PublicIpAddresses = publicIpAddresses; - PublicIpPrefixes = publicIpPrefixes; - Subnets = subnets; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Zones = zones; - Etag = etag; + this.Sku = sku; + this.Zones = zones; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.PublicIPAddresses = publicIPAddresses; + this.PublicIPPrefixes = publicIPPrefixes; + this.Subnets = subnets; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -77,65 +88,63 @@ public NatGateway() /// partial void CustomInit(); + /// /// Gets or sets the nat gateway SKU. /// - [JsonProperty(PropertyName = "sku")] - public NatGatewaySku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public NatGatewaySku Sku {get; set; } /// - /// Gets or sets the idle timeout of the nat gateway. + /// Gets or sets a list of availability zones denoting the zone in which Nat + /// Gateway should be deployed. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets an array of public ip addresses associated with the - /// nat gateway resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.publicIpAddresses")] - public IList PublicIpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets an array of public ip prefixes associated with the nat - /// gateway resource. + /// Gets the provisioning state of the NAT gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.publicIpPrefixes")] - public IList PublicIpPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets an array of references to the subnets using this nat gateway - /// resource. + /// Gets or sets the idle timeout of the nat gateway. /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets the resource GUID property of the NAT gateway resource. + /// Gets or sets an array of public ip addresses associated with the nat + /// gateway resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIpAddresses")] + public System.Collections.Generic.IList PublicIPAddresses {get; set; } /// - /// Gets the provisioning state of the NAT gateway resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets an array of public ip prefixes associated with the nat gateway + /// resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIpPrefixes")] + public System.Collections.Generic.IList PublicIPPrefixes {get; set; } /// - /// Gets or sets a list of availability zones denoting the zone in - /// which Nat Gateway should be deployed. + /// Gets an array of references to the subnets using this nat gateway resource. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the NAT gateway resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NatGatewayPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NatGatewayPropertiesFormat.cs new file mode 100644 index 000000000000..62fdb33b236b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NatGatewayPropertiesFormat.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Nat Gateway properties. + /// + public partial class NatGatewayPropertiesFormat + { + /// + /// Initializes a new instance of the NatGatewayPropertiesFormat class. + /// + public NatGatewayPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NatGatewayPropertiesFormat class. + /// + + /// The idle timeout of the nat gateway. + /// + + /// An array of public ip addresses associated with the nat gateway resource. + /// + + /// An array of public ip prefixes associated with the nat gateway resource. + /// + + /// An array of references to the subnets using this nat gateway resource. + /// + + /// The resource GUID property of the NAT gateway resource. + /// + + /// The provisioning state of the NAT gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public NatGatewayPropertiesFormat(int? idleTimeoutInMinutes = default(int?), System.Collections.Generic.IList publicIPAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList publicIPPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.PublicIPAddresses = publicIPAddresses; + this.PublicIPPrefixes = publicIPPrefixes; + this.Subnets = subnets; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the idle timeout of the nat gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets an array of public ip addresses associated with the nat + /// gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddresses")] + public System.Collections.Generic.IList PublicIPAddresses {get; set; } + + /// + /// Gets or sets an array of public ip prefixes associated with the nat gateway + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpPrefixes")] + public System.Collections.Generic.IList PublicIPPrefixes {get; set; } + + /// + /// Gets an array of references to the subnets using this nat gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } + + /// + /// Gets the resource GUID property of the NAT gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the NAT gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySku.cs b/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySku.cs index b84ee5312ef2..81fb10dd0229 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public NatGatewaySku() /// /// Initializes a new instance of the NatGatewaySku class. /// - /// Name of Nat Gateway SKU. Possible values - /// include: 'Standard' + + /// Name of Nat Gateway SKU. + /// Possible values include: 'Standard' public NatGatewaySku(string name = default(string)) + { - Name = name; + this.Name = name; CustomInit(); } @@ -42,12 +38,11 @@ public NatGatewaySku() /// partial void CustomInit(); + /// - /// Gets or sets name of Nat Gateway SKU. Possible values include: - /// 'Standard' + /// Gets or sets name of Nat Gateway SKU. Possible values include: 'Standard' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySkuName.cs index dca18875a4a9..153c38916fc1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NatGatewaySkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NatGatewaySkuName. /// + + public static class NatGatewaySkuName { public const string Standard = "Standard"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NatRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/NatRule.cs index 8dbc9d3c938e..1fb73c2d3ee2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NatRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NatRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,34 +24,48 @@ public NatRule() /// /// Initializes a new instance of the NatRule class. /// - /// Name of the rule. - /// Description of the rule. - /// Array of - /// FirewallPolicyRuleNetworkProtocols. - /// List of source IP addresses for this - /// rule. - /// List of destination IP addresses - /// or Service Tags. - /// List of destination ports. - /// The translated address for this NAT - /// rule. - /// The translated port for this NAT - /// rule. - /// List of source IpGroups for this - /// rule. - /// The translated FQDN for this NAT - /// rule. - public NatRule(string name = default(string), string description = default(string), IList ipProtocols = default(IList), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), string translatedAddress = default(string), string translatedPort = default(string), IList sourceIpGroups = default(IList), string translatedFqdn = default(string)) - : base(name, description) + + /// Name of the rule. + /// + + /// Description of the rule. + /// + + /// Array of FirewallPolicyRuleNetworkProtocols. + /// + + /// List of source IP addresses for this rule. + /// + + /// List of destination IP addresses or Service Tags. + /// + + /// List of destination ports. + /// + + /// The translated address for this NAT rule. + /// + + /// The translated port for this NAT rule. + /// + + /// List of source IpGroups for this rule. + /// + + /// The translated FQDN for this NAT rule. + /// + public NatRule(string name = default(string), string description = default(string), System.Collections.Generic.IList ipProtocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList), string translatedAddress = default(string), string translatedPort = default(string), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList), string translatedFqdn = default(string)) + + : base(name, description) { - IpProtocols = ipProtocols; - SourceAddresses = sourceAddresses; - DestinationAddresses = destinationAddresses; - DestinationPorts = destinationPorts; - TranslatedAddress = translatedAddress; - TranslatedPort = translatedPort; - SourceIpGroups = sourceIpGroups; - TranslatedFqdn = translatedFqdn; + this.IPProtocols = ipProtocols; + this.SourceAddresses = sourceAddresses; + this.DestinationAddresses = destinationAddresses; + this.DestinationPorts = destinationPorts; + this.TranslatedAddress = translatedAddress; + this.TranslatedPort = translatedPort; + this.SourceIPGroups = sourceIPGroups; + this.TranslatedFqdn = translatedFqdn; CustomInit(); } @@ -68,53 +74,53 @@ public NatRule() /// partial void CustomInit(); + /// /// Gets or sets array of FirewallPolicyRuleNetworkProtocols. /// - [JsonProperty(PropertyName = "ipProtocols")] - public IList IpProtocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipProtocols")] + public System.Collections.Generic.IList IPProtocols {get; set; } /// /// Gets or sets list of source IP addresses for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// /// Gets or sets list of destination IP addresses or Service Tags. /// - [JsonProperty(PropertyName = "destinationAddresses")] - public IList DestinationAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddresses")] + public System.Collections.Generic.IList DestinationAddresses {get; set; } /// /// Gets or sets list of destination ports. /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } /// /// Gets or sets the translated address for this NAT rule. /// - [JsonProperty(PropertyName = "translatedAddress")] - public string TranslatedAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "translatedAddress")] + public string TranslatedAddress {get; set; } /// /// Gets or sets the translated port for this NAT rule. /// - [JsonProperty(PropertyName = "translatedPort")] - public string TranslatedPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "translatedPort")] + public string TranslatedPort {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } /// /// Gets or sets the translated FQDN for this NAT rule. /// - [JsonProperty(PropertyName = "translatedFqdn")] - public string TranslatedFqdn { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "translatedFqdn")] + public string TranslatedFqdn {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NatRulePortMapping.cs b/src/Network/Network.Management.Sdk/Generated/Models/NatRulePortMapping.cs index 99d3268d82bb..5b2f3ee152dd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NatRulePortMapping.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NatRulePortMapping.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public NatRulePortMapping() /// /// Initializes a new instance of the NatRulePortMapping class. /// - /// Name of inbound NAT rule. - /// Frontend port. - /// Backend port. + + /// Name of inbound NAT rule. + /// + + /// Frontend port. + /// + + /// Backend port. + /// public NatRulePortMapping(string inboundNatRuleName = default(string), int? frontendPort = default(int?), int? backendPort = default(int?)) + { - InboundNatRuleName = inboundNatRuleName; - FrontendPort = frontendPort; - BackendPort = backendPort; + this.InboundNatRuleName = inboundNatRuleName; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; CustomInit(); } @@ -45,23 +46,23 @@ public NatRulePortMapping() /// partial void CustomInit(); + /// /// Gets or sets name of inbound NAT rule. /// - [JsonProperty(PropertyName = "inboundNatRuleName")] - public string InboundNatRuleName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRuleName")] + public string InboundNatRuleName {get; set; } /// /// Gets or sets frontend port. /// - [JsonProperty(PropertyName = "frontendPort")] - public int? FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public int? FrontendPort {get; set; } /// /// Gets or sets backend port. /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticParameters.cs index 81eedbc90729..81e48070f78b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticParameters.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkConfigurationDiagnosticParameters { /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticParameters class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticParameters class. /// public NetworkConfigurationDiagnosticParameters() { @@ -31,22 +21,25 @@ public NetworkConfigurationDiagnosticParameters() } /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticParameters class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticParameters class. /// - /// The ID of the target resource to - /// perform network configuration diagnostic. Valid options are VM, - /// NetworkInterface, VMSS/NetworkInterface and Application - /// Gateway. - /// List of network configuration diagnostic - /// profiles. - /// Verbosity level. Possible values - /// include: 'Normal', 'Minimum', 'Full' - public NetworkConfigurationDiagnosticParameters(string targetResourceId, IList profiles, string verbosityLevel = default(string)) + + /// The ID of the target resource to perform network configuration diagnostic. + /// Valid options are VM, NetworkInterface, VMSS/NetworkInterface and + /// Application Gateway. + /// + + /// Verbosity level. + /// Possible values include: 'Normal', 'Minimum', 'Full' + + /// List of network configuration diagnostic profiles. + /// + public NetworkConfigurationDiagnosticParameters(string targetResourceId, System.Collections.Generic.IList profiles, string verbosityLevel = default(string)) + { - TargetResourceId = targetResourceId; - VerbosityLevel = verbosityLevel; - Profiles = profiles; + this.TargetResourceId = targetResourceId; + this.VerbosityLevel = verbosityLevel; + this.Profiles = profiles; CustomInit(); } @@ -55,46 +48,47 @@ public NetworkConfigurationDiagnosticParameters() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the target resource to perform network - /// configuration diagnostic. Valid options are VM, NetworkInterface, - /// VMSS/NetworkInterface and Application Gateway. + /// Gets or sets the ID of the target resource to perform network configuration + /// diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface + /// and Application Gateway. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// - /// Gets or sets verbosity level. Possible values include: 'Normal', - /// 'Minimum', 'Full' + /// Gets or sets verbosity level. Possible values include: 'Normal', 'Minimum', 'Full' /// - [JsonProperty(PropertyName = "verbosityLevel")] - public string VerbosityLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "verbosityLevel")] + public string VerbosityLevel {get; set; } /// /// Gets or sets list of network configuration diagnostic profiles. /// - [JsonProperty(PropertyName = "profiles")] - public IList Profiles { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "profiles")] + public System.Collections.Generic.IList Profiles {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } - if (Profiles == null) + if (this.Profiles == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Profiles"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Profiles"); } - if (Profiles != null) + + + if (this.Profiles != null) { - foreach (var element in Profiles) + foreach (var element in this.Profiles) { if (element != null) { @@ -104,4 +98,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticProfile.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticProfile.cs index 490793c0d1c3..eb43e76de498 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticProfile.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticProfile.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkConfigurationDiagnosticProfile { /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticProfile class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticProfile class. /// public NetworkConfigurationDiagnosticProfile() { @@ -29,26 +21,33 @@ public NetworkConfigurationDiagnosticProfile() } /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticProfile class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticProfile class. /// - /// The direction of the traffic. Possible - /// values include: 'Inbound', 'Outbound' - /// Protocol to be verified on. Accepted values - /// are '*', TCP, UDP. - /// Traffic source. Accepted values are '*', IP - /// Address/CIDR, Service Tag. - /// Traffic destination. Accepted values are: - /// '*', IP Address/CIDR, Service Tag. - /// Traffic destination port. Accepted - /// values are '*' and a single port in the range (0 - 65535). + + /// The direction of the traffic. + /// Possible values include: 'Inbound', 'Outbound' + + /// Protocol to be verified on. Accepted values are '*', TCP, UDP. + /// + + /// Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + /// + + /// Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + /// Tag. + /// + + /// Traffic destination port. Accepted values are '*' and a single port in the + /// range (0 - 65535). + /// public NetworkConfigurationDiagnosticProfile(string direction, string protocol, string source, string destination, string destinationPort) + { - Direction = direction; - Protocol = protocol; - Source = source; - Destination = destination; - DestinationPort = destinationPort; + this.Direction = direction; + this.Protocol = protocol; + this.Source = source; + this.Destination = destination; + this.DestinationPort = destinationPort; CustomInit(); } @@ -57,69 +56,72 @@ public NetworkConfigurationDiagnosticProfile(string direction, string protocol, /// partial void CustomInit(); + /// - /// Gets or sets the direction of the traffic. Possible values include: - /// 'Inbound', 'Outbound' + /// Gets or sets the direction of the traffic. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "direction")] - public string Direction { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public string Direction {get; set; } /// - /// Gets or sets protocol to be verified on. Accepted values are '*', - /// TCP, UDP. + /// Gets or sets protocol to be verified on. Accepted values are '*', TCP, UDP. /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets traffic source. Accepted values are '*', IP - /// Address/CIDR, Service Tag. + /// Gets or sets traffic source. Accepted values are '*', IP Address/CIDR, + /// Service Tag. /// - [JsonProperty(PropertyName = "source")] - public string Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public string Source {get; set; } /// - /// Gets or sets traffic destination. Accepted values are: '*', IP + /// Gets or sets traffic destination. Accepted values are: '*', IP /// Address/CIDR, Service Tag. /// - [JsonProperty(PropertyName = "destination")] - public string Destination { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destination")] + public string Destination {get; set; } /// - /// Gets or sets traffic destination port. Accepted values are '*' and - /// a single port in the range (0 - 65535). + /// Gets or sets traffic destination port. Accepted values are '*' and a single + /// port in the range (0 - 65535). /// - [JsonProperty(PropertyName = "destinationPort")] - public string DestinationPort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPort")] + public string DestinationPort {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Direction == null) + if (this.Direction == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Direction"); } - if (Protocol == null) + if (this.Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } - if (Source == null) + if (this.Source == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Source"); } - if (Destination == null) + if (this.Destination == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Destination"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Destination"); } - if (DestinationPort == null) + if (this.DestinationPort == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationPort"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationPort"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResponse.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResponse.cs index d5e89021ba46..d39e8f431ca5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResponse.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResponse.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkConfigurationDiagnosticResponse { /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticResponse class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticResponse class. /// public NetworkConfigurationDiagnosticResponse() { @@ -30,14 +21,15 @@ public NetworkConfigurationDiagnosticResponse() } /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticResponse class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticResponse class. /// - /// List of network configuration diagnostic - /// results. - public NetworkConfigurationDiagnosticResponse(IList results = default(IList)) + + /// List of network configuration diagnostic results. + /// + public NetworkConfigurationDiagnosticResponse(System.Collections.Generic.IList results = default(System.Collections.Generic.IList)) + { - Results = results; + this.Results = results; CustomInit(); } @@ -46,11 +38,11 @@ public NetworkConfigurationDiagnosticResponse() /// partial void CustomInit(); + /// /// Gets list of network configuration diagnostic results. /// - [JsonProperty(PropertyName = "results")] - public IList Results { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "results")] + public System.Collections.Generic.IList Results {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResult.cs index 51c400d57487..750f0d30e8be 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkConfigurationDiagnosticResult.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Network configuration diagnostic result corresponded to provided - /// traffic query. + /// Network configuration diagnostic result corresponded to provided traffic + /// query. /// public partial class NetworkConfigurationDiagnosticResult { /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticResult class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticResult class. /// public NetworkConfigurationDiagnosticResult() { @@ -29,17 +22,19 @@ public NetworkConfigurationDiagnosticResult() } /// - /// Initializes a new instance of the - /// NetworkConfigurationDiagnosticResult class. + /// Initializes a new instance of the NetworkConfigurationDiagnosticResult class. /// - /// Network configuration diagnostic - /// profile. - /// Network security group - /// result. + + /// Network configuration diagnostic profile. + /// + + /// Network security group result. + /// public NetworkConfigurationDiagnosticResult(NetworkConfigurationDiagnosticProfile profile = default(NetworkConfigurationDiagnosticProfile), NetworkSecurityGroupResult networkSecurityGroupResult = default(NetworkSecurityGroupResult)) + { - Profile = profile; - NetworkSecurityGroupResult = networkSecurityGroupResult; + this.Profile = profile; + this.NetworkSecurityGroupResult = networkSecurityGroupResult; CustomInit(); } @@ -48,30 +43,31 @@ public NetworkConfigurationDiagnosticResult() /// partial void CustomInit(); + /// /// Gets or sets network configuration diagnostic profile. /// - [JsonProperty(PropertyName = "profile")] - public NetworkConfigurationDiagnosticProfile Profile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "profile")] + public NetworkConfigurationDiagnosticProfile Profile {get; set; } /// /// Gets or sets network security group result. /// - [JsonProperty(PropertyName = "networkSecurityGroupResult")] - public NetworkSecurityGroupResult NetworkSecurityGroupResult { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroupResult")] + public NetworkSecurityGroupResult NetworkSecurityGroupResult {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Profile != null) + if (this.Profile != null) { - Profile.Validate(); + this.Profile.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroup.cs index 25a7f4d9213c..9e09017a8f51 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroup.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The network group resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkGroup : ChildResource { /// @@ -32,27 +24,38 @@ public NetworkGroup() /// /// Initializes a new instance of the NetworkGroup class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A description of the network - /// group. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - /// The system metadata related to this - /// resource. - public NetworkGroup(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), string provisioningState = default(string), string resourceGuid = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the network group. + /// + + /// Unique identifier for this resource. + /// + public NetworkGroup(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), string resourceGuid = default(string)) + + : base(id, name, type, etag) { - Description = description; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; - SystemData = systemData; + this.SystemData = systemData; + this.ProvisioningState = provisioningState; + this.Description = description; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -61,31 +64,29 @@ public NetworkGroup() /// partial void CustomInit(); + /// - /// Gets or sets a description of the network group. + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets the provisioning state of the scope assignment resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the scope assignment resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets unique identifier for this resource. + /// Gets or sets a description of the network group. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets the system metadata related to this resource. + /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupProperties.cs new file mode 100644 index 000000000000..1c0e5a8304e2 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of network group + /// + public partial class NetworkGroupProperties + { + /// + /// Initializes a new instance of the NetworkGroupProperties class. + /// + public NetworkGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkGroupProperties class. + /// + + /// A description of the network group. + /// + + /// The provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Unique identifier for this resource. + /// + public NetworkGroupProperties(string description = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description of the network group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets the provisioning state of the scope assignment resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs index dde367cf19ed..b75e2ef2ff00 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class NetworkGroupsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// NetworkGroupsCreateOrUpdateHeaders class. + /// Initializes a new instance of the NetworkGroupsCreateOrUpdateHeaders class. /// public NetworkGroupsCreateOrUpdateHeaders() { @@ -28,13 +18,15 @@ public NetworkGroupsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// NetworkGroupsCreateOrUpdateHeaders class. + /// Initializes a new instance of the NetworkGroupsCreateOrUpdateHeaders class. /// - /// The current entity tag. + + /// + /// public NetworkGroupsCreateOrUpdateHeaders(string eTag = default(string)) + { - ETag = eTag; + this.ETag = eTag; CustomInit(); } @@ -43,11 +35,11 @@ public NetworkGroupsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the current entity tag. + /// Gets or sets /// - [JsonProperty(PropertyName = "ETag")] - public string ETag { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ETag")] + public string ETag {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsDeleteHeaders.cs index 56e717ef772f..5b1abfabc33d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkGroupsDeleteHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class NetworkGroupsDeleteHeaders { /// @@ -29,11 +20,13 @@ public NetworkGroupsDeleteHeaders() /// /// Initializes a new instance of the NetworkGroupsDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public NetworkGroupsDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,12 +35,11 @@ public NetworkGroupsDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicy.cs index 407537217232..6350438fc978 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicy.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,29 @@ public NetworkIntentPolicy() /// /// Initializes a new instance of the NetworkIntentPolicy class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkIntentPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + public NetworkIntentPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string)) + + : base(id, name, type, location, tags) { - Etag = etag; + this.Etag = etag; CustomInit(); } @@ -50,12 +54,12 @@ public NetworkIntentPolicy() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyBasedService.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyBasedService.cs index f22748f81972..b0f1b71cd1cf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyBasedService.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyBasedService.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NetworkIntentPolicyBasedService. /// + + public static class NetworkIntentPolicyBasedService { public const string None = "None"; public const string All = "All"; public const string AllowRulesOnly = "AllowRulesOnly"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyConfiguration.cs index ff2df2529f99..479c0a89e0ad 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkIntentPolicyConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkIntentPolicyConfiguration { /// - /// Initializes a new instance of the NetworkIntentPolicyConfiguration - /// class. + /// Initializes a new instance of the NetworkIntentPolicyConfiguration class. /// public NetworkIntentPolicyConfiguration() { @@ -29,17 +22,19 @@ public NetworkIntentPolicyConfiguration() } /// - /// Initializes a new instance of the NetworkIntentPolicyConfiguration - /// class. + /// Initializes a new instance of the NetworkIntentPolicyConfiguration class. /// - /// The name of the Network - /// Intent Policy for storing in target subscription. - /// Source network intent - /// policy. + + /// The name of the Network Intent Policy for storing in target subscription. + /// + + /// Source network intent policy. + /// public NetworkIntentPolicyConfiguration(string networkIntentPolicyName = default(string), NetworkIntentPolicy sourceNetworkIntentPolicy = default(NetworkIntentPolicy)) + { - NetworkIntentPolicyName = networkIntentPolicyName; - SourceNetworkIntentPolicy = sourceNetworkIntentPolicy; + this.NetworkIntentPolicyName = networkIntentPolicyName; + this.SourceNetworkIntentPolicy = sourceNetworkIntentPolicy; CustomInit(); } @@ -48,18 +43,18 @@ public NetworkIntentPolicyConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the name of the Network Intent Policy for storing in - /// target subscription. + /// Gets or sets the name of the Network Intent Policy for storing in target + /// subscription. /// - [JsonProperty(PropertyName = "networkIntentPolicyName")] - public string NetworkIntentPolicyName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkIntentPolicyName")] + public string NetworkIntentPolicyName {get; set; } /// /// Gets or sets source network intent policy. /// - [JsonProperty(PropertyName = "sourceNetworkIntentPolicy")] - public NetworkIntentPolicy SourceNetworkIntentPolicy { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceNetworkIntentPolicy")] + public NetworkIntentPolicy SourceNetworkIntentPolicy {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterface.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterface.cs index 70ff44fc1a1d..0464d92033a3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterface.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterface.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A network interface in a resource group. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkInterface : Resource { /// @@ -34,91 +24,125 @@ public NetworkInterface() /// /// Initializes a new instance of the NetworkInterface class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the network - /// interface. - /// The reference to a virtual - /// machine. - /// The reference to the - /// NetworkSecurityGroup resource. - /// A reference to the private endpoint - /// to which the network interface is linked. - /// A list of IPConfigurations of the - /// network interface. - /// A list of TapConfigurations of the - /// network interface. - /// The DNS settings in network - /// interface. - /// The MAC address of the network - /// interface. - /// Whether this is a primary network interface - /// on a virtual machine. - /// Whether the virtual machine - /// this nic is attached to supports encryption. - /// If the network interface - /// is configured for accelerated networking. Not applicable to VM - /// sizes which require accelerated networking. - /// Indicates whether to disable - /// tcp state tracking. - /// Indicates whether IP forwarding is - /// enabled on this network interface. - /// A list of references to linked - /// BareMetal resources. - /// A reference to the dscp - /// configuration to which the network interface is linked. - /// The resource GUID property of the - /// network interface resource. - /// The provisioning state of the - /// network interface resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// WorkloadType of the NetworkInterface for - /// BareMetal resources - /// Type of Network Interface resource. Possible - /// values include: 'Standard', 'Elastic' - /// Privatelinkservice of the network - /// interface resource. - /// Migration phase of Network Interface - /// resource. Possible values include: 'None', 'Prepare', 'Commit', - /// 'Abort', 'Committed' - /// Auxiliary mode of Network Interface - /// resource. Possible values include: 'None', 'MaxConnections', - /// 'Floating', 'AcceleratedConnections' - /// Auxiliary sku of Network Interface - /// resource. Possible values include: 'None', 'A1', 'A2', 'A4', - /// 'A8' - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), IList ipConfigurations = default(IList), IList tapConfigurations = default(IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? vnetEncryptionSupported = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableIPForwarding = default(bool?), IList hostedWorkloads = default(IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), string workloadType = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the network interface. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// A reference to the private endpoint to which the network interface is + /// linked. + /// + + /// The provisioning state of the network interface resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The reference to a virtual machine. + /// + + /// The reference to the NetworkSecurityGroup resource. + /// + + /// A list of IPConfigurations of the network interface. + /// + + /// A list of TapConfigurations of the network interface. + /// + + /// The DNS settings in network interface. + /// + + /// The MAC address of the network interface. + /// + + /// Whether this is a primary network interface on a virtual machine. + /// + + /// Whether the virtual machine this nic is attached to supports encryption. + /// + + /// If the network interface is configured for accelerated networking. Not + /// applicable to VM sizes which require accelerated networking. + /// + + /// Indicates whether to disable tcp state tracking. + /// + + /// Indicates whether IP forwarding is enabled on this network interface. + /// + + /// A list of references to linked BareMetal resources. + /// + + /// A reference to the dscp configuration to which the network interface is + /// linked. + /// + + /// The resource GUID property of the network interface resource. + /// + + /// WorkloadType of the NetworkInterface for BareMetal resources + /// + + /// Type of Network Interface resource. + /// Possible values include: 'Standard', 'Elastic' + + /// Privatelinkservice of the network interface resource. + /// + + /// Migration phase of Network Interface resource. + /// Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + + /// Auxiliary mode of Network Interface resource. + /// Possible values include: 'None', 'MaxConnections', 'Floating', + /// 'AcceleratedConnections' + + /// Auxiliary sku of Network Interface resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList tapConfigurations = default(System.Collections.Generic.IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? vnetEncryptionSupported = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableIPForwarding = default(bool?), System.Collections.Generic.IList hostedWorkloads = default(System.Collections.Generic.IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string workloadType = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - VirtualMachine = virtualMachine; - NetworkSecurityGroup = networkSecurityGroup; - PrivateEndpoint = privateEndpoint; - IpConfigurations = ipConfigurations; - TapConfigurations = tapConfigurations; - DnsSettings = dnsSettings; - MacAddress = macAddress; - Primary = primary; - VnetEncryptionSupported = vnetEncryptionSupported; - EnableAcceleratedNetworking = enableAcceleratedNetworking; - DisableTcpStateTracking = disableTcpStateTracking; - EnableIPForwarding = enableIPForwarding; - HostedWorkloads = hostedWorkloads; - DscpConfiguration = dscpConfiguration; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - WorkloadType = workloadType; - NicType = nicType; - PrivateLinkService = privateLinkService; - MigrationPhase = migrationPhase; - AuxiliaryMode = auxiliaryMode; - AuxiliarySku = auxiliarySku; - Etag = etag; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.PrivateEndpoint = privateEndpoint; + this.ProvisioningState = provisioningState; + this.VirtualMachine = virtualMachine; + this.NetworkSecurityGroup = networkSecurityGroup; + this.IPConfigurations = ipConfigurations; + this.TapConfigurations = tapConfigurations; + this.DnsSettings = dnsSettings; + this.MacAddress = macAddress; + this.Primary = primary; + this.VnetEncryptionSupported = vnetEncryptionSupported; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableIPForwarding = enableIPForwarding; + this.HostedWorkloads = hostedWorkloads; + this.DscpConfiguration = dscpConfiguration; + this.ResourceGuid = resourceGuid; + this.WorkloadType = workloadType; + this.NicType = nicType; + this.PrivateLinkService = privateLinkService; + this.MigrationPhase = migrationPhase; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; CustomInit(); } @@ -127,166 +151,156 @@ public NetworkInterface() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the network interface. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets the reference to a virtual machine. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.virtualMachine")] - public SubResource VirtualMachine { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the NetworkSecurityGroup resource. + /// Gets a reference to the private endpoint to which the network interface is + /// linked. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } + + /// + /// Gets the provisioning state of the network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] - public NetworkSecurityGroup NetworkSecurityGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a reference to the private endpoint to which the network - /// interface is linked. + /// Gets the reference to a virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachine")] + public SubResource VirtualMachine {get; private set; } + + /// + /// Gets or sets the reference to the NetworkSecurityGroup resource. /// - [JsonProperty(PropertyName = "properties.privateEndpoint")] - public PrivateEndpoint PrivateEndpoint { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + public NetworkSecurityGroup NetworkSecurityGroup {get; set; } /// /// Gets or sets a list of IPConfigurations of the network interface. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// /// Gets a list of TapConfigurations of the network interface. /// - [JsonProperty(PropertyName = "properties.tapConfigurations")] - public IList TapConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tapConfigurations")] + public System.Collections.Generic.IList TapConfigurations {get; private set; } /// /// Gets or sets the DNS settings in network interface. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public NetworkInterfaceDnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public NetworkInterfaceDnsSettings DnsSettings {get; set; } /// /// Gets the MAC address of the network interface. /// - [JsonProperty(PropertyName = "properties.macAddress")] - public string MacAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.macAddress")] + public string MacAddress {get; private set; } /// - /// Gets whether this is a primary network interface on a virtual - /// machine. + /// Gets whether this is a primary network interface on a virtual machine. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; private set; } /// /// Gets whether the virtual machine this nic is attached to supports /// encryption. /// - [JsonProperty(PropertyName = "properties.vnetEncryptionSupported")] - public bool? VnetEncryptionSupported { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vnetEncryptionSupported")] + public bool? VnetEncryptionSupported {get; private set; } /// /// Gets or sets if the network interface is configured for accelerated /// networking. Not applicable to VM sizes which require accelerated /// networking. /// - [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] - public bool? EnableAcceleratedNetworking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } /// /// Gets or sets indicates whether to disable tcp state tracking. /// - [JsonProperty(PropertyName = "properties.disableTcpStateTracking")] - public bool? DisableTcpStateTracking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } /// - /// Gets or sets indicates whether IP forwarding is enabled on this - /// network interface. + /// Gets or sets indicates whether IP forwarding is enabled on this network + /// interface. /// - [JsonProperty(PropertyName = "properties.enableIPForwarding")] - public bool? EnableIPForwarding { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } /// /// Gets a list of references to linked BareMetal resources. /// - [JsonProperty(PropertyName = "properties.hostedWorkloads")] - public IList HostedWorkloads { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostedWorkloads")] + public System.Collections.Generic.IList HostedWorkloads {get; private set; } /// - /// Gets a reference to the dscp configuration to which the network - /// interface is linked. + /// Gets a reference to the dscp configuration to which the network interface + /// is linked. /// - [JsonProperty(PropertyName = "properties.dscpConfiguration")] - public SubResource DscpConfiguration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dscpConfiguration")] + public SubResource DscpConfiguration {get; private set; } /// /// Gets the resource GUID property of the network interface resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - - /// - /// Gets the provisioning state of the network interface resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets workloadType of the NetworkInterface for BareMetal - /// resources + /// Gets or sets workloadType of the NetworkInterface for BareMetal resources /// - [JsonProperty(PropertyName = "properties.workloadType")] - public string WorkloadType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workloadType")] + public string WorkloadType {get; set; } /// - /// Gets or sets type of Network Interface resource. Possible values - /// include: 'Standard', 'Elastic' + /// Gets or sets type of Network Interface resource. Possible values include: 'Standard', 'Elastic' /// - [JsonProperty(PropertyName = "properties.nicType")] - public string NicType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nicType")] + public string NicType {get; set; } /// /// Gets or sets privatelinkservice of the network interface resource. /// - [JsonProperty(PropertyName = "properties.privateLinkService")] - public PrivateLinkService PrivateLinkService { get; set; } - - /// - /// Gets or sets migration phase of Network Interface resource. - /// Possible values include: 'None', 'Prepare', 'Commit', 'Abort', - /// 'Committed' - /// - [JsonProperty(PropertyName = "properties.migrationPhase")] - public string MigrationPhase { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkService")] + public PrivateLinkService PrivateLinkService {get; set; } /// - /// Gets or sets auxiliary mode of Network Interface resource. Possible - /// values include: 'None', 'MaxConnections', 'Floating', - /// 'AcceleratedConnections' + /// Gets or sets migration phase of Network Interface resource. Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' /// - [JsonProperty(PropertyName = "properties.auxiliaryMode")] - public string AuxiliaryMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.migrationPhase")] + public string MigrationPhase {get; set; } /// - /// Gets or sets auxiliary sku of Network Interface resource. Possible - /// values include: 'None', 'A1', 'A2', 'A4', 'A8' + /// Gets or sets auxiliary mode of Network Interface resource. Possible values include: 'None', 'MaxConnections', 'Floating', 'AcceleratedConnections' /// - [JsonProperty(PropertyName = "properties.auxiliarySku")] - public string AuxiliarySku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliaryMode")] + public string AuxiliaryMode {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets auxiliary sku of Network Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliarySku")] + public string AuxiliarySku {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAssociation.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAssociation.cs index 0833d18c5d1f..0fbec8866966 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAssociation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAssociation.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkInterfaceAssociation { /// - /// Initializes a new instance of the NetworkInterfaceAssociation - /// class. + /// Initializes a new instance of the NetworkInterfaceAssociation class. /// public NetworkInterfaceAssociation() { @@ -30,16 +21,19 @@ public NetworkInterfaceAssociation() } /// - /// Initializes a new instance of the NetworkInterfaceAssociation - /// class. + /// Initializes a new instance of the NetworkInterfaceAssociation class. /// - /// Network interface ID. - /// Collection of custom security - /// rules. - public NetworkInterfaceAssociation(string id = default(string), IList securityRules = default(IList)) + + /// Network interface ID. + /// + + /// Collection of custom security rules. + /// + public NetworkInterfaceAssociation(string id = default(string), System.Collections.Generic.IList securityRules = default(System.Collections.Generic.IList)) + { - Id = id; - SecurityRules = securityRules; + this.Id = id; + this.SecurityRules = securityRules; CustomInit(); } @@ -48,17 +42,17 @@ public NetworkInterfaceAssociation() /// partial void CustomInit(); + /// /// Gets network interface ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets collection of custom security rules. /// - [JsonProperty(PropertyName = "securityRules")] - public IList SecurityRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityRules")] + public System.Collections.Generic.IList SecurityRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs index 2da5df6ff7eb..617c7a095d98 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NetworkInterfaceAuxiliaryMode. /// + + public static class NetworkInterfaceAuxiliaryMode { public const string None = "None"; @@ -21,4 +18,4 @@ public static class NetworkInterfaceAuxiliaryMode public const string Floating = "Floating"; public const string AcceleratedConnections = "AcceleratedConnections"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs index 8758a6534c78..b41d0570ffc0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NetworkInterfaceAuxiliarySku. /// + + public static class NetworkInterfaceAuxiliarySku { public const string None = "None"; @@ -22,4 +19,4 @@ public static class NetworkInterfaceAuxiliarySku public const string A4 = "A4"; public const string A8 = "A8"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceDnsSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceDnsSettings.cs index cc4ca58f849a..f5884ae80b57 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceDnsSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceDnsSettings.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkInterfaceDnsSettings { /// - /// Initializes a new instance of the NetworkInterfaceDnsSettings - /// class. + /// Initializes a new instance of the NetworkInterfaceDnsSettings class. /// public NetworkInterfaceDnsSettings() { @@ -30,35 +21,39 @@ public NetworkInterfaceDnsSettings() } /// - /// Initializes a new instance of the NetworkInterfaceDnsSettings - /// class. + /// Initializes a new instance of the NetworkInterfaceDnsSettings class. /// - /// 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. - /// 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. - /// Relative DNS name for this NIC - /// used for internal communications between VMs in the same virtual - /// network. - /// Fully qualified DNS name supporting - /// internal communications between VMs in the same virtual - /// network. - /// 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. - public NetworkInterfaceDnsSettings(IList dnsServers = default(IList), IList appliedDnsServers = default(IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) + + /// 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. + /// + + /// 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. + /// + + /// Relative DNS name for this NIC used for internal communications between VMs + /// in the same virtual network. + /// + + /// Fully qualified DNS name supporting internal communications between VMs in + /// the same virtual network. + /// + + /// 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. + /// + public NetworkInterfaceDnsSettings(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList), System.Collections.Generic.IList appliedDnsServers = default(System.Collections.Generic.IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) + { - DnsServers = dnsServers; - AppliedDnsServers = appliedDnsServers; - InternalDnsNameLabel = internalDnsNameLabel; - InternalFqdn = internalFqdn; - InternalDomainNameSuffix = internalDomainNameSuffix; + this.DnsServers = dnsServers; + this.AppliedDnsServers = appliedDnsServers; + this.InternalDnsNameLabel = internalDnsNameLabel; + this.InternalFqdn = internalFqdn; + this.InternalDomainNameSuffix = internalDomainNameSuffix; CustomInit(); } @@ -67,46 +62,45 @@ public NetworkInterfaceDnsSettings() /// partial void CustomInit(); + /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "dnsServers")] - public IList DnsServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] + public System.Collections.Generic.IList DnsServers {get; set; } /// - /// Gets 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. + /// Gets 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. /// - [JsonProperty(PropertyName = "appliedDnsServers")] - public IList AppliedDnsServers { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "appliedDnsServers")] + public System.Collections.Generic.IList AppliedDnsServers {get; private set; } /// /// Gets or sets relative DNS name for this NIC used for internal /// communications between VMs in the same virtual network. /// - [JsonProperty(PropertyName = "internalDnsNameLabel")] - public string InternalDnsNameLabel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "internalDnsNameLabel")] + public string InternalDnsNameLabel {get; set; } /// - /// Gets fully qualified DNS name supporting internal communications - /// between VMs in the same virtual network. + /// Gets fully qualified DNS name supporting internal communications between + /// VMs in the same virtual network. /// - [JsonProperty(PropertyName = "internalFqdn")] - public string InternalFqdn { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "internalFqdn")] + public string InternalFqdn {get; private set; } /// - /// Gets 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. + /// Gets 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. /// - [JsonProperty(PropertyName = "internalDomainNameSuffix")] - public string InternalDomainNameSuffix { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "internalDomainNameSuffix")] + public string InternalDomainNameSuffix {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfiguration.cs index 80fbd5539228..b4b0dfe046a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// IPConfiguration in a network interface. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkInterfaceIPConfiguration : SubResource { /// - /// Initializes a new instance of the NetworkInterfaceIPConfiguration - /// class. + /// Initializes a new instance of the NetworkInterfaceIPConfiguration class. /// public NetworkInterfaceIPConfiguration() { @@ -33,66 +22,84 @@ public NetworkInterfaceIPConfiguration() } /// - /// Initializes a new instance of the NetworkInterfaceIPConfiguration - /// class. - /// - /// Resource ID. - /// The reference to gateway load - /// balancer frontend IP. - /// The reference to Virtual Network - /// Taps. - /// The reference - /// to ApplicationGatewayBackendAddressPool resource. - /// The reference to - /// LoadBalancerBackendAddressPool resource. - /// A list of references of - /// LoadBalancerInboundNatRules. - /// Private IP address of the IP - /// configuration. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// Whether the specific IP - /// configuration is IPv4 or IPv6. Default is IPv4. Possible values - /// include: 'IPv4', 'IPv6' - /// Subnet bound to the IP configuration. - /// Whether this is a primary customer address on - /// the network interface. - /// Public IP address bound to the IP - /// configuration. - /// Application security groups - /// in which the IP configuration is included. - /// The provisioning state of the - /// network interface IP configuration. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// PrivateLinkConnection - /// properties for the network interface. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public NetworkInterfaceIPConfiguration(string id = default(string), SubResource gatewayLoadBalancer = default(SubResource), IList virtualNetworkTaps = default(IList), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), IList applicationSecurityGroups = default(IList), string provisioningState = default(string), NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Initializes a new instance of the NetworkInterfaceIPConfiguration class. + /// + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// Subnet bound to the IP configuration. + /// + + /// The provisioning state of the network interface IP configuration. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The reference to gateway load balancer frontend IP. + /// + + /// The reference to Virtual Network Taps. + /// + + /// The reference to ApplicationGatewayBackendAddressPool resource. + /// + + /// The reference to LoadBalancerBackendAddressPool resource. + /// + + /// A list of references of LoadBalancerInboundNatRules. + /// + + /// Private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + /// Possible values include: 'IPv4', 'IPv6' + + /// Whether this is a primary customer address on the network interface. + /// + + /// Public IP address bound to the IP configuration. + /// + + /// Application security groups in which the IP configuration is included. + /// + + /// PrivateLinkConnection properties for the network interface. + /// + public NetworkInterfaceIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string), SubResource gatewayLoadBalancer = default(SubResource), System.Collections.Generic.IList virtualNetworkTaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties)) + + : base(id) { - GatewayLoadBalancer = gatewayLoadBalancer; - VirtualNetworkTaps = virtualNetworkTaps; - ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; - LoadBalancerInboundNatRules = loadBalancerInboundNatRules; - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - PrivateIPAddressVersion = privateIPAddressVersion; - Subnet = subnet; - Primary = primary; - PublicIPAddress = publicIPAddress; - ApplicationSecurityGroups = applicationSecurityGroups; - ProvisioningState = provisioningState; - PrivateLinkConnectionProperties = privateLinkConnectionProperties; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + this.GatewayLoadBalancer = gatewayLoadBalancer; + this.VirtualNetworkTaps = virtualNetworkTaps; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.LoadBalancerInboundNatRules = loadBalancerInboundNatRules; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.Primary = primary; + this.PublicIPAddress = publicIPAddress; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.PrivateLinkConnectionProperties = privateLinkConnectionProperties; CustomInit(); } @@ -101,117 +108,113 @@ public NetworkInterfaceIPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the reference to gateway load balancer frontend IP. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] - public SubResource GatewayLoadBalancer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the reference to Virtual Network Taps. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.virtualNetworkTaps")] - public IList VirtualNetworkTaps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to ApplicationGatewayBackendAddressPool - /// resource. + /// Gets or sets resource type. /// - [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] - public IList ApplicationGatewayBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets the reference to LoadBalancerBackendAddressPool - /// resource. + /// Gets or sets subnet bound to the IP configuration. /// - [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] - public IList LoadBalancerBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets or sets a list of references of LoadBalancerInboundNatRules. + /// Gets the provisioning state of the network interface IP configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] - public IList LoadBalancerInboundNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets private IP address of the IP configuration. + /// Gets or sets the reference to gateway load balancer frontend IP. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] + public SubResource GatewayLoadBalancer {get; set; } /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets or sets the reference to Virtual Network Taps. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkTaps")] + public System.Collections.Generic.IList VirtualNetworkTaps {get; set; } /// - /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. - /// Default is IPv4. Possible values include: 'IPv4', 'IPv6' + /// Gets or sets the reference to ApplicationGatewayBackendAddressPool + /// resource. /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] - public string PrivateIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } /// - /// Gets or sets subnet bound to the IP configuration. + /// Gets or sets the reference to LoadBalancerBackendAddressPool resource. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } /// - /// Gets or sets whether this is a primary customer address on the - /// network interface. + /// Gets or sets a list of references of LoadBalancerInboundNatRules. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] + public System.Collections.Generic.IList LoadBalancerInboundNatRules {get; set; } /// - /// Gets or sets public IP address bound to the IP configuration. + /// Gets or sets private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public PublicIPAddress PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets or sets application security groups in which the IP - /// configuration is included. + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.applicationSecurityGroups")] - public IList ApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets the provisioning state of the network interface IP - /// configuration. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. Default + /// is IPv4. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } /// - /// Gets privateLinkConnection properties for the network interface. + /// Gets or sets whether this is a primary customer address on the network + /// interface. /// - [JsonProperty(PropertyName = "properties.privateLinkConnectionProperties")] - public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties PrivateLinkConnectionProperties { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets public IP address bound to the IP configuration. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets application security groups in which the IP configuration is + /// included. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } /// - /// Gets or sets resource type. + /// Gets privateLinkConnection properties for the network interface. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkConnectionProperties")] + public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties PrivateLinkConnectionProperties {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties.cs index c114df66664c..a6897bf13693 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,9 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties { /// - /// Initializes a new instance of the - /// NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties - /// class. + /// Initializes a new instance of the NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties class. /// public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties() { @@ -31,21 +21,23 @@ public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties() } /// - /// Initializes a new instance of the - /// NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties - /// class. + /// Initializes a new instance of the NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties class. /// - /// The group ID for current private link - /// connection. - /// The required member name for - /// current private link connection. - /// List of FQDNs for current private link - /// connection. - public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(string groupId = default(string), string requiredMemberName = default(string), IList fqdns = default(IList)) + + /// The group ID for current private link connection. + /// + + /// The required member name for current private link connection. + /// + + /// List of FQDNs for current private link connection. + /// + public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(string groupId = default(string), string requiredMemberName = default(string), System.Collections.Generic.IList fqdns = default(System.Collections.Generic.IList)) + { - GroupId = groupId; - RequiredMemberName = requiredMemberName; - Fqdns = fqdns; + this.GroupId = groupId; + this.RequiredMemberName = requiredMemberName; + this.Fqdns = fqdns; CustomInit(); } @@ -54,23 +46,23 @@ public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties() /// partial void CustomInit(); + /// /// Gets the group ID for current private link connection. /// - [JsonProperty(PropertyName = "groupId")] - public string GroupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupId")] + public string GroupId {get; private set; } /// /// Gets the required member name for current private link connection. /// - [JsonProperty(PropertyName = "requiredMemberName")] - public string RequiredMemberName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requiredMemberName")] + public string RequiredMemberName {get; private set; } /// /// Gets list of FQDNs for current private link connection. /// - [JsonProperty(PropertyName = "fqdns")] - public IList Fqdns { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdns")] + public System.Collections.Generic.IList Fqdns {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..57f81cf970e4 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceIPConfigurationPropertiesFormat.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of IP configuration. + /// + public partial class NetworkInterfaceIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the NetworkInterfaceIPConfigurationPropertiesFormat class. + /// + public NetworkInterfaceIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkInterfaceIPConfigurationPropertiesFormat class. + /// + + /// The reference to gateway load balancer frontend IP. + /// + + /// The reference to Virtual Network Taps. + /// + + /// The reference to ApplicationGatewayBackendAddressPool resource. + /// + + /// The reference to LoadBalancerBackendAddressPool resource. + /// + + /// A list of references of LoadBalancerInboundNatRules. + /// + + /// Private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + /// Possible values include: 'IPv4', 'IPv6' + + /// Subnet bound to the IP configuration. + /// + + /// Whether this is a primary customer address on the network interface. + /// + + /// Public IP address bound to the IP configuration. + /// + + /// Application security groups in which the IP configuration is included. + /// + + /// The provisioning state of the network interface IP configuration. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// PrivateLinkConnection properties for the network interface. + /// + public NetworkInterfaceIPConfigurationPropertiesFormat(SubResource gatewayLoadBalancer = default(SubResource), System.Collections.Generic.IList virtualNetworkTaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), string provisioningState = default(string), NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties)) + + { + this.GatewayLoadBalancer = gatewayLoadBalancer; + this.VirtualNetworkTaps = virtualNetworkTaps; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.LoadBalancerInboundNatRules = loadBalancerInboundNatRules; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddress = publicIPAddress; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.ProvisioningState = provisioningState; + this.PrivateLinkConnectionProperties = privateLinkConnectionProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the reference to gateway load balancer frontend IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayLoadBalancer")] + public SubResource GatewayLoadBalancer {get; set; } + + /// + /// Gets or sets the reference to Virtual Network Taps. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkTaps")] + public System.Collections.Generic.IList VirtualNetworkTaps {get; set; } + + /// + /// Gets or sets the reference to ApplicationGatewayBackendAddressPool + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } + + /// + /// Gets or sets the reference to LoadBalancerBackendAddressPool resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } + + /// + /// Gets or sets a list of references of LoadBalancerInboundNatRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerInboundNatRules")] + public System.Collections.Generic.IList LoadBalancerInboundNatRules {get; set; } + + /// + /// Gets or sets private IP address of the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. Default + /// is IPv4. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } + + /// + /// Gets or sets subnet bound to the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets or sets whether this is a primary customer address on the network + /// interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets public IP address bound to the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public PublicIPAddress PublicIPAddress {get; set; } + + /// + /// Gets or sets application security groups in which the IP configuration is + /// included. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } + + /// + /// Gets the provisioning state of the network interface IP configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets privateLinkConnection properties for the network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkConnectionProperties")] + public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties PrivateLinkConnectionProperties {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceMigrationPhase.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceMigrationPhase.cs index 8f4f991c4775..266d15273a6f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceMigrationPhase.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceMigrationPhase.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NetworkInterfaceMigrationPhase. /// + + public static class NetworkInterfaceMigrationPhase { public const string None = "None"; @@ -22,4 +19,4 @@ public static class NetworkInterfaceMigrationPhase public const string Abort = "Abort"; public const string Committed = "Committed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceNicType.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceNicType.cs index 0fc5b43dec79..dc331dbd087a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceNicType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceNicType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NetworkInterfaceNicType. /// + + public static class NetworkInterfaceNicType { public const string Standard = "Standard"; public const string Elastic = "Elastic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFormat.cs new file mode 100644 index 000000000000..ed8b21a7e6a3 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFormat.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// NetworkInterface properties. + /// + public partial class NetworkInterfacePropertiesFormat + { + /// + /// Initializes a new instance of the NetworkInterfacePropertiesFormat class. + /// + public NetworkInterfacePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkInterfacePropertiesFormat class. + /// + + /// The reference to a virtual machine. + /// + + /// The reference to the NetworkSecurityGroup resource. + /// + + /// A reference to the private endpoint to which the network interface is + /// linked. + /// + + /// A list of IPConfigurations of the network interface. + /// + + /// A list of TapConfigurations of the network interface. + /// + + /// The DNS settings in network interface. + /// + + /// The MAC address of the network interface. + /// + + /// Whether this is a primary network interface on a virtual machine. + /// + + /// Whether the virtual machine this nic is attached to supports encryption. + /// + + /// If the network interface is configured for accelerated networking. Not + /// applicable to VM sizes which require accelerated networking. + /// + + /// Indicates whether to disable tcp state tracking. + /// + + /// Indicates whether IP forwarding is enabled on this network interface. + /// + + /// A list of references to linked BareMetal resources. + /// + + /// A reference to the dscp configuration to which the network interface is + /// linked. + /// + + /// The resource GUID property of the network interface resource. + /// + + /// The provisioning state of the network interface resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// WorkloadType of the NetworkInterface for BareMetal resources + /// + + /// Type of Network Interface resource. + /// Possible values include: 'Standard', 'Elastic' + + /// Privatelinkservice of the network interface resource. + /// + + /// Migration phase of Network Interface resource. + /// Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + + /// Auxiliary mode of Network Interface resource. + /// Possible values include: 'None', 'MaxConnections', 'Floating', + /// 'AcceleratedConnections' + + /// Auxiliary sku of Network Interface resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public NetworkInterfacePropertiesFormat(SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList tapConfigurations = default(System.Collections.Generic.IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? vnetEncryptionSupported = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableIPForwarding = default(bool?), System.Collections.Generic.IList hostedWorkloads = default(System.Collections.Generic.IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), string workloadType = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + + { + this.VirtualMachine = virtualMachine; + this.NetworkSecurityGroup = networkSecurityGroup; + this.PrivateEndpoint = privateEndpoint; + this.IPConfigurations = ipConfigurations; + this.TapConfigurations = tapConfigurations; + this.DnsSettings = dnsSettings; + this.MacAddress = macAddress; + this.Primary = primary; + this.VnetEncryptionSupported = vnetEncryptionSupported; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableIPForwarding = enableIPForwarding; + this.HostedWorkloads = hostedWorkloads; + this.DscpConfiguration = dscpConfiguration; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.WorkloadType = workloadType; + this.NicType = nicType; + this.PrivateLinkService = privateLinkService; + this.MigrationPhase = migrationPhase; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the reference to a virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachine")] + public SubResource VirtualMachine {get; private set; } + + /// + /// Gets or sets the reference to the NetworkSecurityGroup resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + public NetworkSecurityGroup NetworkSecurityGroup {get; set; } + + /// + /// Gets a reference to the private endpoint to which the network interface is + /// linked. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } + + /// + /// Gets or sets a list of IPConfigurations of the network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets a list of TapConfigurations of the network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tapConfigurations")] + public System.Collections.Generic.IList TapConfigurations {get; private set; } + + /// + /// Gets or sets the DNS settings in network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public NetworkInterfaceDnsSettings DnsSettings {get; set; } + + /// + /// Gets the MAC address of the network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "macAddress")] + public string MacAddress {get; private set; } + + /// + /// Gets whether this is a primary network interface on a virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; private set; } + + /// + /// Gets whether the virtual machine this nic is attached to supports + /// encryption. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vnetEncryptionSupported")] + public bool? VnetEncryptionSupported {get; private set; } + + /// + /// Gets or sets if the network interface is configured for accelerated + /// networking. Not applicable to VM sizes which require accelerated + /// networking. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } + + /// + /// Gets or sets indicates whether to disable tcp state tracking. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } + + /// + /// Gets or sets indicates whether IP forwarding is enabled on this network + /// interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } + + /// + /// Gets a list of references to linked BareMetal resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostedWorkloads")] + public System.Collections.Generic.IList HostedWorkloads {get; private set; } + + /// + /// Gets a reference to the dscp configuration to which the network interface + /// is linked. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dscpConfiguration")] + public SubResource DscpConfiguration {get; private set; } + + /// + /// Gets the resource GUID property of the network interface resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets workloadType of the NetworkInterface for BareMetal resources + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "workloadType")] + public string WorkloadType {get; set; } + + /// + /// Gets or sets type of Network Interface resource. Possible values include: 'Standard', 'Elastic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nicType")] + public string NicType {get; set; } + + /// + /// Gets or sets privatelinkservice of the network interface resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkService")] + public PrivateLinkService PrivateLinkService {get; set; } + + /// + /// Gets or sets migration phase of Network Interface resource. Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "migrationPhase")] + public string MigrationPhase {get; set; } + + /// + /// Gets or sets auxiliary mode of Network Interface resource. Possible values include: 'None', 'MaxConnections', 'Floating', 'AcceleratedConnections' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliaryMode")] + public string AuxiliaryMode {get; set; } + + /// + /// Gets or sets auxiliary sku of Network Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliarySku")] + public string AuxiliarySku {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfiguration.cs index 7be020d7ccf3..625eff7a109c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Tap configuration in a Network Interface. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkInterfaceTapConfiguration : SubResource { /// - /// Initializes a new instance of the NetworkInterfaceTapConfiguration - /// class. + /// Initializes a new instance of the NetworkInterfaceTapConfiguration class. /// public NetworkInterfaceTapConfiguration() { @@ -31,29 +22,36 @@ public NetworkInterfaceTapConfiguration() } /// - /// Initializes a new instance of the NetworkInterfaceTapConfiguration - /// class. + /// Initializes a new instance of the NetworkInterfaceTapConfiguration class. /// - /// Resource ID. - /// The reference to the Virtual - /// Network Tap resource. - /// The provisioning state of the - /// network interface tap configuration resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Sub Resource type. - public NetworkInterfaceTapConfiguration(string id = default(string), VirtualNetworkTap virtualNetworkTap = default(VirtualNetworkTap), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Sub Resource type. + /// + + /// The provisioning state of the network interface tap configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The reference to the Virtual Network Tap resource. + /// + public NetworkInterfaceTapConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), VirtualNetworkTap virtualNetworkTap = default(VirtualNetworkTap)) + + : base(id) { - VirtualNetworkTap = virtualNetworkTap; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.VirtualNetworkTap = virtualNetworkTap; CustomInit(); } @@ -62,39 +60,38 @@ public NetworkInterfaceTapConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the reference to the Virtual Network Tap resource. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.virtualNetworkTap")] - public VirtualNetworkTap VirtualNetworkTap { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the network interface tap - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets sub Resource type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the network interface tap configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets sub Resource type. + /// Gets or sets the reference to the Virtual Network Tap resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkTap")] + public VirtualNetworkTap VirtualNetworkTap {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..10c65ff90b88 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkInterfaceTapConfigurationPropertiesFormat.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Virtual Network Tap configuration. + /// + public partial class NetworkInterfaceTapConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the NetworkInterfaceTapConfigurationPropertiesFormat class. + /// + public NetworkInterfaceTapConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkInterfaceTapConfigurationPropertiesFormat class. + /// + + /// The reference to the Virtual Network Tap resource. + /// + + /// The provisioning state of the network interface tap configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public NetworkInterfaceTapConfigurationPropertiesFormat(VirtualNetworkTap virtualNetworkTap = default(VirtualNetworkTap), string provisioningState = default(string)) + + { + this.VirtualNetworkTap = virtualNetworkTap; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the reference to the Virtual Network Tap resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkTap")] + public VirtualNetworkTap VirtualNetworkTap {get; set; } + + /// + /// Gets the provisioning state of the network interface tap configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManager.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManager.cs index dd79f65c633b..316e6b74956b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManager.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManager.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The Managed Network resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkManager : Resource { /// @@ -34,35 +24,53 @@ public NetworkManager() /// /// Initializes a new instance of the NetworkManager class. /// - /// Scope of Network - /// Manager. - /// Scope Access. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A description of the network - /// manager. - /// The provisioning state of the - /// network manager resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The system metadata related to this - /// resource. - public NetworkManager(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes, IList networkManagerScopeAccesses, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string provisioningState = default(string), string resourceGuid = default(string), string etag = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the network manager resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the network manager. + /// + + /// Scope of Network Manager. + /// + + /// Scope Access. + /// + + /// Unique identifier for this resource. + /// + public NetworkManager(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes = default(NetworkManagerPropertiesNetworkManagerScopes), System.Collections.Generic.IList networkManagerScopeAccesses = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - Description = description; - NetworkManagerScopes = networkManagerScopes; - NetworkManagerScopeAccesses = networkManagerScopeAccesses; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; - Etag = etag; - SystemData = systemData; + this.Etag = etag; + this.SystemData = systemData; + this.ProvisioningState = provisioningState; + this.Description = description; + this.NetworkManagerScopes = networkManagerScopes; + this.NetworkManagerScopeAccesses = networkManagerScopeAccesses; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -71,67 +79,48 @@ public NetworkManager() /// partial void CustomInit(); - /// - /// Gets or sets a description of the network manager. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } /// - /// Gets or sets scope of Network Manager. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.networkManagerScopes")] - public NetworkManagerPropertiesNetworkManagerScopes NetworkManagerScopes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets scope Access. + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.networkManagerScopeAccesses")] - public IList NetworkManagerScopeAccesses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets the provisioning state of the network manager resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the network manager resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets unique identifier for this resource. + /// Gets or sets a description of the network manager. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets scope of Network Manager. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkManagerScopes")] + public NetworkManagerPropertiesNetworkManagerScopes NetworkManagerScopes {get; set; } /// - /// Gets the system metadata related to this resource. + /// Gets or sets scope Access. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkManagerScopeAccesses")] + public System.Collections.Generic.IList NetworkManagerScopeAccesses {get; set; } /// - /// Validate the object. + /// Gets unique identifier for this resource. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (NetworkManagerScopes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "NetworkManagerScopes"); - } - if (NetworkManagerScopeAccesses == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "NetworkManagerScopeAccesses"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommit.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommit.cs index ec16e6e13647..39590e23f6ed 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommit.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommit.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,17 +23,25 @@ public NetworkManagerCommit() /// /// Initializes a new instance of the NetworkManagerCommit class. /// - /// List of target locations. - /// Commit Type. Possible values include: - /// 'SecurityAdmin', 'Connectivity' - /// Commit Id. - /// List of configuration ids. - public NetworkManagerCommit(IList targetLocations, string commitType, string commitId = default(string), IList configurationIds = default(IList)) + + /// Commit Id. + /// + + /// List of target locations. + /// + + /// List of configuration ids. + /// + + /// Commit Type. + /// Possible values include: 'SecurityAdmin', 'Connectivity' + public NetworkManagerCommit(System.Collections.Generic.IList targetLocations, string commitType, string commitId = default(string), System.Collections.Generic.IList configurationIds = default(System.Collections.Generic.IList)) + { - CommitId = commitId; - TargetLocations = targetLocations; - ConfigurationIds = configurationIds; - CommitType = commitType; + this.CommitId = commitId; + this.TargetLocations = targetLocations; + this.ConfigurationIds = configurationIds; + this.CommitType = commitType; CustomInit(); } @@ -51,47 +50,50 @@ public NetworkManagerCommit() /// partial void CustomInit(); + /// /// Gets commit Id. /// - [JsonProperty(PropertyName = "commitId")] - public string CommitId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "commitId")] + public string CommitId {get; private set; } /// /// Gets or sets list of target locations. /// - [JsonProperty(PropertyName = "targetLocations")] - public IList TargetLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetLocations")] + public System.Collections.Generic.IList TargetLocations {get; set; } /// /// Gets or sets list of configuration ids. /// - [JsonProperty(PropertyName = "configurationIds")] - public IList ConfigurationIds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationIds")] + public System.Collections.Generic.IList ConfigurationIds {get; set; } /// - /// Gets or sets commit Type. Possible values include: 'SecurityAdmin', - /// 'Connectivity' + /// Gets or sets commit Type. Possible values include: 'SecurityAdmin', 'Connectivity' /// - [JsonProperty(PropertyName = "commitType")] - public string CommitType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "commitType")] + public string CommitType {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetLocations == null) + if (this.TargetLocations == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetLocations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetLocations"); } - if (CommitType == null) + if (this.CommitType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CommitType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommitType"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommitsPostHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommitsPostHeaders.cs index 26f7c224c836..056cb2d55ac8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommitsPostHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerCommitsPostHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Post operation. - /// public partial class NetworkManagerCommitsPostHeaders { /// - /// Initializes a new instance of the NetworkManagerCommitsPostHeaders - /// class. + /// Initializes a new instance of the NetworkManagerCommitsPostHeaders class. /// public NetworkManagerCommitsPostHeaders() { @@ -28,14 +18,15 @@ public NetworkManagerCommitsPostHeaders() } /// - /// Initializes a new instance of the NetworkManagerCommitsPostHeaders - /// class. + /// Initializes a new instance of the NetworkManagerCommitsPostHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public NetworkManagerCommitsPostHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public NetworkManagerCommitsPostHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnection.cs index c2b251c44fe4..668e04170bc1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnection.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The Network Manager Connection resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkManagerConnection : ChildResource { /// @@ -32,26 +24,39 @@ public NetworkManagerConnection() /// /// Initializes a new instance of the NetworkManagerConnection class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Network Manager Id. - /// Connection state. Possible values - /// include: 'Connected', 'Pending', 'Conflict', 'Revoked', - /// 'Rejected' - /// A description of the network manager - /// connection. - /// The system metadata related to this - /// resource. - public NetworkManagerConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string networkManagerId = default(string), string connectionState = default(string), string description = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// Network Manager Id. + /// + + /// Connection state. + /// Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', + /// 'Rejected' + + /// A description of the network manager connection. + /// + public NetworkManagerConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string networkManagerId = default(string), string connectionState = default(string), string description = default(string)) + + : base(id, name, type, etag) { - NetworkManagerId = networkManagerId; - ConnectionState = connectionState; - Description = description; - SystemData = systemData; + this.SystemData = systemData; + this.NetworkManagerId = networkManagerId; + this.ConnectionState = connectionState; + this.Description = description; CustomInit(); } @@ -60,30 +65,29 @@ public NetworkManagerConnection() /// partial void CustomInit(); + /// - /// Gets or sets network Manager Id. + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.networkManagerId")] - public string NetworkManagerId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets or sets connection state. Possible values include: - /// 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' + /// Gets or sets network Manager Id. /// - [JsonProperty(PropertyName = "properties.connectionState")] - public string ConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkManagerId")] + public string NetworkManagerId {get; set; } /// - /// Gets or sets a description of the network manager connection. + /// Gets connection state. Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionState")] + public string ConnectionState {get; private set; } /// - /// Gets the system metadata related to this resource. + /// Gets or sets a description of the network manager connection. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnectionProperties.cs new file mode 100644 index 000000000000..40eef63e44f6 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerConnectionProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Information about the network manager connection. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class NetworkManagerConnectionProperties + { + /// + /// Initializes a new instance of the NetworkManagerConnectionProperties class. + /// + public NetworkManagerConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerConnectionProperties class. + /// + + /// Network Manager Id. + /// + + /// Connection state. + /// Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', + /// 'Rejected' + + /// A description of the network manager connection. + /// + public NetworkManagerConnectionProperties(string networkManagerId = default(string), string connectionState = default(string), string description = default(string)) + + { + this.NetworkManagerId = networkManagerId; + this.ConnectionState = connectionState; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets network Manager Id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkManagerId")] + public string NetworkManagerId {get; set; } + + /// + /// Gets connection state. Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionState")] + public string ConnectionState {get; private set; } + + /// + /// Gets or sets a description of the network manager connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatus.cs index 4ad48dbcba50..20f4532b11be 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatus.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkManagerDeploymentStatus { /// - /// Initializes a new instance of the NetworkManagerDeploymentStatus - /// class. + /// Initializes a new instance of the NetworkManagerDeploymentStatus class. /// public NetworkManagerDeploymentStatus() { @@ -30,25 +21,35 @@ public NetworkManagerDeploymentStatus() } /// - /// Initializes a new instance of the NetworkManagerDeploymentStatus - /// class. + /// Initializes a new instance of the NetworkManagerDeploymentStatus class. /// - /// Commit Time. - /// Region Name. - /// Deployment Status. Possible values - /// include: 'NotStarted', 'Deploying', 'Deployed', 'Failed' - /// List of configuration ids. - /// Possible values include: - /// 'SecurityAdmin', 'Connectivity' - /// Error Message. - public NetworkManagerDeploymentStatus(System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string deploymentStatus = default(string), IList configurationIds = default(IList), string deploymentType = default(string), string errorMessage = default(string)) + + /// Commit Time. + /// + + /// Region Name. + /// + + /// Deployment Status. + /// Possible values include: 'NotStarted', 'Deploying', 'Deployed', 'Failed' + + /// List of configuration ids. + /// + + /// Configuration Deployment Type. + /// Possible values include: 'SecurityAdmin', 'Connectivity' + + /// Error Message. + /// + public NetworkManagerDeploymentStatus(System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string deploymentStatus = default(string), System.Collections.Generic.IList configurationIds = default(System.Collections.Generic.IList), string deploymentType = default(string), string errorMessage = default(string)) + { - CommitTime = commitTime; - Region = region; - DeploymentStatus = deploymentStatus; - ConfigurationIds = configurationIds; - DeploymentType = deploymentType; - ErrorMessage = errorMessage; + this.CommitTime = commitTime; + this.Region = region; + this.DeploymentStatus = deploymentStatus; + this.ConfigurationIds = configurationIds; + this.DeploymentType = deploymentType; + this.ErrorMessage = errorMessage; CustomInit(); } @@ -57,43 +58,41 @@ public NetworkManagerDeploymentStatus() /// partial void CustomInit(); + /// /// Gets or sets commit Time. /// - [JsonProperty(PropertyName = "commitTime")] - public System.DateTime? CommitTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime {get; set; } /// /// Gets or sets region Name. /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; set; } /// - /// Gets or sets deployment Status. Possible values include: - /// 'NotStarted', 'Deploying', 'Deployed', 'Failed' + /// Gets or sets deployment Status. Possible values include: 'NotStarted', 'Deploying', 'Deployed', 'Failed' /// - [JsonProperty(PropertyName = "deploymentStatus")] - public string DeploymentStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentStatus")] + public string DeploymentStatus {get; set; } /// /// Gets or sets list of configuration ids. /// - [JsonProperty(PropertyName = "configurationIds")] - public IList ConfigurationIds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationIds")] + public System.Collections.Generic.IList ConfigurationIds {get; set; } /// - /// Gets or sets possible values include: 'SecurityAdmin', - /// 'Connectivity' + /// Gets or sets configuration Deployment Type. Possible values include: 'SecurityAdmin', 'Connectivity' /// - [JsonProperty(PropertyName = "deploymentType")] - public string DeploymentType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentType")] + public string DeploymentType {get; set; } /// /// Gets or sets error Message. /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusListResult.cs index 383a5dda10df..cf663252cc23 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkManagerDeploymentStatusListResult { /// - /// Initializes a new instance of the - /// NetworkManagerDeploymentStatusListResult class. + /// Initializes a new instance of the NetworkManagerDeploymentStatusListResult class. /// public NetworkManagerDeploymentStatusListResult() { @@ -30,18 +21,21 @@ public NetworkManagerDeploymentStatusListResult() } /// - /// Initializes a new instance of the - /// NetworkManagerDeploymentStatusListResult class. + /// Initializes a new instance of the NetworkManagerDeploymentStatusListResult class. /// - /// Gets a page of Network Manager Deployment - /// Status - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. - public NetworkManagerDeploymentStatusListResult(IList value = default(IList), string skipToken = default(string)) + + /// Gets a page of Network Manager Deployment Status + /// + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + public NetworkManagerDeploymentStatusListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Value = value; - SkipToken = skipToken; + this.Value = value; + this.SkipToken = skipToken; CustomInit(); } @@ -50,19 +44,19 @@ public NetworkManagerDeploymentStatusListResult() /// partial void CustomInit(); + /// - /// Gets a page of Network Manager Deployment Status + /// Gets or sets gets a page of Network Manager Deployment Status /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusParameter.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusParameter.cs index 5f72882b1163..b8de6070f431 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusParameter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerDeploymentStatusParameter.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkManagerDeploymentStatusParameter { /// - /// Initializes a new instance of the - /// NetworkManagerDeploymentStatusParameter class. + /// Initializes a new instance of the NetworkManagerDeploymentStatusParameter class. /// public NetworkManagerDeploymentStatusParameter() { @@ -30,19 +21,24 @@ public NetworkManagerDeploymentStatusParameter() } /// - /// Initializes a new instance of the - /// NetworkManagerDeploymentStatusParameter class. + /// Initializes a new instance of the NetworkManagerDeploymentStatusParameter class. /// - /// List of locations. - /// List of deployment types. - /// Continuation token for pagination, - /// capturing the next page size and offset, as well as the context of - /// the query. - public NetworkManagerDeploymentStatusParameter(IList regions = default(IList), IList deploymentTypes = default(IList), string skipToken = default(string)) + + /// List of locations. + /// + + /// List of deployment types. + /// + + /// Continuation token for pagination, capturing the next page size and offset, + /// as well as the context of the query. + /// + public NetworkManagerDeploymentStatusParameter(System.Collections.Generic.IList regions = default(System.Collections.Generic.IList), System.Collections.Generic.IList deploymentTypes = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Regions = regions; - DeploymentTypes = deploymentTypes; - SkipToken = skipToken; + this.Regions = regions; + this.DeploymentTypes = deploymentTypes; + this.SkipToken = skipToken; CustomInit(); } @@ -51,24 +47,24 @@ public NetworkManagerDeploymentStatusParameter() /// partial void CustomInit(); + /// /// Gets or sets list of locations. /// - [JsonProperty(PropertyName = "regions")] - public IList Regions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "regions")] + public System.Collections.Generic.IList Regions {get; set; } /// /// Gets or sets list of deployment types. /// - [JsonProperty(PropertyName = "deploymentTypes")] - public IList DeploymentTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentTypes")] + public System.Collections.Generic.IList DeploymentTypes {get; set; } /// - /// Gets or sets continuation token for pagination, capturing the next - /// page size and offset, as well as the context of the query. + /// Gets or sets continuation token for pagination, capturing the next page + /// size and offset, as well as the context of the query. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs index 3450d169eb10..f8f3bb5f6b6d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -23,8 +15,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkManagerEffectiveConnectivityConfigurationListResult { /// - /// Initializes a new instance of the - /// NetworkManagerEffectiveConnectivityConfigurationListResult class. + /// Initializes a new instance of the NetworkManagerEffectiveConnectivityConfigurationListResult class. /// public NetworkManagerEffectiveConnectivityConfigurationListResult() { @@ -32,18 +23,21 @@ public NetworkManagerEffectiveConnectivityConfigurationListResult() } /// - /// Initializes a new instance of the - /// NetworkManagerEffectiveConnectivityConfigurationListResult class. + /// Initializes a new instance of the NetworkManagerEffectiveConnectivityConfigurationListResult class. /// - /// Gets a page of - /// NetworkManagerEffectiveConnectivityConfiguration - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. - public NetworkManagerEffectiveConnectivityConfigurationListResult(IList value = default(IList), string skipToken = default(string)) + + /// Gets a page of NetworkManagerEffectiveConnectivityConfiguration + /// + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + public NetworkManagerEffectiveConnectivityConfigurationListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Value = value; - SkipToken = skipToken; + this.Value = value; + this.SkipToken = skipToken; CustomInit(); } @@ -52,19 +46,20 @@ public NetworkManagerEffectiveConnectivityConfigurationListResult() /// partial void CustomInit(); + /// - /// Gets a page of NetworkManagerEffectiveConnectivityConfiguration + /// Gets or sets gets a page of + /// NetworkManagerEffectiveConnectivityConfiguration /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs index aa26d6280c37..097f60d1df5b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs @@ -1,30 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Result of the request to list - /// networkManagerEffectiveSecurityAdminRules. It contains a list of groups - /// and a skiptoken to get the next set of results. + /// Result of the request to list networkManagerEffectiveSecurityAdminRules. It + /// contains a list of groups and a skiptoken to get the next set of results. /// public partial class NetworkManagerEffectiveSecurityAdminRulesListResult { /// - /// Initializes a new instance of the - /// NetworkManagerEffectiveSecurityAdminRulesListResult class. + /// Initializes a new instance of the NetworkManagerEffectiveSecurityAdminRulesListResult class. /// public NetworkManagerEffectiveSecurityAdminRulesListResult() { @@ -32,18 +22,21 @@ public NetworkManagerEffectiveSecurityAdminRulesListResult() } /// - /// Initializes a new instance of the - /// NetworkManagerEffectiveSecurityAdminRulesListResult class. + /// Initializes a new instance of the NetworkManagerEffectiveSecurityAdminRulesListResult class. /// - /// Gets a page of - /// NetworkManagerEffectiveSecurityAdminRules - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. - public NetworkManagerEffectiveSecurityAdminRulesListResult(IList value = default(IList), string skipToken = default(string)) + + /// Gets a page of NetworkManagerEffectiveSecurityAdminRules + /// + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + public NetworkManagerEffectiveSecurityAdminRulesListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string skipToken = default(string)) + { - Value = value; - SkipToken = skipToken; + this.Value = value; + this.SkipToken = skipToken; CustomInit(); } @@ -52,19 +45,19 @@ public NetworkManagerEffectiveSecurityAdminRulesListResult() /// partial void CustomInit(); + /// - /// Gets a page of NetworkManagerEffectiveSecurityAdminRules + /// Gets or sets gets a page of NetworkManagerEffectiveSecurityAdminRules /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerProperties.cs new file mode 100644 index 000000000000..a36ac7d77122 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerProperties.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of Managed Network + /// + public partial class NetworkManagerProperties + { + /// + /// Initializes a new instance of the NetworkManagerProperties class. + /// + public NetworkManagerProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerProperties class. + /// + + /// A description of the network manager. + /// + + /// Scope of Network Manager. + /// + + /// Scope Access. + /// + + /// The provisioning state of the network manager resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Unique identifier for this resource. + /// + public NetworkManagerProperties(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes, System.Collections.Generic.IList networkManagerScopeAccesses, string description = default(string), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.NetworkManagerScopes = networkManagerScopes; + this.NetworkManagerScopeAccesses = networkManagerScopeAccesses; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description of the network manager. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets scope of Network Manager. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkManagerScopes")] + public NetworkManagerPropertiesNetworkManagerScopes NetworkManagerScopes {get; set; } + + /// + /// Gets or sets scope Access. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkManagerScopeAccesses")] + public System.Collections.Generic.IList NetworkManagerScopeAccesses {get; set; } + + /// + /// Gets the provisioning state of the network manager resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.NetworkManagerScopes == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NetworkManagerScopes"); + } + if (this.NetworkManagerScopeAccesses == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NetworkManagerScopeAccesses"); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs index e05dfbf54108..122ce2550bba 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkManagerPropertiesNetworkManagerScopes { /// - /// Initializes a new instance of the - /// NetworkManagerPropertiesNetworkManagerScopes class. + /// Initializes a new instance of the NetworkManagerPropertiesNetworkManagerScopes class. /// public NetworkManagerPropertiesNetworkManagerScopes() { @@ -30,18 +21,23 @@ public NetworkManagerPropertiesNetworkManagerScopes() } /// - /// Initializes a new instance of the - /// NetworkManagerPropertiesNetworkManagerScopes class. + /// Initializes a new instance of the NetworkManagerPropertiesNetworkManagerScopes class. /// - /// List of management groups. - /// List of subscriptions. - /// List of cross tenant - /// scopes. - public NetworkManagerPropertiesNetworkManagerScopes(IList managementGroups = default(IList), IList subscriptions = default(IList), IList crossTenantScopes = default(IList)) + + /// List of management groups. + /// + + /// List of subscriptions. + /// + + /// List of cross tenant scopes. + /// + public NetworkManagerPropertiesNetworkManagerScopes(System.Collections.Generic.IList managementGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList subscriptions = default(System.Collections.Generic.IList), System.Collections.Generic.IList crossTenantScopes = default(System.Collections.Generic.IList)) + { - ManagementGroups = managementGroups; - Subscriptions = subscriptions; - CrossTenantScopes = crossTenantScopes; + this.ManagementGroups = managementGroups; + this.Subscriptions = subscriptions; + this.CrossTenantScopes = crossTenantScopes; CustomInit(); } @@ -50,23 +46,23 @@ public NetworkManagerPropertiesNetworkManagerScopes() /// partial void CustomInit(); + /// /// Gets or sets list of management groups. /// - [JsonProperty(PropertyName = "managementGroups")] - public IList ManagementGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managementGroups")] + public System.Collections.Generic.IList ManagementGroups {get; set; } /// /// Gets or sets list of subscriptions. /// - [JsonProperty(PropertyName = "subscriptions")] - public IList Subscriptions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptions")] + public System.Collections.Generic.IList Subscriptions {get; set; } /// /// Gets list of cross tenant scopes. /// - [JsonProperty(PropertyName = "crossTenantScopes")] - public IList CrossTenantScopes { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "crossTenantScopes")] + public System.Collections.Generic.IList CrossTenantScopes {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerSecurityGroupItem.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerSecurityGroupItem.cs index a60a0d23c14e..09282e86e2bd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerSecurityGroupItem.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagerSecurityGroupItem.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkManagerSecurityGroupItem { /// - /// Initializes a new instance of the NetworkManagerSecurityGroupItem - /// class. + /// Initializes a new instance of the NetworkManagerSecurityGroupItem class. /// public NetworkManagerSecurityGroupItem() { @@ -29,13 +21,15 @@ public NetworkManagerSecurityGroupItem() } /// - /// Initializes a new instance of the NetworkManagerSecurityGroupItem - /// class. + /// Initializes a new instance of the NetworkManagerSecurityGroupItem class. /// - /// Network manager group Id. + + /// Network manager group Id. + /// public NetworkManagerSecurityGroupItem(string networkGroupId) + { - NetworkGroupId = networkGroupId; + this.NetworkGroupId = networkGroupId; CustomInit(); } @@ -44,24 +38,25 @@ public NetworkManagerSecurityGroupItem(string networkGroupId) /// partial void CustomInit(); + /// /// Gets or sets network manager group Id. /// - [JsonProperty(PropertyName = "networkGroupId")] - public string NetworkGroupId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkGroupId")] + public string NetworkGroupId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (NetworkGroupId == null) + if (this.NetworkGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NetworkGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NetworkGroupId"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagersDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagersDeleteHeaders.cs index a5f5f38d20a6..b2c0da364d9d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagersDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkManagersDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class NetworkManagersDeleteHeaders { /// - /// Initializes a new instance of the NetworkManagersDeleteHeaders - /// class. + /// Initializes a new instance of the NetworkManagersDeleteHeaders class. /// public NetworkManagersDeleteHeaders() { @@ -28,14 +18,15 @@ public NetworkManagersDeleteHeaders() } /// - /// Initializes a new instance of the NetworkManagersDeleteHeaders - /// class. + /// Initializes a new instance of the NetworkManagersDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public NetworkManagersDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public NetworkManagersDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkOperationStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkOperationStatus.cs index a7719f07bf1c..e92862d85d52 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkOperationStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkOperationStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NetworkOperationStatus. /// + + public static class NetworkOperationStatus { public const string InProgress = "InProgress"; public const string Succeeded = "Succeeded"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfile.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfile.cs index 6a56df2ccfcb..d64a31733987 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfile.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfile.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network profile resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkProfile : Resource { /// @@ -34,30 +24,45 @@ public NetworkProfile() /// /// Initializes a new instance of the NetworkProfile class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// List of child container - /// network interfaces. - /// List of chid - /// container network interface configurations. - /// The resource GUID property of the - /// network profile resource. - /// The provisioning state of the - /// network profile resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkProfile(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList containerNetworkInterfaces = default(IList), IList containerNetworkInterfaceConfigurations = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the network profile resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of child container network interfaces. + /// + + /// List of chid container network interface configurations. + /// + + /// The resource GUID property of the network profile resource. + /// + public NetworkProfile(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList containerNetworkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList containerNetworkInterfaceConfigurations = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - ContainerNetworkInterfaces = containerNetworkInterfaces; - ContainerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.ContainerNetworkInterfaces = containerNetworkInterfaces; + this.ContainerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -66,39 +71,36 @@ public NetworkProfile() /// partial void CustomInit(); + /// - /// Gets list of child container network interfaces. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.containerNetworkInterfaces")] - public IList ContainerNetworkInterfaces { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets list of chid container network interface - /// configurations. + /// Gets the provisioning state of the network profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.containerNetworkInterfaceConfigurations")] - public IList ContainerNetworkInterfaceConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the resource GUID property of the network profile resource. + /// Gets list of child container network interfaces. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containerNetworkInterfaces")] + public System.Collections.Generic.IList ContainerNetworkInterfaces {get; private set; } /// - /// Gets the provisioning state of the network profile resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets list of chid container network interface configurations. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containerNetworkInterfaceConfigurations")] + public System.Collections.Generic.IList ContainerNetworkInterfaceConfigurations {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the network profile resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfilePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfilePropertiesFormat.cs new file mode 100644 index 000000000000..73650867994b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkProfilePropertiesFormat.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Network profile properties. + /// + public partial class NetworkProfilePropertiesFormat + { + /// + /// Initializes a new instance of the NetworkProfilePropertiesFormat class. + /// + public NetworkProfilePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkProfilePropertiesFormat class. + /// + + /// List of child container network interfaces. + /// + + /// List of chid container network interface configurations. + /// + + /// The resource GUID property of the network profile resource. + /// + + /// The provisioning state of the network profile resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public NetworkProfilePropertiesFormat(System.Collections.Generic.IList containerNetworkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList containerNetworkInterfaceConfigurations = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.ContainerNetworkInterfaces = containerNetworkInterfaces; + this.ContainerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets list of child container network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerNetworkInterfaces")] + public System.Collections.Generic.IList ContainerNetworkInterfaces {get; private set; } + + /// + /// Gets or sets list of chid container network interface configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containerNetworkInterfaceConfigurations")] + public System.Collections.Generic.IList ContainerNetworkInterfaceConfigurations {get; set; } + + /// + /// Gets the resource GUID property of the network profile resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the network profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkRule.cs index feebc1b0ae05..00a22320b890 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,30 +24,44 @@ public NetworkRule() /// /// Initializes a new instance of the NetworkRule class. /// - /// Name of the rule. - /// Description of the rule. - /// Array of - /// FirewallPolicyRuleNetworkProtocols. - /// List of source IP addresses for this - /// rule. - /// List of destination IP addresses - /// or Service Tags. - /// List of destination ports. - /// List of source IpGroups for this - /// rule. - /// List of destination IpGroups for - /// this rule. - /// List of destination FQDNs. - public NetworkRule(string name = default(string), string description = default(string), IList ipProtocols = default(IList), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList sourceIpGroups = default(IList), IList destinationIpGroups = default(IList), IList destinationFqdns = default(IList)) - : base(name, description) + + /// Name of the rule. + /// + + /// Description of the rule. + /// + + /// Array of FirewallPolicyRuleNetworkProtocols. + /// + + /// List of source IP addresses for this rule. + /// + + /// List of destination IP addresses or Service Tags. + /// + + /// List of destination ports. + /// + + /// List of source IpGroups for this rule. + /// + + /// List of destination IpGroups for this rule. + /// + + /// List of destination FQDNs. + /// + public NetworkRule(string name = default(string), string description = default(string), System.Collections.Generic.IList ipProtocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationAddresses = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationIPGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationFqdns = default(System.Collections.Generic.IList)) + + : base(name, description) { - IpProtocols = ipProtocols; - SourceAddresses = sourceAddresses; - DestinationAddresses = destinationAddresses; - DestinationPorts = destinationPorts; - SourceIpGroups = sourceIpGroups; - DestinationIpGroups = destinationIpGroups; - DestinationFqdns = destinationFqdns; + this.IPProtocols = ipProtocols; + this.SourceAddresses = sourceAddresses; + this.DestinationAddresses = destinationAddresses; + this.DestinationPorts = destinationPorts; + this.SourceIPGroups = sourceIPGroups; + this.DestinationIPGroups = destinationIPGroups; + this.DestinationFqdns = destinationFqdns; CustomInit(); } @@ -64,47 +70,47 @@ public NetworkRule() /// partial void CustomInit(); + /// /// Gets or sets array of FirewallPolicyRuleNetworkProtocols. /// - [JsonProperty(PropertyName = "ipProtocols")] - public IList IpProtocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipProtocols")] + public System.Collections.Generic.IList IPProtocols {get; set; } /// /// Gets or sets list of source IP addresses for this rule. /// - [JsonProperty(PropertyName = "sourceAddresses")] - public IList SourceAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddresses")] + public System.Collections.Generic.IList SourceAddresses {get; set; } /// /// Gets or sets list of destination IP addresses or Service Tags. /// - [JsonProperty(PropertyName = "destinationAddresses")] - public IList DestinationAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddresses")] + public System.Collections.Generic.IList DestinationAddresses {get; set; } /// /// Gets or sets list of destination ports. /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } /// /// Gets or sets list of source IpGroups for this rule. /// - [JsonProperty(PropertyName = "sourceIpGroups")] - public IList SourceIpGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpGroups")] + public System.Collections.Generic.IList SourceIPGroups {get; set; } /// /// Gets or sets list of destination IpGroups for this rule. /// - [JsonProperty(PropertyName = "destinationIpGroups")] - public IList DestinationIpGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationIpGroups")] + public System.Collections.Generic.IList DestinationIPGroups {get; set; } /// /// Gets or sets list of destination FQDNs. /// - [JsonProperty(PropertyName = "destinationFqdns")] - public IList DestinationFqdns { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationFqdns")] + public System.Collections.Generic.IList DestinationFqdns {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroup.cs index 3f13ed5ad2e1..f4cc878f95f7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroup.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NetworkSecurityGroup resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkSecurityGroup : Resource { /// @@ -34,43 +24,63 @@ public NetworkSecurityGroup() /// /// Initializes a new instance of the NetworkSecurityGroup class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// When enabled, flows created from - /// Network Security Group connections will be re-evaluated when rules - /// are updates. Initial enablement will trigger re-evaluation. - /// A collection of security rules of the - /// network security group. - /// The default security rules of - /// network security group. - /// A collection of references to - /// network interfaces. - /// A collection of references to - /// subnets. - /// A collection of references to flow log - /// resources. - /// The resource GUID property of the - /// network security group resource. - /// The provisioning state of the - /// network security group resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? flushConnection = default(bool?), IList securityRules = default(IList), IList defaultSecurityRules = default(IList), IList networkInterfaces = default(IList), IList subnets = default(IList), IList flowLogs = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the network security group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// When enabled, flows created from Network Security Group connections will be + /// re-evaluated when rules are updates. Initial enablement will trigger + /// re-evaluation. + /// + + /// A collection of security rules of the network security group. + /// + + /// The default security rules of network security group. + /// + + /// A collection of references to network interfaces. + /// + + /// A collection of references to subnets. + /// + + /// A collection of references to flow log resources. + /// + + /// The resource GUID property of the network security group resource. + /// + public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), bool? flushConnection = default(bool?), System.Collections.Generic.IList securityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList defaultSecurityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList flowLogs = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - FlushConnection = flushConnection; - SecurityRules = securityRules; - DefaultSecurityRules = defaultSecurityRules; - NetworkInterfaces = networkInterfaces; - Subnets = subnets; - FlowLogs = flowLogs; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.FlushConnection = flushConnection; + this.SecurityRules = securityRules; + this.DefaultSecurityRules = defaultSecurityRules; + this.NetworkInterfaces = networkInterfaces; + this.Subnets = subnets; + this.FlowLogs = flowLogs; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -79,66 +89,62 @@ public NetworkSecurityGroup() /// partial void CustomInit(); + /// - /// Gets or sets when enabled, flows created from Network Security - /// Group connections will be re-evaluated when rules are updates. - /// Initial enablement will trigger re-evaluation. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.flushConnection")] - public bool? FlushConnection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets a collection of security rules of the network security - /// group. + /// Gets the provisioning state of the network security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.securityRules")] - public IList SecurityRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the default security rules of network security group. + /// Gets or sets when enabled, flows created from Network Security Group + /// connections will be re-evaluated when rules are updates. Initial enablement + /// will trigger re-evaluation. /// - [JsonProperty(PropertyName = "properties.defaultSecurityRules")] - public IList DefaultSecurityRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flushConnection")] + public bool? FlushConnection {get; set; } /// - /// Gets a collection of references to network interfaces. + /// Gets or sets a collection of security rules of the network security group. /// - [JsonProperty(PropertyName = "properties.networkInterfaces")] - public IList NetworkInterfaces { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityRules")] + public System.Collections.Generic.IList SecurityRules {get; set; } /// - /// Gets a collection of references to subnets. + /// Gets the default security rules of network security group. /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultSecurityRules")] + public System.Collections.Generic.IList DefaultSecurityRules {get; private set; } /// - /// Gets a collection of references to flow log resources. + /// Gets a collection of references to network interfaces. /// - [JsonProperty(PropertyName = "properties.flowLogs")] - public IList FlowLogs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; private set; } /// - /// Gets the resource GUID property of the network security group - /// resource. + /// Gets a collection of references to subnets. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } /// - /// Gets the provisioning state of the network security group resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets a collection of references to flow log resources. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flowLogs")] + public System.Collections.Generic.IList FlowLogs {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the network security group resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupPropertiesFormat.cs new file mode 100644 index 000000000000..edd066a0ca7e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupPropertiesFormat.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Network Security Group resource. + /// + public partial class NetworkSecurityGroupPropertiesFormat + { + /// + /// Initializes a new instance of the NetworkSecurityGroupPropertiesFormat class. + /// + public NetworkSecurityGroupPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkSecurityGroupPropertiesFormat class. + /// + + /// When enabled, flows created from Network Security Group connections will be + /// re-evaluated when rules are updates. Initial enablement will trigger + /// re-evaluation. + /// + + /// A collection of security rules of the network security group. + /// + + /// The default security rules of network security group. + /// + + /// A collection of references to network interfaces. + /// + + /// A collection of references to subnets. + /// + + /// A collection of references to flow log resources. + /// + + /// The resource GUID property of the network security group resource. + /// + + /// The provisioning state of the network security group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public NetworkSecurityGroupPropertiesFormat(bool? flushConnection = default(bool?), System.Collections.Generic.IList securityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList defaultSecurityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList flowLogs = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string)) + + { + this.FlushConnection = flushConnection; + this.SecurityRules = securityRules; + this.DefaultSecurityRules = defaultSecurityRules; + this.NetworkInterfaces = networkInterfaces; + this.Subnets = subnets; + this.FlowLogs = flowLogs; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets when enabled, flows created from Network Security Group + /// connections will be re-evaluated when rules are updates. Initial enablement + /// will trigger re-evaluation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flushConnection")] + public bool? FlushConnection {get; set; } + + /// + /// Gets or sets a collection of security rules of the network security group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityRules")] + public System.Collections.Generic.IList SecurityRules {get; set; } + + /// + /// Gets the default security rules of network security group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultSecurityRules")] + public System.Collections.Generic.IList DefaultSecurityRules {get; private set; } + + /// + /// Gets a collection of references to network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; private set; } + + /// + /// Gets a collection of references to subnets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } + + /// + /// Gets a collection of references to flow log resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flowLogs")] + public System.Collections.Generic.IList FlowLogs {get; private set; } + + /// + /// Gets the resource GUID property of the network security group resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the network security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupResult.cs index b4117d1cff84..e291282136ce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityGroupResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,14 +24,17 @@ public NetworkSecurityGroupResult() /// /// Initializes a new instance of the NetworkSecurityGroupResult class. /// - /// The network traffic is - /// allowed or denied. Possible values include: 'Allow', 'Deny' - /// List of results - /// network security groups diagnostic. - public NetworkSecurityGroupResult(string securityRuleAccessResult = default(string), IList evaluatedNetworkSecurityGroups = default(IList)) + + /// The network traffic is allowed or denied. + /// Possible values include: 'Allow', 'Deny' + + /// List of results network security groups diagnostic. + /// + public NetworkSecurityGroupResult(string securityRuleAccessResult = default(string), System.Collections.Generic.IList evaluatedNetworkSecurityGroups = default(System.Collections.Generic.IList)) + { - SecurityRuleAccessResult = securityRuleAccessResult; - EvaluatedNetworkSecurityGroups = evaluatedNetworkSecurityGroups; + this.SecurityRuleAccessResult = securityRuleAccessResult; + this.EvaluatedNetworkSecurityGroups = evaluatedNetworkSecurityGroups; CustomInit(); } @@ -48,18 +43,17 @@ public NetworkSecurityGroupResult() /// partial void CustomInit(); + /// - /// Gets or sets the network traffic is allowed or denied. Possible - /// values include: 'Allow', 'Deny' + /// Gets or sets the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "securityRuleAccessResult")] - public string SecurityRuleAccessResult { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityRuleAccessResult")] + public string SecurityRuleAccessResult {get; set; } /// /// Gets list of results network security groups diagnostic. /// - [JsonProperty(PropertyName = "evaluatedNetworkSecurityGroups")] - public IList EvaluatedNetworkSecurityGroups { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "evaluatedNetworkSecurityGroups")] + public System.Collections.Generic.IList EvaluatedNetworkSecurityGroups {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityRulesEvaluationResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityRulesEvaluationResult.cs index 1db1a657504e..95613e610012 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityRulesEvaluationResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkSecurityRulesEvaluationResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkSecurityRulesEvaluationResult { /// - /// Initializes a new instance of the - /// NetworkSecurityRulesEvaluationResult class. + /// Initializes a new instance of the NetworkSecurityRulesEvaluationResult class. /// public NetworkSecurityRulesEvaluationResult() { @@ -28,28 +21,35 @@ public NetworkSecurityRulesEvaluationResult() } /// - /// Initializes a new instance of the - /// NetworkSecurityRulesEvaluationResult class. + /// Initializes a new instance of the NetworkSecurityRulesEvaluationResult class. /// - /// Name of the network security rule. - /// Value indicating whether protocol is - /// matched. - /// Value indicating whether source is - /// matched. - /// Value indicating whether source - /// port is matched. - /// Value indicating whether - /// destination is matched. - /// Value indicating whether - /// destination port is matched. + + /// Name of the network security rule. + /// + + /// Value indicating whether protocol is matched. + /// + + /// Value indicating whether source is matched. + /// + + /// Value indicating whether source port is matched. + /// + + /// Value indicating whether destination is matched. + /// + + /// Value indicating whether destination port is matched. + /// public NetworkSecurityRulesEvaluationResult(string name = default(string), bool? protocolMatched = default(bool?), bool? sourceMatched = default(bool?), bool? sourcePortMatched = default(bool?), bool? destinationMatched = default(bool?), bool? destinationPortMatched = default(bool?)) + { - Name = name; - ProtocolMatched = protocolMatched; - SourceMatched = sourceMatched; - SourcePortMatched = sourcePortMatched; - DestinationMatched = destinationMatched; - DestinationPortMatched = destinationPortMatched; + this.Name = name; + this.ProtocolMatched = protocolMatched; + this.SourceMatched = sourceMatched; + this.SourcePortMatched = sourcePortMatched; + this.DestinationMatched = destinationMatched; + this.DestinationPortMatched = destinationPortMatched; CustomInit(); } @@ -58,41 +58,41 @@ public NetworkSecurityRulesEvaluationResult() /// partial void CustomInit(); + /// /// Gets or sets name of the network security rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets value indicating whether protocol is matched. /// - [JsonProperty(PropertyName = "protocolMatched")] - public bool? ProtocolMatched { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocolMatched")] + public bool? ProtocolMatched {get; set; } /// /// Gets or sets value indicating whether source is matched. /// - [JsonProperty(PropertyName = "sourceMatched")] - public bool? SourceMatched { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceMatched")] + public bool? SourceMatched {get; set; } /// /// Gets or sets value indicating whether source port is matched. /// - [JsonProperty(PropertyName = "sourcePortMatched")] - public bool? SourcePortMatched { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortMatched")] + public bool? SourcePortMatched {get; set; } /// /// Gets or sets value indicating whether destination is matched. /// - [JsonProperty(PropertyName = "destinationMatched")] - public bool? DestinationMatched { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationMatched")] + public bool? DestinationMatched {get; set; } /// /// Gets or sets value indicating whether destination port is matched. /// - [JsonProperty(PropertyName = "destinationPortMatched")] - public bool? DestinationPortMatched { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortMatched")] + public bool? DestinationPortMatched {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliance.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliance.cs index 2e2b7e95e2d1..ddcaaefe6b43 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliance.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliance.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NetworkVirtualAppliance Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkVirtualAppliance : Resource { /// @@ -34,74 +24,106 @@ public NetworkVirtualAppliance() /// /// Initializes a new instance of the NetworkVirtualAppliance class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Network Virtual Appliance SKU. - /// Address Prefix. - /// BootStrapConfigurationBlobs - /// storage URLs. - /// The Virtual Hub where Network Virtual - /// Appliance is being deployed. - /// CloudInitConfigurationBlob - /// storage URLs. - /// CloudInitConfiguration string - /// in plain text. - /// VirtualAppliance ASN. Microsoft - /// private, public and IANA reserved ASN are not supported. - /// Public key for SSH login. - /// List of Virtual Appliance - /// Network Interfaces. - /// Details required for Additional - /// Network Interface. - /// List of Resource Uri of - /// Public IPs for Internet Ingress Scenario. - /// List of references to - /// VirtualApplianceSite. - /// List of references to - /// VirtualApplianceConnections. - /// List of references to - /// InboundSecurityRules. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The deployment type. PartnerManaged - /// for the SaaS NVA - /// The delegation for the Virtual - /// Appliance - /// The delegation for the Virtual - /// Appliance - /// The service principal that has read access - /// to cloud-init and config blob. - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkVirtualAppliance(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), VirtualApplianceSkuProperties nvaSku = default(VirtualApplianceSkuProperties), string addressPrefix = default(string), IList bootStrapConfigurationBlobs = default(IList), SubResource virtualHub = default(SubResource), IList cloudInitConfigurationBlobs = default(IList), string cloudInitConfiguration = default(string), long? virtualApplianceAsn = default(long?), string sshPublicKey = default(string), IList virtualApplianceNics = default(IList), IList additionalNics = default(IList), IList internetIngressPublicIps = default(IList), IList virtualApplianceSites = default(IList), IList virtualApplianceConnections = default(IList), IList inboundSecurityRules = default(IList), string provisioningState = default(string), string deploymentType = default(string), DelegationProperties delegation = default(DelegationProperties), PartnerManagedResourceProperties partnerManagedResource = default(PartnerManagedResourceProperties), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The service principal that has read access to cloud-init and config blob. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Network Virtual Appliance SKU. + /// + + /// Address Prefix. + /// + + /// BootStrapConfigurationBlobs storage URLs. + /// + + /// The Virtual Hub where Network Virtual Appliance is being deployed. + /// + + /// CloudInitConfigurationBlob storage URLs. + /// + + /// CloudInitConfiguration string in plain text. + /// + + /// VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are + /// not supported. + /// + + /// Public key for SSH login. + /// + + /// List of Virtual Appliance Network Interfaces. + /// + + /// Details required for Additional Network Interface. + /// + + /// List of Resource Uri of Public IPs for Internet Ingress Scenario. + /// + + /// List of references to VirtualApplianceSite. + /// + + /// List of references to VirtualApplianceConnections. + /// + + /// List of references to InboundSecurityRules. + /// + + /// The deployment type. PartnerManaged for the SaaS NVA + /// + + /// The delegation for the Virtual Appliance + /// + + /// The delegation for the Virtual Appliance + /// + public NetworkVirtualAppliance(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string etag = default(string), string provisioningState = default(string), VirtualApplianceSkuProperties nvaSku = default(VirtualApplianceSkuProperties), string addressPrefix = default(string), System.Collections.Generic.IList bootStrapConfigurationBlobs = default(System.Collections.Generic.IList), SubResource virtualHub = default(SubResource), System.Collections.Generic.IList cloudInitConfigurationBlobs = default(System.Collections.Generic.IList), string cloudInitConfiguration = default(string), long? virtualApplianceAsn = default(long?), string sshPublicKey = default(string), System.Collections.Generic.IList virtualApplianceNics = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalNics = default(System.Collections.Generic.IList), System.Collections.Generic.IList internetIngressPublicIps = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualApplianceSites = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualApplianceConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundSecurityRules = default(System.Collections.Generic.IList), string deploymentType = default(string), DelegationProperties delegation = default(DelegationProperties), PartnerManagedResourceProperties partnerManagedResource = default(PartnerManagedResourceProperties)) + + : base(id, name, type, location, tags) { - NvaSku = nvaSku; - AddressPrefix = addressPrefix; - BootStrapConfigurationBlobs = bootStrapConfigurationBlobs; - VirtualHub = virtualHub; - CloudInitConfigurationBlobs = cloudInitConfigurationBlobs; - CloudInitConfiguration = cloudInitConfiguration; - VirtualApplianceAsn = virtualApplianceAsn; - SshPublicKey = sshPublicKey; - VirtualApplianceNics = virtualApplianceNics; - AdditionalNics = additionalNics; - InternetIngressPublicIps = internetIngressPublicIps; - VirtualApplianceSites = virtualApplianceSites; - VirtualApplianceConnections = virtualApplianceConnections; - InboundSecurityRules = inboundSecurityRules; - ProvisioningState = provisioningState; - DeploymentType = deploymentType; - Delegation = delegation; - PartnerManagedResource = partnerManagedResource; - Identity = identity; - Etag = etag; + this.Identity = identity; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.NvaSku = nvaSku; + this.AddressPrefix = addressPrefix; + this.BootStrapConfigurationBlobs = bootStrapConfigurationBlobs; + this.VirtualHub = virtualHub; + this.CloudInitConfigurationBlobs = cloudInitConfigurationBlobs; + this.CloudInitConfiguration = cloudInitConfiguration; + this.VirtualApplianceAsn = virtualApplianceAsn; + this.SshPublicKey = sshPublicKey; + this.VirtualApplianceNics = virtualApplianceNics; + this.AdditionalNics = additionalNics; + this.InternetIngressPublicIps = internetIngressPublicIps; + this.VirtualApplianceSites = virtualApplianceSites; + this.VirtualApplianceConnections = virtualApplianceConnections; + this.InboundSecurityRules = inboundSecurityRules; + this.DeploymentType = deploymentType; + this.Delegation = delegation; + this.PartnerManagedResource = partnerManagedResource; CustomInit(); } @@ -110,151 +132,169 @@ public NetworkVirtualAppliance() /// partial void CustomInit(); + + /// + /// Gets or sets the service principal that has read access to cloud-init and + /// config blob. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets network Virtual Appliance SKU. /// - [JsonProperty(PropertyName = "properties.nvaSku")] - public VirtualApplianceSkuProperties NvaSku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nvaSku")] + public VirtualApplianceSkuProperties NvaSku {get; set; } /// /// Gets address Prefix. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; private set; } /// /// Gets or sets bootStrapConfigurationBlobs storage URLs. /// - [JsonProperty(PropertyName = "properties.bootStrapConfigurationBlobs")] - public IList BootStrapConfigurationBlobs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bootStrapConfigurationBlobs")] + public System.Collections.Generic.IList BootStrapConfigurationBlobs {get; set; } /// - /// Gets or sets the Virtual Hub where Network Virtual Appliance is - /// being deployed. + /// Gets or sets the Virtual Hub where Network Virtual Appliance is being + /// deployed. /// - [JsonProperty(PropertyName = "properties.virtualHub")] - public SubResource VirtualHub { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHub")] + public SubResource VirtualHub {get; set; } /// /// Gets or sets cloudInitConfigurationBlob storage URLs. /// - [JsonProperty(PropertyName = "properties.cloudInitConfigurationBlobs")] - public IList CloudInitConfigurationBlobs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cloudInitConfigurationBlobs")] + public System.Collections.Generic.IList CloudInitConfigurationBlobs {get; set; } /// /// Gets or sets cloudInitConfiguration string in plain text. /// - [JsonProperty(PropertyName = "properties.cloudInitConfiguration")] - public string CloudInitConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cloudInitConfiguration")] + public string CloudInitConfiguration {get; set; } /// - /// Gets or sets virtualAppliance ASN. Microsoft private, public and - /// IANA reserved ASN are not supported. + /// Gets or sets virtualAppliance ASN. Microsoft private, public and IANA + /// reserved ASN are not supported. /// - [JsonProperty(PropertyName = "properties.virtualApplianceAsn")] - public long? VirtualApplianceAsn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualApplianceAsn")] + public long? VirtualApplianceAsn {get; set; } /// /// Gets or sets public key for SSH login. /// - [JsonProperty(PropertyName = "properties.sshPublicKey")] - public string SshPublicKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sshPublicKey")] + public string SshPublicKey {get; set; } /// /// Gets list of Virtual Appliance Network Interfaces. /// - [JsonProperty(PropertyName = "properties.virtualApplianceNics")] - public IList VirtualApplianceNics { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualApplianceNics")] + public System.Collections.Generic.IList VirtualApplianceNics {get; private set; } /// /// Gets or sets details required for Additional Network Interface. /// - [JsonProperty(PropertyName = "properties.additionalNics")] - public IList AdditionalNics { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalNics")] + public System.Collections.Generic.IList AdditionalNics {get; set; } /// - /// Gets or sets list of Resource Uri of Public IPs for Internet - /// Ingress Scenario. + /// Gets or sets list of Resource Uri of Public IPs for Internet Ingress + /// Scenario. /// - [JsonProperty(PropertyName = "properties.internetIngressPublicIps")] - public IList InternetIngressPublicIps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.internetIngressPublicIps")] + public System.Collections.Generic.IList InternetIngressPublicIps {get; set; } /// /// Gets list of references to VirtualApplianceSite. /// - [JsonProperty(PropertyName = "properties.virtualApplianceSites")] - public IList VirtualApplianceSites { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualApplianceSites")] + public System.Collections.Generic.IList VirtualApplianceSites {get; private set; } /// /// Gets list of references to VirtualApplianceConnections. /// - [JsonProperty(PropertyName = "properties.virtualApplianceConnections")] - public IList VirtualApplianceConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualApplianceConnections")] + public System.Collections.Generic.IList VirtualApplianceConnections {get; private set; } /// /// Gets list of references to InboundSecurityRules. /// - [JsonProperty(PropertyName = "properties.inboundSecurityRules")] - public IList InboundSecurityRules { get; private set; } - - /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundSecurityRules")] + public System.Collections.Generic.IList InboundSecurityRules {get; private set; } /// /// Gets the deployment type. PartnerManaged for the SaaS NVA /// - [JsonProperty(PropertyName = "properties.deploymentType")] - public string DeploymentType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deploymentType")] + public string DeploymentType {get; private set; } /// /// Gets or sets the delegation for the Virtual Appliance /// - [JsonProperty(PropertyName = "properties.delegation")] - public DelegationProperties Delegation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.delegation")] + public DelegationProperties Delegation {get; set; } /// /// Gets or sets the delegation for the Virtual Appliance /// - [JsonProperty(PropertyName = "properties.partnerManagedResource")] - public PartnerManagedResourceProperties PartnerManagedResource { get; set; } - - /// - /// Gets or sets the service principal that has read access to - /// cloud-init and config blob. - /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.partnerManagedResource")] + public PartnerManagedResourceProperties PartnerManagedResource {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualApplianceAsn != null) + + + + + + + + + + if (this.VirtualApplianceAsn != null) { - if (VirtualApplianceAsn > 4294967295) + if (this.VirtualApplianceAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualApplianceAsn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "VirtualApplianceAsn", 4294967295); } - if (VirtualApplianceAsn < 0) + if (this.VirtualApplianceAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualApplianceAsn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "VirtualApplianceAsn", 0); } } + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnection.cs index 80340022a6fe..ce83bf1627ba 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NetworkVirtualApplianceConnection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkVirtualApplianceConnection : SubResource { /// - /// Initializes a new instance of the NetworkVirtualApplianceConnection - /// class. + /// Initializes a new instance of the NetworkVirtualApplianceConnection class. /// public NetworkVirtualApplianceConnection() { @@ -33,37 +22,48 @@ public NetworkVirtualApplianceConnection() } /// - /// Initializes a new instance of the NetworkVirtualApplianceConnection - /// class. + /// Initializes a new instance of the NetworkVirtualApplianceConnection class. /// - /// Resource ID. - /// The - /// name of the resource. - /// The provisioning state of the - /// NetworkVirtualApplianceConnection resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Network Virtual Appliance ASN. - /// Unique identifier for the - /// connection. - /// List of bgpPeerAddresses for the NVA - /// instances - /// Enable internet - /// security. - /// The Routing Configuration - /// indicating the associated and propagated route tables on this - /// connection. - /// The name of the resource. - public NetworkVirtualApplianceConnection(string id = default(string), string networkVirtualApplianceConnectionPropertiesName = default(string), string provisioningState = default(string), long? asn = default(long?), long? tunnelIdentifier = default(long?), IList bgpPeerAddress = default(IList), bool? enableInternetSecurity = default(bool?), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string name = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource. + /// + + /// The provisioning state of the NetworkVirtualApplianceConnection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// The name of the resource. + /// + + /// Network Virtual Appliance ASN. + /// + + /// Unique identifier for the connection. + /// + + /// List of bgpPeerAddresses for the NVA instances + /// + + /// Enable internet security. + /// + public NetworkVirtualApplianceConnection(string id = default(string), string name = default(string), string provisioningState = default(string), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string propertiesName = default(string), long? asn = default(long?), long? tunnelIdentifier = default(long?), System.Collections.Generic.IList bgpPeerAddress = default(System.Collections.Generic.IList), bool? enableInternetSecurity = default(bool?)) + + : base(id) { - NetworkVirtualApplianceConnectionPropertiesName = networkVirtualApplianceConnectionPropertiesName; - ProvisioningState = provisioningState; - Asn = asn; - TunnelIdentifier = tunnelIdentifier; - BgpPeerAddress = bgpPeerAddress; - EnableInternetSecurity = enableInternetSecurity; - RoutingConfiguration = routingConfiguration; - Name = name; + this.Name = name; + this.ProvisioningState = provisioningState; + this.RoutingConfiguration = routingConfiguration; + this.PropertiesName = propertiesName; + this.Asn = asn; + this.TunnelIdentifier = tunnelIdentifier; + this.BgpPeerAddress = bgpPeerAddress; + this.EnableInternetSecurity = enableInternetSecurity; CustomInit(); } @@ -72,87 +72,91 @@ public NetworkVirtualApplianceConnection() /// partial void CustomInit(); + /// /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "properties.name")] - public string NetworkVirtualApplianceConnectionPropertiesName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the - /// NetworkVirtualApplianceConnection resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the NetworkVirtualApplianceConnection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets network Virtual Appliance ASN. + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. /// - [JsonProperty(PropertyName = "properties.asn")] - public long? Asn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } /// - /// Gets or sets unique identifier for the connection. + /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "properties.tunnelIdentifier")] - public long? TunnelIdentifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + public string PropertiesName {get; set; } /// - /// Gets or sets list of bgpPeerAddresses for the NVA instances + /// Gets or sets network Virtual Appliance ASN. /// - [JsonProperty(PropertyName = "properties.bgpPeerAddress")] - public IList BgpPeerAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.asn")] + public long? Asn {get; set; } /// - /// Gets or sets enable internet security. + /// Gets or sets unique identifier for the connection. /// - [JsonProperty(PropertyName = "properties.enableInternetSecurity")] - public bool? EnableInternetSecurity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tunnelIdentifier")] + public long? TunnelIdentifier {get; set; } /// - /// Gets or sets the Routing Configuration indicating the associated - /// and propagated route tables on this connection. + /// Gets or sets list of bgpPeerAddresses for the NVA instances /// - [JsonProperty(PropertyName = "properties.routingConfiguration")] - public RoutingConfiguration RoutingConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpPeerAddress")] + public System.Collections.Generic.IList BgpPeerAddress {get; set; } /// - /// Gets or sets the name of the resource. + /// Gets or sets enable internet security. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Asn != null) + + + + + if (this.Asn != null) { - if (Asn > 4294967295) + if (this.Asn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Asn", 4294967295); } - if (Asn < 0) + if (this.Asn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Asn", 0); } } - if (TunnelIdentifier != null) + if (this.TunnelIdentifier != null) { - if (TunnelIdentifier > 4294967295) + if (this.TunnelIdentifier > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TunnelIdentifier", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TunnelIdentifier", 4294967295); } - if (TunnelIdentifier < 0) + if (this.TunnelIdentifier < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TunnelIdentifier", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TunnelIdentifier", 0); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionProperties.cs new file mode 100644 index 000000000000..8274b276bde7 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionProperties.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the NetworkVirtualApplianceConnection subresource. + /// + public partial class NetworkVirtualApplianceConnectionProperties + { + /// + /// Initializes a new instance of the NetworkVirtualApplianceConnectionProperties class. + /// + public NetworkVirtualApplianceConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkVirtualApplianceConnectionProperties class. + /// + + /// The name of the resource. + /// + + /// The provisioning state of the NetworkVirtualApplianceConnection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Network Virtual Appliance ASN. + /// + + /// Unique identifier for the connection. + /// + + /// List of bgpPeerAddresses for the NVA instances + /// + + /// Enable internet security. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + public NetworkVirtualApplianceConnectionProperties(string name = default(string), string provisioningState = default(string), long? asn = default(long?), long? tunnelIdentifier = default(long?), System.Collections.Generic.IList bgpPeerAddress = default(System.Collections.Generic.IList), bool? enableInternetSecurity = default(bool?), RoutingConfiguration routingConfiguration = default(RoutingConfiguration)) + + { + this.Name = name; + this.ProvisioningState = provisioningState; + this.Asn = asn; + this.TunnelIdentifier = tunnelIdentifier; + this.BgpPeerAddress = bgpPeerAddress; + this.EnableInternetSecurity = enableInternetSecurity; + this.RoutingConfiguration = routingConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets the provisioning state of the NetworkVirtualApplianceConnection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets network Virtual Appliance ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + public long? Asn {get; set; } + + /// + /// Gets or sets unique identifier for the connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnelIdentifier")] + public long? TunnelIdentifier {get; set; } + + /// + /// Gets or sets list of bgpPeerAddresses for the NVA instances + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpPeerAddress")] + public System.Collections.Generic.IList BgpPeerAddress {get; set; } + + /// + /// Gets or sets enable internet security. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } + + /// + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.Asn != null) + { + if (this.Asn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Asn", 4294967295); + } + if (this.Asn < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Asn", 0); + } + } + if (this.TunnelIdentifier != null) + { + if (this.TunnelIdentifier > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TunnelIdentifier", 4294967295); + } + if (this.TunnelIdentifier < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TunnelIdentifier", 0); + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionsDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionsDeleteHeaders.cs index 111134a7be40..cac81f2c43af 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionsDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceConnectionsDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class NetworkVirtualApplianceConnectionsDeleteHeaders { /// - /// Initializes a new instance of the - /// NetworkVirtualApplianceConnectionsDeleteHeaders class. + /// Initializes a new instance of the NetworkVirtualApplianceConnectionsDeleteHeaders class. /// public NetworkVirtualApplianceConnectionsDeleteHeaders() { @@ -28,14 +18,15 @@ public NetworkVirtualApplianceConnectionsDeleteHeaders() } /// - /// Initializes a new instance of the - /// NetworkVirtualApplianceConnectionsDeleteHeaders class. + /// Initializes a new instance of the NetworkVirtualApplianceConnectionsDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public NetworkVirtualApplianceConnectionsDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public NetworkVirtualApplianceConnectionsDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancePropertiesFormat.cs new file mode 100644 index 000000000000..ca084d9cb1bf --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancePropertiesFormat.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Network Virtual Appliance definition. + /// + public partial class NetworkVirtualAppliancePropertiesFormat + { + /// + /// Initializes a new instance of the NetworkVirtualAppliancePropertiesFormat class. + /// + public NetworkVirtualAppliancePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkVirtualAppliancePropertiesFormat class. + /// + + /// Network Virtual Appliance SKU. + /// + + /// Address Prefix. + /// + + /// BootStrapConfigurationBlobs storage URLs. + /// + + /// The Virtual Hub where Network Virtual Appliance is being deployed. + /// + + /// CloudInitConfigurationBlob storage URLs. + /// + + /// CloudInitConfiguration string in plain text. + /// + + /// VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are + /// not supported. + /// + + /// Public key for SSH login. + /// + + /// List of Virtual Appliance Network Interfaces. + /// + + /// Details required for Additional Network Interface. + /// + + /// List of Resource Uri of Public IPs for Internet Ingress Scenario. + /// + + /// List of references to VirtualApplianceSite. + /// + + /// List of references to VirtualApplianceConnections. + /// + + /// List of references to InboundSecurityRules. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The deployment type. PartnerManaged for the SaaS NVA + /// + + /// The delegation for the Virtual Appliance + /// + + /// The delegation for the Virtual Appliance + /// + public NetworkVirtualAppliancePropertiesFormat(VirtualApplianceSkuProperties nvaSku = default(VirtualApplianceSkuProperties), string addressPrefix = default(string), System.Collections.Generic.IList bootStrapConfigurationBlobs = default(System.Collections.Generic.IList), SubResource virtualHub = default(SubResource), System.Collections.Generic.IList cloudInitConfigurationBlobs = default(System.Collections.Generic.IList), string cloudInitConfiguration = default(string), long? virtualApplianceAsn = default(long?), string sshPublicKey = default(string), System.Collections.Generic.IList virtualApplianceNics = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalNics = default(System.Collections.Generic.IList), System.Collections.Generic.IList internetIngressPublicIps = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualApplianceSites = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualApplianceConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundSecurityRules = default(System.Collections.Generic.IList), string provisioningState = default(string), string deploymentType = default(string), DelegationProperties delegation = default(DelegationProperties), PartnerManagedResourceProperties partnerManagedResource = default(PartnerManagedResourceProperties)) + + { + this.NvaSku = nvaSku; + this.AddressPrefix = addressPrefix; + this.BootStrapConfigurationBlobs = bootStrapConfigurationBlobs; + this.VirtualHub = virtualHub; + this.CloudInitConfigurationBlobs = cloudInitConfigurationBlobs; + this.CloudInitConfiguration = cloudInitConfiguration; + this.VirtualApplianceAsn = virtualApplianceAsn; + this.SshPublicKey = sshPublicKey; + this.VirtualApplianceNics = virtualApplianceNics; + this.AdditionalNics = additionalNics; + this.InternetIngressPublicIps = internetIngressPublicIps; + this.VirtualApplianceSites = virtualApplianceSites; + this.VirtualApplianceConnections = virtualApplianceConnections; + this.InboundSecurityRules = inboundSecurityRules; + this.ProvisioningState = provisioningState; + this.DeploymentType = deploymentType; + this.Delegation = delegation; + this.PartnerManagedResource = partnerManagedResource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets network Virtual Appliance SKU. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nvaSku")] + public VirtualApplianceSkuProperties NvaSku {get; set; } + + /// + /// Gets address Prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; private set; } + + /// + /// Gets or sets bootStrapConfigurationBlobs storage URLs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bootStrapConfigurationBlobs")] + public System.Collections.Generic.IList BootStrapConfigurationBlobs {get; set; } + + /// + /// Gets or sets the Virtual Hub where Network Virtual Appliance is being + /// deployed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHub")] + public SubResource VirtualHub {get; set; } + + /// + /// Gets or sets cloudInitConfigurationBlob storage URLs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cloudInitConfigurationBlobs")] + public System.Collections.Generic.IList CloudInitConfigurationBlobs {get; set; } + + /// + /// Gets or sets cloudInitConfiguration string in plain text. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cloudInitConfiguration")] + public string CloudInitConfiguration {get; set; } + + /// + /// Gets or sets virtualAppliance ASN. Microsoft private, public and IANA + /// reserved ASN are not supported. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualApplianceAsn")] + public long? VirtualApplianceAsn {get; set; } + + /// + /// Gets or sets public key for SSH login. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sshPublicKey")] + public string SshPublicKey {get; set; } + + /// + /// Gets list of Virtual Appliance Network Interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualApplianceNics")] + public System.Collections.Generic.IList VirtualApplianceNics {get; private set; } + + /// + /// Gets or sets details required for Additional Network Interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalNics")] + public System.Collections.Generic.IList AdditionalNics {get; set; } + + /// + /// Gets or sets list of Resource Uri of Public IPs for Internet Ingress + /// Scenario. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "internetIngressPublicIps")] + public System.Collections.Generic.IList InternetIngressPublicIps {get; set; } + + /// + /// Gets list of references to VirtualApplianceSite. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualApplianceSites")] + public System.Collections.Generic.IList VirtualApplianceSites {get; private set; } + + /// + /// Gets list of references to VirtualApplianceConnections. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualApplianceConnections")] + public System.Collections.Generic.IList VirtualApplianceConnections {get; private set; } + + /// + /// Gets list of references to InboundSecurityRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundSecurityRules")] + public System.Collections.Generic.IList InboundSecurityRules {get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the deployment type. PartnerManaged for the SaaS NVA + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentType")] + public string DeploymentType {get; private set; } + + /// + /// Gets or sets the delegation for the Virtual Appliance + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "delegation")] + public DelegationProperties Delegation {get; set; } + + /// + /// Gets or sets the delegation for the Virtual Appliance + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "partnerManagedResource")] + public PartnerManagedResourceProperties PartnerManagedResource {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + if (this.VirtualApplianceAsn != null) + { + if (this.VirtualApplianceAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "VirtualApplianceAsn", 4294967295); + } + if (this.VirtualApplianceAsn < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "VirtualApplianceAsn", 0); + } + } + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSku.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSku.cs index 754973541524..043fc0c6ce8a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSku.cs @@ -1,29 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Available NetworkVirtualApplianceSkus + /// Definition of the NetworkVirtualApplianceSkus resource. /// /// /// Definition of the NetworkVirtualApplianceSkus resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkVirtualApplianceSku : Resource { /// @@ -37,25 +27,41 @@ public NetworkVirtualApplianceSku() /// /// Initializes a new instance of the NetworkVirtualApplianceSku class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Network Virtual Appliance Sku vendor. - /// Available Network Virtual Appliance - /// versions. - /// The list of scale units - /// available. - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkVirtualApplianceSku(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string vendor = default(string), IList availableVersions = default(IList), IList availableScaleUnits = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Network Virtual Appliance Sku vendor. + /// + + /// Available Network Virtual Appliance versions. + /// + + /// The list of scale units available. + /// + public NetworkVirtualApplianceSku(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string vendor = default(string), System.Collections.Generic.IList availableVersions = default(System.Collections.Generic.IList), System.Collections.Generic.IList availableScaleUnits = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - Vendor = vendor; - AvailableVersions = availableVersions; - AvailableScaleUnits = availableScaleUnits; - Etag = etag; + this.Etag = etag; + this.Vendor = vendor; + this.AvailableVersions = availableVersions; + this.AvailableScaleUnits = availableScaleUnits; CustomInit(); } @@ -64,30 +70,30 @@ public NetworkVirtualApplianceSku() /// partial void CustomInit(); + /// - /// Gets network Virtual Appliance Sku vendor. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.vendor")] - public string Vendor { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets available Network Virtual Appliance versions. + /// Gets network Virtual Appliance Sku vendor. /// - [JsonProperty(PropertyName = "properties.availableVersions")] - public IList AvailableVersions { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vendor")] + public string Vendor {get; private set; } /// - /// Gets or sets the list of scale units available. + /// Gets available Network Virtual Appliance versions. /// - [JsonProperty(PropertyName = "properties.availableScaleUnits")] - public IList AvailableScaleUnits { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availableVersions")] + public System.Collections.Generic.IList AvailableVersions {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the list of scale units available. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availableScaleUnits")] + public System.Collections.Generic.IList AvailableScaleUnits {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuInstances.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuInstances.cs index e5f6a041f72a..7294d94fac2c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuInstances.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuInstances.cs @@ -1,20 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Network Virtual Appliance Sku Instances + /// List of available Sku and instances. /// /// /// List of available Sku and instances. @@ -22,8 +16,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class NetworkVirtualApplianceSkuInstances { /// - /// Initializes a new instance of the - /// NetworkVirtualApplianceSkuInstances class. + /// Initializes a new instance of the NetworkVirtualApplianceSkuInstances class. /// public NetworkVirtualApplianceSkuInstances() { @@ -31,15 +24,19 @@ public NetworkVirtualApplianceSkuInstances() } /// - /// Initializes a new instance of the - /// NetworkVirtualApplianceSkuInstances class. + /// Initializes a new instance of the NetworkVirtualApplianceSkuInstances class. /// - /// Scale Unit. - /// Instance Count. + + /// Scale Unit. + /// + + /// Instance Count. + /// public NetworkVirtualApplianceSkuInstances(string scaleUnit = default(string), int? instanceCount = default(int?)) + { - ScaleUnit = scaleUnit; - InstanceCount = instanceCount; + this.ScaleUnit = scaleUnit; + this.InstanceCount = instanceCount; CustomInit(); } @@ -48,17 +45,17 @@ public NetworkVirtualApplianceSkuInstances() /// partial void CustomInit(); + /// /// Gets scale Unit. /// - [JsonProperty(PropertyName = "scaleUnit")] - public string ScaleUnit { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleUnit")] + public string ScaleUnit {get; private set; } /// /// Gets instance Count. /// - [JsonProperty(PropertyName = "instanceCount")] - public int? InstanceCount { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceCount")] + public int? InstanceCount {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuPropertiesFormat.cs new file mode 100644 index 000000000000..b3bfe1c906bd --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualApplianceSkuPropertiesFormat.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties specific to NetworkVirtualApplianceSkus. + /// + /// + /// Properties specific to NetworkVirtualApplianceSkus. + /// + public partial class NetworkVirtualApplianceSkuPropertiesFormat + { + /// + /// Initializes a new instance of the NetworkVirtualApplianceSkuPropertiesFormat class. + /// + public NetworkVirtualApplianceSkuPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkVirtualApplianceSkuPropertiesFormat class. + /// + + /// Network Virtual Appliance Sku vendor. + /// + + /// Available Network Virtual Appliance versions. + /// + + /// The list of scale units available. + /// + public NetworkVirtualApplianceSkuPropertiesFormat(string vendor = default(string), System.Collections.Generic.IList availableVersions = default(System.Collections.Generic.IList), System.Collections.Generic.IList availableScaleUnits = default(System.Collections.Generic.IList)) + + { + this.Vendor = vendor; + this.AvailableVersions = availableVersions; + this.AvailableScaleUnits = availableScaleUnits; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets network Virtual Appliance Sku vendor. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vendor")] + public string Vendor {get; private set; } + + /// + /// Gets available Network Virtual Appliance versions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availableVersions")] + public System.Collections.Generic.IList AvailableVersions {get; private set; } + + /// + /// Gets or sets the list of scale units available. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availableScaleUnits")] + public System.Collections.Generic.IList AvailableScaleUnits {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesCreateOrUpdateHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesCreateOrUpdateHeaders.cs index 93349a5c4d02..ec9ae5e49f98 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesCreateOrUpdateHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class NetworkVirtualAppliancesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// NetworkVirtualAppliancesCreateOrUpdateHeaders class. + /// Initializes a new instance of the NetworkVirtualAppliancesCreateOrUpdateHeaders class. /// public NetworkVirtualAppliancesCreateOrUpdateHeaders() { @@ -28,14 +18,15 @@ public NetworkVirtualAppliancesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// NetworkVirtualAppliancesCreateOrUpdateHeaders class. + /// Initializes a new instance of the NetworkVirtualAppliancesCreateOrUpdateHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public NetworkVirtualAppliancesCreateOrUpdateHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public NetworkVirtualAppliancesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesDeleteHeaders.cs index 964afbc21471..7b1f87fac06f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkVirtualAppliancesDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class NetworkVirtualAppliancesDeleteHeaders { /// - /// Initializes a new instance of the - /// NetworkVirtualAppliancesDeleteHeaders class. + /// Initializes a new instance of the NetworkVirtualAppliancesDeleteHeaders class. /// public NetworkVirtualAppliancesDeleteHeaders() { @@ -28,14 +18,15 @@ public NetworkVirtualAppliancesDeleteHeaders() } /// - /// Initializes a new instance of the - /// NetworkVirtualAppliancesDeleteHeaders class. + /// Initializes a new instance of the NetworkVirtualAppliancesDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public NetworkVirtualAppliancesDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public NetworkVirtualAppliancesDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcher.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcher.cs index 71026bf598c0..f63ca824a9f7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcher.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcher.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network watcher in a resource group. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkWatcher : Resource { /// @@ -34,21 +24,33 @@ public NetworkWatcher() /// /// Initializes a new instance of the NetworkWatcher class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The provisioning state of the - /// network watcher resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - public NetworkWatcher(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string provisioningState = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the network watcher resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public NetworkWatcher(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string)) + + : base(id, name, type, location, tags) { - Etag = etag; - ProvisioningState = provisioningState; + this.Etag = etag; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -57,20 +59,18 @@ public NetworkWatcher() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the network watcher resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the network watcher resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcherPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcherPropertiesFormat.cs new file mode 100644 index 000000000000..72c07253408b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/NetworkWatcherPropertiesFormat.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// The network watcher properties. + /// + public partial class NetworkWatcherPropertiesFormat + { + /// + /// Initializes a new instance of the NetworkWatcherPropertiesFormat class. + /// + public NetworkWatcherPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkWatcherPropertiesFormat class. + /// + + /// The provisioning state of the network watcher resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public NetworkWatcherPropertiesFormat(string provisioningState = default(string)) + + { + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the network watcher resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NextHopParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/NextHopParameters.cs index 83b9f249e951..79da51a36694 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NextHopParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NextHopParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,21 +23,27 @@ public NextHopParameters() /// /// Initializes a new instance of the NextHopParameters class. /// - /// The resource identifier of the - /// target resource against which the action is to be - /// performed. - /// The source IP address. - /// The destination IP - /// address. - /// 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). + + /// The resource identifier of the target resource against which the action is + /// to be performed. + /// + + /// The source IP address. + /// + + /// The destination IP address. + /// + + /// 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). + /// public NextHopParameters(string targetResourceId, string sourceIPAddress, string destinationIPAddress, string targetNicResourceId = default(string)) + { - TargetResourceId = targetResourceId; - SourceIPAddress = sourceIPAddress; - DestinationIPAddress = destinationIPAddress; - TargetNicResourceId = targetNicResourceId; + this.TargetResourceId = targetResourceId; + this.SourceIPAddress = sourceIPAddress; + this.DestinationIPAddress = destinationIPAddress; + this.TargetNicResourceId = targetNicResourceId; CustomInit(); } @@ -53,53 +52,57 @@ public NextHopParameters() /// partial void CustomInit(); + /// - /// Gets or sets the resource identifier of the target resource against - /// which the action is to be performed. + /// Gets or sets the resource identifier of the target resource against which + /// the action is to be performed. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// /// Gets or sets the source IP address. /// - [JsonProperty(PropertyName = "sourceIPAddress")] - public string SourceIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIPAddress")] + public string SourceIPAddress {get; set; } /// /// Gets or sets the destination IP address. /// - [JsonProperty(PropertyName = "destinationIPAddress")] - public string DestinationIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationIPAddress")] + public string DestinationIPAddress {get; set; } /// - /// Gets or sets 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). + /// Gets or sets 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). /// - [JsonProperty(PropertyName = "targetNicResourceId")] - public string TargetNicResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetNicResourceId")] + public string TargetNicResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } - if (SourceIPAddress == null) + if (this.SourceIPAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceIPAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceIPAddress"); } - if (DestinationIPAddress == null) + if (this.DestinationIPAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationIPAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationIPAddress"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NextHopResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/NextHopResult.cs index ce378eaa4dec..c1d4c4f0bc28 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NextHopResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NextHopResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,24 @@ public NextHopResult() /// /// Initializes a new instance of the NextHopResult class. /// - /// Next hop type. Possible values include: - /// 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', - /// 'VnetLocal', 'HyperNetGateway', 'None' - /// Next hop IP Address. - /// 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'. - public NextHopResult(string nextHopType = default(string), string nextHopIpAddress = default(string), string routeTableId = default(string)) + + /// Next hop type. + /// Possible values include: 'Internet', 'VirtualAppliance', + /// 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None' + + /// Next hop IP Address. + /// + + /// 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'. + /// + public NextHopResult(string nextHopType = default(string), string nextHopIPAddress = default(string), string routeTableId = default(string)) + { - NextHopType = nextHopType; - NextHopIpAddress = nextHopIpAddress; - RouteTableId = routeTableId; + this.NextHopType = nextHopType; + this.NextHopIPAddress = nextHopIPAddress; + this.RouteTableId = routeTableId; CustomInit(); } @@ -50,28 +49,26 @@ public NextHopResult() /// partial void CustomInit(); + /// - /// Gets or sets next hop type. Possible values include: 'Internet', - /// 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', - /// 'HyperNetGateway', 'None' + /// Gets or sets next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None' /// - [JsonProperty(PropertyName = "nextHopType")] - public string NextHopType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + public string NextHopType {get; set; } /// /// Gets or sets next hop IP Address. /// - [JsonProperty(PropertyName = "nextHopIpAddress")] - public string NextHopIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] + public string NextHopIPAddress {get; set; } /// - /// Gets or sets 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'. + /// Gets or sets 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'. /// - [JsonProperty(PropertyName = "routeTableId")] - public string RouteTableId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "routeTableId")] + public string RouteTableId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NextHopType.cs b/src/Network/Network.Management.Sdk/Generated/Models/NextHopType.cs index dd41eaeaeb7a..14d5dcd1dc60 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NextHopType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NextHopType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NextHopType. /// + + public static class NextHopType { public const string Internet = "Internet"; @@ -23,4 +20,4 @@ public static class NextHopType public const string HyperNetGateway = "HyperNetGateway"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/NextStep.cs b/src/Network/Network.Management.Sdk/Generated/Models/NextStep.cs index 375aa05e5633..a3eb86e873f9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/NextStep.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/NextStep.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for NextStep. /// + + public static class NextStep { public const string Unknown = "Unknown"; public const string Continue = "Continue"; public const string Terminate = "Terminate"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/O365BreakOutCategoryPolicies.cs b/src/Network/Network.Management.Sdk/Generated/Models/O365BreakOutCategoryPolicies.cs index 3281a1c1a04d..4754f172cae4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/O365BreakOutCategoryPolicies.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/O365BreakOutCategoryPolicies.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class O365BreakOutCategoryPolicies { /// - /// Initializes a new instance of the O365BreakOutCategoryPolicies - /// class. + /// Initializes a new instance of the O365BreakOutCategoryPolicies class. /// public O365BreakOutCategoryPolicies() { @@ -28,18 +21,23 @@ public O365BreakOutCategoryPolicies() } /// - /// Initializes a new instance of the O365BreakOutCategoryPolicies - /// class. + /// Initializes a new instance of the O365BreakOutCategoryPolicies class. /// - /// Flag to control allow category. - /// Flag to control optimize category. - /// Flag to control default - /// category. + + /// Flag to control allow category. + /// + + /// Flag to control optimize category. + /// + + /// Flag to control default category. + /// public O365BreakOutCategoryPolicies(bool? allow = default(bool?), bool? optimize = default(bool?), bool? defaultProperty = default(bool?)) + { - Allow = allow; - Optimize = optimize; - DefaultProperty = defaultProperty; + this.Allow = allow; + this.Optimize = optimize; + this.DefaultProperty = defaultProperty; CustomInit(); } @@ -48,23 +46,23 @@ public O365BreakOutCategoryPolicies() /// partial void CustomInit(); + /// /// Gets or sets flag to control allow category. /// - [JsonProperty(PropertyName = "allow")] - public bool? Allow { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "allow")] + public bool? Allow {get; set; } /// /// Gets or sets flag to control optimize category. /// - [JsonProperty(PropertyName = "optimize")] - public bool? Optimize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "optimize")] + public bool? Optimize {get; set; } /// /// Gets or sets flag to control default category. /// - [JsonProperty(PropertyName = "default")] - public bool? DefaultProperty { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + public bool? DefaultProperty {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/O365PolicyProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/O365PolicyProperties.cs index 011a7fab3a40..d8d6b4f2b143 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/O365PolicyProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/O365PolicyProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public O365PolicyProperties() /// /// Initializes a new instance of the O365PolicyProperties class. /// - /// Office365 breakout - /// categories. + + /// Office365 breakout categories. + /// public O365PolicyProperties(O365BreakOutCategoryPolicies breakOutCategories = default(O365BreakOutCategoryPolicies)) + { - BreakOutCategories = breakOutCategories; + this.BreakOutCategories = breakOutCategories; CustomInit(); } @@ -42,11 +38,11 @@ public O365PolicyProperties() /// partial void CustomInit(); + /// /// Gets or sets office365 breakout categories. /// - [JsonProperty(PropertyName = "breakOutCategories")] - public O365BreakOutCategoryPolicies BreakOutCategories { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "breakOutCategories")] + public O365BreakOutCategoryPolicies BreakOutCategories {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Office365PolicyProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/Office365PolicyProperties.cs index effe5378ce1a..1fab1248c44a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Office365PolicyProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Office365PolicyProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public Office365PolicyProperties() /// /// Initializes a new instance of the Office365PolicyProperties class. /// - /// Office 365 breakout - /// categories. + + /// Office 365 breakout categories. + /// public Office365PolicyProperties(BreakOutCategoryPolicies breakOutCategories = default(BreakOutCategoryPolicies)) + { - BreakOutCategories = breakOutCategories; + this.BreakOutCategories = breakOutCategories; CustomInit(); } @@ -42,11 +38,11 @@ public Office365PolicyProperties() /// partial void CustomInit(); + /// /// Gets or sets office 365 breakout categories. /// - [JsonProperty(PropertyName = "breakOutCategories")] - public BreakOutCategoryPolicies BreakOutCategories { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "breakOutCategories")] + public BreakOutCategoryPolicies BreakOutCategories {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OfficeTrafficCategory.cs b/src/Network/Network.Management.Sdk/Generated/Models/OfficeTrafficCategory.cs index 1107947c2a84..539575b1d807 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OfficeTrafficCategory.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OfficeTrafficCategory.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for OfficeTrafficCategory. /// + + public static class OfficeTrafficCategory { public const string Optimize = "Optimize"; @@ -21,4 +18,4 @@ public static class OfficeTrafficCategory public const string All = "All"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Operation.cs b/src/Network/Network.Management.Sdk/Generated/Models/Operation.cs index 45b35bd0c962..dbeb93084adf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Operation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Operation.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Network REST API operation definition. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Operation { /// @@ -32,19 +24,25 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Operation name: - /// {provider}/{resource}/{operation}. - /// Display metadata associated with the - /// operation. - /// Origin of the operation. - /// Specification of the - /// service. + + /// Operation name: {provider}/{resource}/{operation}. + /// + + /// Display metadata associated with the operation. + /// + + /// Origin of the operation. + /// + + /// Specification of the service. + /// public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string), OperationPropertiesFormatServiceSpecification serviceSpecification = default(OperationPropertiesFormatServiceSpecification)) + { - Name = name; - Display = display; - Origin = origin; - ServiceSpecification = serviceSpecification; + this.Name = name; + this.Display = display; + this.Origin = origin; + this.ServiceSpecification = serviceSpecification; CustomInit(); } @@ -53,29 +51,29 @@ public Operation() /// partial void CustomInit(); + /// /// Gets or sets operation name: {provider}/{resource}/{operation}. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets display metadata associated with the operation. /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } /// /// Gets or sets origin of the operation. /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; set; } /// /// Gets or sets specification of the service. /// - [JsonProperty(PropertyName = "properties.serviceSpecification")] - public OperationPropertiesFormatServiceSpecification ServiceSpecification { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceSpecification")] + public OperationPropertiesFormatServiceSpecification ServiceSpecification {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/Network/Network.Management.Sdk/Generated/Models/OperationDisplay.cs index 5a136d7288a8..6c44548272e3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OperationDisplay.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: Microsoft Network. - /// Resource on which the operation is - /// performed. - /// Type of the operation: get, read, delete, - /// etc. - /// Description of the operation. + + /// Service provider: Microsoft Network. + /// + + /// Resource on which the operation is performed. + /// + + /// Type of the operation: get, read, delete, etc. + /// + + /// Description of the operation. + /// public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -49,29 +50,29 @@ public OperationDisplay() /// partial void CustomInit(); + /// /// Gets or sets service provider: Microsoft Network. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets resource on which the operation is performed. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// /// Gets or sets type of the operation: get, read, delete, etc. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets description of the operation. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormat.cs new file mode 100644 index 000000000000..43fcbbff1801 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormat.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Description of operation properties format. + /// + public partial class OperationPropertiesFormat + { + /// + /// Initializes a new instance of the OperationPropertiesFormat class. + /// + public OperationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationPropertiesFormat class. + /// + + /// Specification of the service. + /// + public OperationPropertiesFormat(OperationPropertiesFormatServiceSpecification serviceSpecification = default(OperationPropertiesFormatServiceSpecification)) + + { + this.ServiceSpecification = serviceSpecification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specification of the service. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceSpecification")] + public OperationPropertiesFormatServiceSpecification ServiceSpecification {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormatServiceSpecification.cs b/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormatServiceSpecification.cs index a29f7063f660..cacfef5ae6cf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormatServiceSpecification.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OperationPropertiesFormatServiceSpecification.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class OperationPropertiesFormatServiceSpecification { /// - /// Initializes a new instance of the - /// OperationPropertiesFormatServiceSpecification class. + /// Initializes a new instance of the OperationPropertiesFormatServiceSpecification class. /// public OperationPropertiesFormatServiceSpecification() { @@ -30,17 +21,19 @@ public OperationPropertiesFormatServiceSpecification() } /// - /// Initializes a new instance of the - /// OperationPropertiesFormatServiceSpecification class. + /// Initializes a new instance of the OperationPropertiesFormatServiceSpecification class. /// - /// Operation service - /// specification. - /// Operation log - /// specification. - public OperationPropertiesFormatServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) + + /// Operation service specification. + /// + + /// Operation log specification. + /// + public OperationPropertiesFormatServiceSpecification(System.Collections.Generic.IList metricSpecifications = default(System.Collections.Generic.IList), System.Collections.Generic.IList logSpecifications = default(System.Collections.Generic.IList)) + { - MetricSpecifications = metricSpecifications; - LogSpecifications = logSpecifications; + this.MetricSpecifications = metricSpecifications; + this.LogSpecifications = logSpecifications; CustomInit(); } @@ -49,17 +42,17 @@ public OperationPropertiesFormatServiceSpecification() /// partial void CustomInit(); + /// /// Gets or sets operation service specification. /// - [JsonProperty(PropertyName = "metricSpecifications")] - public IList MetricSpecifications { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "metricSpecifications")] + public System.Collections.Generic.IList MetricSpecifications {get; set; } /// /// Gets or sets operation log specification. /// - [JsonProperty(PropertyName = "logSpecifications")] - public IList LogSpecifications { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "logSpecifications")] + public System.Collections.Generic.IList LogSpecifications {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OrderBy.cs b/src/Network/Network.Management.Sdk/Generated/Models/OrderBy.cs index 6c210bf4ac42..d387842ed4b3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OrderBy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OrderBy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,17 @@ public OrderBy() /// /// Initializes a new instance of the OrderBy class. /// - /// Describes the actual column name to sort - /// by - /// Describes if results should be in - /// ascending/descending order. Possible values include: 'Ascending', - /// 'Descending' + + /// Describes the actual column name to sort by + /// + + /// Describes if results should be in ascending/descending order + /// Possible values include: 'Ascending', 'Descending' public OrderBy(string field = default(string), string order = default(string)) + { - Field = field; - Order = order; + this.Field = field; + this.Order = order; CustomInit(); } @@ -46,18 +42,17 @@ public OrderBy() /// partial void CustomInit(); + /// /// Gets or sets describes the actual column name to sort by /// - [JsonProperty(PropertyName = "field")] - public string Field { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "field")] + public string Field {get; set; } /// - /// Gets or sets describes if results should be in ascending/descending - /// order. Possible values include: 'Ascending', 'Descending' + /// Gets or sets describes if results should be in ascending/descending order Possible values include: 'Ascending', 'Descending' /// - [JsonProperty(PropertyName = "order")] - public string Order { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "order")] + public string Order {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Origin.cs b/src/Network/Network.Management.Sdk/Generated/Models/Origin.cs index 2836a3ed8da8..d850a9006173 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Origin.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Origin.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for Origin. /// + + public static class Origin { public const string Local = "Local"; public const string Inbound = "Inbound"; public const string Outbound = "Outbound"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OutboundRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/OutboundRule.cs index 19756980c601..0277e881cf83 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OutboundRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OutboundRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Outbound rule of the load balancer. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class OutboundRule : SubResource { /// @@ -34,43 +24,57 @@ public OutboundRule() /// /// Initializes a new instance of the OutboundRule class. /// - /// The Frontend IP addresses of - /// the load balancer. - /// A reference to a pool of DIPs. - /// Outbound traffic is randomly load balanced across IPs in the - /// backend IPs. - /// The protocol for the outbound rule in load - /// balancer. Possible values include: 'Tcp', 'Udp', 'All' - /// Resource ID. - /// The number of outbound ports - /// to be used for NAT. - /// The provisioning state of the - /// outbound rule resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// 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. - /// The timeout for the TCP idle - /// connection. - /// The name of the resource that is unique within - /// the set of outbound rules used by the load balancer. This name can - /// be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public OutboundRule(IList frontendIPConfigurations, SubResource backendAddressPool, string protocol, string id = default(string), int? allocatedOutboundPorts = default(int?), string provisioningState = default(string), bool? enableTcpReset = default(bool?), int? idleTimeoutInMinutes = default(int?), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of outbound rules + /// used by the load balancer. This name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the outbound rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The number of outbound ports to be used for NAT. + /// + + /// The Frontend IP addresses of the load balancer. + /// + + /// A reference to a pool of DIPs. Outbound traffic is randomly load balanced + /// across IPs in the backend IPs. + /// + + /// The protocol for the outbound rule in load balancer. + /// Possible values include: 'Tcp', 'Udp', 'All' + + /// 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. + /// + + /// The timeout for the TCP idle connection. + /// + public OutboundRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), int? allocatedOutboundPorts = default(int?), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), SubResource backendAddressPool = default(SubResource), string protocol = default(string), bool? enableTcpReset = default(bool?), int? idleTimeoutInMinutes = default(int?)) + + : base(id) { - AllocatedOutboundPorts = allocatedOutboundPorts; - FrontendIPConfigurations = frontendIPConfigurations; - BackendAddressPool = backendAddressPool; - ProvisioningState = provisioningState; - Protocol = protocol; - EnableTcpReset = enableTcpReset; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AllocatedOutboundPorts = allocatedOutboundPorts; + this.FrontendIPConfigurations = frontendIPConfigurations; + this.BackendAddressPool = backendAddressPool; + this.Protocol = protocol; + this.EnableTcpReset = enableTcpReset; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; CustomInit(); } @@ -79,94 +83,71 @@ public OutboundRule() /// partial void CustomInit(); - /// - /// Gets or sets the number of outbound ports to be used for NAT. - /// - [JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] - public int? AllocatedOutboundPorts { get; set; } /// - /// Gets or sets the Frontend IP addresses of the load balancer. + /// Gets or sets the name of the resource that is unique within the set of + /// outbound rules used by the load balancer. This name can be used to access + /// the resource. /// - [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets a reference to a pool of DIPs. Outbound traffic is - /// randomly load balanced across IPs in the backend IPs. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] - public SubResource BackendAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the outbound rule resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the protocol for the outbound rule in load balancer. - /// Possible values include: 'Tcp', 'Udp', 'All' + /// Gets the provisioning state of the outbound rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets 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. + /// Gets or sets the number of outbound ports to be used for NAT. /// - [JsonProperty(PropertyName = "properties.enableTcpReset")] - public bool? EnableTcpReset { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] + public int? AllocatedOutboundPorts {get; set; } /// - /// Gets or sets the timeout for the TCP idle connection. + /// Gets or sets the Frontend IP addresses of the load balancer. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of outbound rules used by the load balancer. This name can be used - /// to access the resource. + /// Gets or sets a reference to a pool of DIPs. Outbound traffic is randomly + /// load balanced across IPs in the backend IPs. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the protocol for the outbound rule in load balancer. Possible values include: 'Tcp', 'Udp', 'All' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets type of the resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset {get; set; } /// - /// Validate the object. + /// Gets or sets the timeout for the TCP idle connection. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (FrontendIPConfigurations == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "FrontendIPConfigurations"); - } - if (BackendAddressPool == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "BackendAddressPool"); - } - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OutboundRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/OutboundRulePropertiesFormat.cs new file mode 100644 index 000000000000..51bb781809f7 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/OutboundRulePropertiesFormat.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Outbound rule of the load balancer. + /// + public partial class OutboundRulePropertiesFormat + { + /// + /// Initializes a new instance of the OutboundRulePropertiesFormat class. + /// + public OutboundRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OutboundRulePropertiesFormat class. + /// + + /// The number of outbound ports to be used for NAT. + /// + + /// The Frontend IP addresses of the load balancer. + /// + + /// A reference to a pool of DIPs. Outbound traffic is randomly load balanced + /// across IPs in the backend IPs. + /// + + /// The provisioning state of the outbound rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The protocol for the outbound rule in load balancer. + /// Possible values include: 'Tcp', 'Udp', 'All' + + /// 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. + /// + + /// The timeout for the TCP idle connection. + /// + public OutboundRulePropertiesFormat(System.Collections.Generic.IList frontendIPConfigurations, SubResource backendAddressPool, string protocol, int? allocatedOutboundPorts = default(int?), string provisioningState = default(string), bool? enableTcpReset = default(bool?), int? idleTimeoutInMinutes = default(int?)) + + { + this.AllocatedOutboundPorts = allocatedOutboundPorts; + this.FrontendIPConfigurations = frontendIPConfigurations; + this.BackendAddressPool = backendAddressPool; + this.ProvisioningState = provisioningState; + this.Protocol = protocol; + this.EnableTcpReset = enableTcpReset; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the number of outbound ports to be used for NAT. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allocatedOutboundPorts")] + public int? AllocatedOutboundPorts {get; set; } + + /// + /// Gets or sets the Frontend IP addresses of the load balancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations {get; set; } + + /// + /// Gets or sets a reference to a pool of DIPs. Outbound traffic is randomly + /// load balanced across IPs in the backend IPs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + public SubResource BackendAddressPool {get; set; } + + /// + /// Gets the provisioning state of the outbound rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the protocol for the outbound rule in load balancer. Possible values include: 'Tcp', 'Udp', 'All' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableTcpReset")] + public bool? EnableTcpReset {get; set; } + + /// + /// Gets or sets the timeout for the TCP idle connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.FrontendIPConfigurations == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FrontendIPConfigurations"); + } + if (this.BackendAddressPool == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "BackendAddressPool"); + } + if (this.Protocol == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OutputType.cs b/src/Network/Network.Management.Sdk/Generated/Models/OutputType.cs index c6a03895479e..bc760a3730c4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OutputType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OutputType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for OutputType. /// + + public static class OutputType { public const string Workspace = "Workspace"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntry.cs b/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntry.cs index 16f31f9e79c6..a2f457cdb6bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntry.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntry.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,26 +23,31 @@ public OwaspCrsExclusionEntry() /// /// Initializes a new instance of the OwaspCrsExclusionEntry class. /// - /// The variable to be excluded. Possible - /// values include: 'RequestHeaderNames', 'RequestCookieNames', - /// 'RequestArgNames', 'RequestHeaderKeys', 'RequestHeaderValues', - /// 'RequestCookieKeys', 'RequestCookieValues', 'RequestArgKeys', - /// 'RequestArgValues' - /// When matchVariable is a - /// collection, operate on the selector to specify which elements in - /// the collection this exclusion applies to. Possible values include: - /// 'Equals', 'Contains', 'StartsWith', 'EndsWith', 'EqualsAny' - /// When matchVariable is a collection, operator - /// used to specify which elements in the collection this exclusion - /// applies to. - /// The managed rule sets that - /// are associated with the exclusion. - public OwaspCrsExclusionEntry(string matchVariable, string selectorMatchOperator, string selector, IList exclusionManagedRuleSets = default(IList)) + + /// The variable to be excluded. + /// Possible values include: 'RequestHeaderNames', 'RequestCookieNames', + /// 'RequestArgNames', 'RequestHeaderKeys', 'RequestHeaderValues', + /// 'RequestCookieKeys', 'RequestCookieValues', 'RequestArgKeys', + /// 'RequestArgValues' + + /// When matchVariable is a collection, operate on the selector to specify + /// which elements in the collection this exclusion applies to. + /// Possible values include: 'Equals', 'Contains', 'StartsWith', 'EndsWith', + /// 'EqualsAny' + + /// When matchVariable is a collection, operator used to specify which elements + /// in the collection this exclusion applies to. + /// + + /// The managed rule sets that are associated with the exclusion. + /// + public OwaspCrsExclusionEntry(string matchVariable, string selectorMatchOperator, string selector, System.Collections.Generic.IList exclusionManagedRuleSets = default(System.Collections.Generic.IList)) + { - MatchVariable = matchVariable; - SelectorMatchOperator = selectorMatchOperator; - Selector = selector; - ExclusionManagedRuleSets = exclusionManagedRuleSets; + this.MatchVariable = matchVariable; + this.SelectorMatchOperator = selectorMatchOperator; + this.Selector = selector; + this.ExclusionManagedRuleSets = exclusionManagedRuleSets; CustomInit(); } @@ -60,61 +56,58 @@ public OwaspCrsExclusionEntry() /// partial void CustomInit(); + /// - /// Gets or sets the variable to be excluded. Possible values include: - /// 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames', - /// 'RequestHeaderKeys', 'RequestHeaderValues', 'RequestCookieKeys', - /// 'RequestCookieValues', 'RequestArgKeys', 'RequestArgValues' + /// Gets or sets the variable to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames', 'RequestHeaderKeys', 'RequestHeaderValues', 'RequestCookieKeys', 'RequestCookieValues', 'RequestArgKeys', 'RequestArgValues' /// - [JsonProperty(PropertyName = "matchVariable")] - public string MatchVariable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchVariable")] + public string MatchVariable {get; set; } /// - /// Gets or sets when matchVariable is a collection, operate on the - /// selector to specify which elements in the collection this exclusion - /// applies to. Possible values include: 'Equals', 'Contains', - /// 'StartsWith', 'EndsWith', 'EqualsAny' + /// Gets or sets when matchVariable is a collection, operate on the selector to + /// specify which elements in the collection this exclusion applies to. Possible values include: 'Equals', 'Contains', 'StartsWith', 'EndsWith', 'EqualsAny' /// - [JsonProperty(PropertyName = "selectorMatchOperator")] - public string SelectorMatchOperator { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "selectorMatchOperator")] + public string SelectorMatchOperator {get; set; } /// - /// Gets or sets when matchVariable is a collection, operator used to - /// specify which elements in the collection this exclusion applies to. + /// Gets or sets when matchVariable is a collection, operator used to specify + /// which elements in the collection this exclusion applies to. /// - [JsonProperty(PropertyName = "selector")] - public string Selector { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "selector")] + public string Selector {get; set; } /// - /// Gets or sets the managed rule sets that are associated with the - /// exclusion. + /// Gets or sets the managed rule sets that are associated with the exclusion. /// - [JsonProperty(PropertyName = "exclusionManagedRuleSets")] - public IList ExclusionManagedRuleSets { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "exclusionManagedRuleSets")] + public System.Collections.Generic.IList ExclusionManagedRuleSets {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MatchVariable == null) + if (this.MatchVariable == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchVariable"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MatchVariable"); } - if (SelectorMatchOperator == null) + if (this.SelectorMatchOperator == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SelectorMatchOperator"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SelectorMatchOperator"); } - if (Selector == null) + if (this.Selector == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Selector"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Selector"); } - if (ExclusionManagedRuleSets != null) + + + + if (this.ExclusionManagedRuleSets != null) { - foreach (var element in ExclusionManagedRuleSets) + foreach (var element in this.ExclusionManagedRuleSets) { if (element != null) { @@ -124,4 +117,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntryMatchVariable.cs b/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntryMatchVariable.cs index b5043e20d2bc..0d23017ec906 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntryMatchVariable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntryMatchVariable.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for OwaspCrsExclusionEntryMatchVariable. /// + + public static class OwaspCrsExclusionEntryMatchVariable { public const string RequestHeaderNames = "RequestHeaderNames"; @@ -26,4 +23,4 @@ public static class OwaspCrsExclusionEntryMatchVariable public const string RequestArgKeys = "RequestArgKeys"; public const string RequestArgValues = "RequestArgValues"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntrySelectorMatchOperator.cs b/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntrySelectorMatchOperator.cs index 0f0da5522c0d..6054b1df7c6b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntrySelectorMatchOperator.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/OwaspCrsExclusionEntrySelectorMatchOperator.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for OwaspCrsExclusionEntrySelectorMatchOperator. /// + + public static class OwaspCrsExclusionEntrySelectorMatchOperator { public const string Equals = "Equals"; @@ -22,4 +19,4 @@ public static class OwaspCrsExclusionEntrySelectorMatchOperator public const string EndsWith = "EndsWith"; public const string EqualsAny = "EqualsAny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfiguration.cs index f3d1ff14ca1f..ea68fefc4c56 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfiguration.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// P2SConnectionConfiguration Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class P2SConnectionConfiguration : SubResource { /// @@ -34,41 +24,51 @@ public P2SConnectionConfiguration() /// /// Initializes a new instance of the P2SConnectionConfiguration class. /// - /// Resource ID. - /// The reference to the address - /// space resource which represents Address space for P2S - /// VpnClient. - /// The Routing Configuration - /// indicating the associated and propagated route tables on this - /// connection. - /// Flag indicating whether the - /// enable internet security flag is turned on for the P2S Connections - /// or not. - /// List of - /// Configuration Policy Groups that this P2SConnectionConfiguration is - /// attached to. - /// List of - /// previous Configuration Policy Groups that this - /// P2SConnectionConfiguration was attached to. - /// The provisioning state of the - /// P2SConnectionConfiguration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public P2SConnectionConfiguration(string id = default(string), AddressSpace vpnClientAddressPool = default(AddressSpace), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), bool? enableInternetSecurity = default(bool?), IList configurationPolicyGroupAssociations = default(IList), IList previousConfigurationPolicyGroupAssociations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// The provisioning state of the P2SConnectionConfiguration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The reference to the address space resource which represents Address space + /// for P2S VpnClient. + /// + + /// Flag indicating whether the enable internet security flag is turned on for + /// the P2S Connections or not. + /// + + /// List of Configuration Policy Groups that this P2SConnectionConfiguration is + /// attached to. + /// + + /// List of previous Configuration Policy Groups that this + /// P2SConnectionConfiguration was attached to. + /// + public P2SConnectionConfiguration(string id = default(string), string name = default(string), string etag = default(string), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string provisioningState = default(string), AddressSpace vpnClientAddressPool = default(AddressSpace), bool? enableInternetSecurity = default(bool?), System.Collections.Generic.IList configurationPolicyGroupAssociations = default(System.Collections.Generic.IList), System.Collections.Generic.IList previousConfigurationPolicyGroupAssociations = default(System.Collections.Generic.IList)) + + : base(id) { - VpnClientAddressPool = vpnClientAddressPool; - RoutingConfiguration = routingConfiguration; - EnableInternetSecurity = enableInternetSecurity; - ConfigurationPolicyGroupAssociations = configurationPolicyGroupAssociations; - PreviousConfigurationPolicyGroupAssociations = previousConfigurationPolicyGroupAssociations; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.RoutingConfiguration = routingConfiguration; + this.ProvisioningState = provisioningState; + this.VpnClientAddressPool = vpnClientAddressPool; + this.EnableInternetSecurity = enableInternetSecurity; + this.ConfigurationPolicyGroupAssociations = configurationPolicyGroupAssociations; + this.PreviousConfigurationPolicyGroupAssociations = previousConfigurationPolicyGroupAssociations; CustomInit(); } @@ -77,62 +77,60 @@ public P2SConnectionConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the reference to the address space resource which - /// represents Address space for P2S VpnClient. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.vpnClientAddressPool")] - public AddressSpace VpnClientAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the Routing Configuration indicating the associated - /// and propagated route tables on this connection. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.routingConfiguration")] - public RoutingConfiguration RoutingConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets flag indicating whether the enable internet security - /// flag is turned on for the P2S Connections or not. + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. /// - [JsonProperty(PropertyName = "properties.enableInternetSecurity")] - public bool? EnableInternetSecurity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } /// - /// Gets list of Configuration Policy Groups that this - /// P2SConnectionConfiguration is attached to. + /// Gets the provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.configurationPolicyGroupAssociations")] - public IList ConfigurationPolicyGroupAssociations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets list of previous Configuration Policy Groups that this - /// P2SConnectionConfiguration was attached to. + /// Gets or sets the reference to the address space resource which represents + /// Address space for P2S VpnClient. /// - [JsonProperty(PropertyName = "properties.previousConfigurationPolicyGroupAssociations")] - public IList PreviousConfigurationPolicyGroupAssociations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientAddressPool")] + public AddressSpace VpnClientAddressPool {get; set; } /// - /// Gets the provisioning state of the P2SConnectionConfiguration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets flag indicating whether the enable internet security flag is + /// turned on for the P2S Connections or not. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets list of Configuration Policy Groups that this + /// P2SConnectionConfiguration is attached to. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.configurationPolicyGroupAssociations")] + public System.Collections.Generic.IList ConfigurationPolicyGroupAssociations {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets list of previous Configuration Policy Groups that this + /// P2SConnectionConfiguration was attached to. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.previousConfigurationPolicyGroupAssociations")] + public System.Collections.Generic.IList PreviousConfigurationPolicyGroupAssociations {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfigurationProperties.cs new file mode 100644 index 000000000000..9c4c8f34083e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SConnectionConfigurationProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for P2SConnectionConfiguration. + /// + public partial class P2SConnectionConfigurationProperties + { + /// + /// Initializes a new instance of the P2SConnectionConfigurationProperties class. + /// + public P2SConnectionConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the P2SConnectionConfigurationProperties class. + /// + + /// The reference to the address space resource which represents Address space + /// for P2S VpnClient. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// Flag indicating whether the enable internet security flag is turned on for + /// the P2S Connections or not. + /// + + /// List of Configuration Policy Groups that this P2SConnectionConfiguration is + /// attached to. + /// + + /// List of previous Configuration Policy Groups that this + /// P2SConnectionConfiguration was attached to. + /// + + /// The provisioning state of the P2SConnectionConfiguration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public P2SConnectionConfigurationProperties(AddressSpace vpnClientAddressPool = default(AddressSpace), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), bool? enableInternetSecurity = default(bool?), System.Collections.Generic.IList configurationPolicyGroupAssociations = default(System.Collections.Generic.IList), System.Collections.Generic.IList previousConfigurationPolicyGroupAssociations = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.VpnClientAddressPool = vpnClientAddressPool; + this.RoutingConfiguration = routingConfiguration; + this.EnableInternetSecurity = enableInternetSecurity; + this.ConfigurationPolicyGroupAssociations = configurationPolicyGroupAssociations; + this.PreviousConfigurationPolicyGroupAssociations = previousConfigurationPolicyGroupAssociations; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the reference to the address space resource which represents + /// Address space for P2S VpnClient. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientAddressPool")] + public AddressSpace VpnClientAddressPool {get; set; } + + /// + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } + + /// + /// Gets or sets flag indicating whether the enable internet security flag is + /// turned on for the P2S Connections or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } + + /// + /// Gets list of Configuration Policy Groups that this + /// P2SConnectionConfiguration is attached to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationPolicyGroupAssociations")] + public System.Collections.Generic.IList ConfigurationPolicyGroupAssociations {get; private set; } + + /// + /// Gets list of previous Configuration Policy Groups that this + /// P2SConnectionConfiguration was attached to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "previousConfigurationPolicyGroupAssociations")] + public System.Collections.Generic.IList PreviousConfigurationPolicyGroupAssociations {get; private set; } + + /// + /// Gets the provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealth.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealth.cs index 89c98d3ab72e..328dba2d02ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealth.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealth.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,14 @@ public P2SVpnConnectionHealth() /// /// Initializes a new instance of the P2SVpnConnectionHealth class. /// - /// Returned sas url of the blob to which the p2s - /// vpn connection detailed health will be written. + + /// Returned sas url of the blob to which the p2s vpn connection detailed + /// health will be written. + /// public P2SVpnConnectionHealth(string sasUrl = default(string)) + { - SasUrl = sasUrl; + this.SasUrl = sasUrl; CustomInit(); } @@ -42,12 +39,12 @@ public P2SVpnConnectionHealth() /// partial void CustomInit(); + /// - /// Gets or sets returned sas url of the blob to which the p2s vpn - /// connection detailed health will be written. + /// Gets or sets returned sas url of the blob to which the p2s vpn connection + /// detailed health will be written. /// - [JsonProperty(PropertyName = "sasUrl")] - public string SasUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sasUrl")] + public string SasUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealthRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealthRequest.cs index d39343c82eb5..6ec4fadaf245 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealthRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionHealthRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class P2SVpnConnectionHealthRequest { /// - /// Initializes a new instance of the P2SVpnConnectionHealthRequest - /// class. + /// Initializes a new instance of the P2SVpnConnectionHealthRequest class. /// public P2SVpnConnectionHealthRequest() { @@ -30,17 +21,20 @@ public P2SVpnConnectionHealthRequest() } /// - /// Initializes a new instance of the P2SVpnConnectionHealthRequest - /// class. + /// Initializes a new instance of the P2SVpnConnectionHealthRequest class. /// - /// The list of p2s vpn user names - /// whose p2s vpn connection detailed health to retrieve for. - /// The sas-url to download the P2S Vpn - /// connection health detail. - public P2SVpnConnectionHealthRequest(IList vpnUserNamesFilter = default(IList), string outputBlobSasUrl = default(string)) + + /// The list of p2s vpn user names whose p2s vpn connection detailed health to + /// retrieve for. + /// + + /// The sas-url to download the P2S Vpn connection health detail. + /// + public P2SVpnConnectionHealthRequest(System.Collections.Generic.IList vpnUserNamesFilter = default(System.Collections.Generic.IList), string outputBlobSasUrl = default(string)) + { - VpnUserNamesFilter = vpnUserNamesFilter; - OutputBlobSasUrl = outputBlobSasUrl; + this.VpnUserNamesFilter = vpnUserNamesFilter; + this.OutputBlobSasUrl = outputBlobSasUrl; CustomInit(); } @@ -49,19 +43,18 @@ public P2SVpnConnectionHealthRequest() /// partial void CustomInit(); + /// - /// Gets or sets the list of p2s vpn user names whose p2s vpn - /// connection detailed health to retrieve for. + /// Gets or sets the list of p2s vpn user names whose p2s vpn connection + /// detailed health to retrieve for. /// - [JsonProperty(PropertyName = "vpnUserNamesFilter")] - public IList VpnUserNamesFilter { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnUserNamesFilter")] + public System.Collections.Generic.IList VpnUserNamesFilter {get; set; } /// - /// Gets or sets the sas-url to download the P2S Vpn connection health - /// detail. + /// Gets or sets the sas-url to download the P2S Vpn connection health detail. /// - [JsonProperty(PropertyName = "outputBlobSasUrl")] - public string OutputBlobSasUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "outputBlobSasUrl")] + public string OutputBlobSasUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionRequest.cs index d99f981b5fcf..a2c15ea25759 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnConnectionRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,13 @@ public P2SVpnConnectionRequest() /// /// Initializes a new instance of the P2SVpnConnectionRequest class. /// - /// List of p2s vpn connection - /// Ids. - public P2SVpnConnectionRequest(IList vpnConnectionIds = default(IList)) + + /// List of p2s vpn connection Ids. + /// + public P2SVpnConnectionRequest(System.Collections.Generic.IList vpnConnectionIds = default(System.Collections.Generic.IList)) + { - VpnConnectionIds = vpnConnectionIds; + this.VpnConnectionIds = vpnConnectionIds; CustomInit(); } @@ -44,11 +38,11 @@ public P2SVpnConnectionRequest() /// partial void CustomInit(); + /// /// Gets or sets list of p2s vpn connection Ids. /// - [JsonProperty(PropertyName = "vpnConnectionIds")] - public IList VpnConnectionIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnConnectionIds")] + public System.Collections.Generic.IList VpnConnectionIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGateway.cs index 04318ee992f5..6d59a78702fb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// P2SVpnGateway Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class P2SVpnGateway : Resource { /// @@ -34,42 +24,62 @@ public P2SVpnGateway() /// /// Initializes a new instance of the P2SVpnGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The VirtualHub to which the gateway - /// belongs. - /// List of all p2s - /// connection configurations of the gateway. - /// The provisioning state of the P2S - /// VPN gateway resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The scale unit for this p2s vpn - /// gateway. - /// The VpnServerConfiguration to - /// which the p2sVpnGateway is attached to. - /// All P2S VPN clients' - /// connection health status. - /// List of all customer specified DNS - /// servers IP addresses. - /// Enable Routing Preference - /// property for the Public IP Interface of the P2SVpnGateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - public P2SVpnGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualHub = default(SubResource), IList p2SConnectionConfigurations = default(IList), string provisioningState = default(string), int? vpnGatewayScaleUnit = default(int?), SubResource vpnServerConfiguration = default(SubResource), VpnClientConnectionHealth vpnClientConnectionHealth = default(VpnClientConnectionHealth), IList customDnsServers = default(IList), bool? isRoutingPreferenceInternet = default(bool?), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the P2S VPN gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The VirtualHub to which the gateway belongs. + /// + + /// List of all p2s connection configurations of the gateway. + /// + + /// The scale unit for this p2s vpn gateway. + /// + + /// The VpnServerConfiguration to which the p2sVpnGateway is attached to. + /// + + /// All P2S VPN clients' connection health status. + /// + + /// List of all customer specified DNS servers IP addresses. + /// + + /// Enable Routing Preference property for the Public IP Interface of the + /// P2SVpnGateway. + /// + public P2SVpnGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), SubResource virtualHub = default(SubResource), System.Collections.Generic.IList p2SConnectionConfigurations = default(System.Collections.Generic.IList), int? vpnGatewayScaleUnit = default(int?), SubResource vpnServerConfiguration = default(SubResource), VpnClientConnectionHealth vpnClientConnectionHealth = default(VpnClientConnectionHealth), System.Collections.Generic.IList customDnsServers = default(System.Collections.Generic.IList), bool? isRoutingPreferenceInternet = default(bool?)) + + : base(id, name, type, location, tags) { - VirtualHub = virtualHub; - P2SConnectionConfigurations = p2SConnectionConfigurations; - ProvisioningState = provisioningState; - VpnGatewayScaleUnit = vpnGatewayScaleUnit; - VpnServerConfiguration = vpnServerConfiguration; - VpnClientConnectionHealth = vpnClientConnectionHealth; - CustomDnsServers = customDnsServers; - IsRoutingPreferenceInternet = isRoutingPreferenceInternet; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.VirtualHub = virtualHub; + this.P2SConnectionConfigurations = p2SConnectionConfigurations; + this.VpnGatewayScaleUnit = vpnGatewayScaleUnit; + this.VpnServerConfiguration = vpnServerConfiguration; + this.VpnClientConnectionHealth = vpnClientConnectionHealth; + this.CustomDnsServers = customDnsServers; + this.IsRoutingPreferenceInternet = isRoutingPreferenceInternet; CustomInit(); } @@ -78,66 +88,62 @@ public P2SVpnGateway() /// partial void CustomInit(); + /// - /// Gets or sets the VirtualHub to which the gateway belongs. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.virtualHub")] - public SubResource VirtualHub { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets list of all p2s connection configurations of the - /// gateway. + /// Gets the provisioning state of the P2S VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.p2SConnectionConfigurations")] - public IList P2SConnectionConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the P2S VPN gateway resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets the VirtualHub to which the gateway belongs. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHub")] + public SubResource VirtualHub {get; set; } /// - /// Gets or sets the scale unit for this p2s vpn gateway. + /// Gets or sets list of all p2s connection configurations of the gateway. /// - [JsonProperty(PropertyName = "properties.vpnGatewayScaleUnit")] - public int? VpnGatewayScaleUnit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.p2SConnectionConfigurations")] + public System.Collections.Generic.IList P2SConnectionConfigurations {get; set; } /// - /// Gets or sets the VpnServerConfiguration to which the p2sVpnGateway - /// is attached to. + /// Gets or sets the scale unit for this p2s vpn gateway. /// - [JsonProperty(PropertyName = "properties.vpnServerConfiguration")] - public SubResource VpnServerConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnGatewayScaleUnit")] + public int? VpnGatewayScaleUnit {get; set; } /// - /// Gets all P2S VPN clients' connection health status. + /// Gets or sets the VpnServerConfiguration to which the p2sVpnGateway is + /// attached to. /// - [JsonProperty(PropertyName = "properties.vpnClientConnectionHealth")] - public VpnClientConnectionHealth VpnClientConnectionHealth { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnServerConfiguration")] + public SubResource VpnServerConfiguration {get; set; } /// - /// Gets or sets list of all customer specified DNS servers IP - /// addresses. + /// Gets all P2S VPN clients' connection health status. /// - [JsonProperty(PropertyName = "properties.customDnsServers")] - public IList CustomDnsServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientConnectionHealth")] + public VpnClientConnectionHealth VpnClientConnectionHealth {get; private set; } /// - /// Gets or sets enable Routing Preference property for the Public IP - /// Interface of the P2SVpnGateway. + /// Gets or sets list of all customer specified DNS servers IP addresses. /// - [JsonProperty(PropertyName = "properties.isRoutingPreferenceInternet")] - public bool? IsRoutingPreferenceInternet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customDnsServers")] + public System.Collections.Generic.IList CustomDnsServers {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets enable Routing Preference property for the Public IP Interface + /// of the P2SVpnGateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isRoutingPreferenceInternet")] + public bool? IsRoutingPreferenceInternet {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGatewayProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGatewayProperties.cs new file mode 100644 index 000000000000..9380e1e4ba6f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnGatewayProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for P2SVpnGateway. + /// + public partial class P2SVpnGatewayProperties + { + /// + /// Initializes a new instance of the P2SVpnGatewayProperties class. + /// + public P2SVpnGatewayProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the P2SVpnGatewayProperties class. + /// + + /// The VirtualHub to which the gateway belongs. + /// + + /// List of all p2s connection configurations of the gateway. + /// + + /// The provisioning state of the P2S VPN gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The scale unit for this p2s vpn gateway. + /// + + /// The VpnServerConfiguration to which the p2sVpnGateway is attached to. + /// + + /// All P2S VPN clients' connection health status. + /// + + /// List of all customer specified DNS servers IP addresses. + /// + + /// Enable Routing Preference property for the Public IP Interface of the + /// P2SVpnGateway. + /// + public P2SVpnGatewayProperties(SubResource virtualHub = default(SubResource), System.Collections.Generic.IList p2SConnectionConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string), int? vpnGatewayScaleUnit = default(int?), SubResource vpnServerConfiguration = default(SubResource), VpnClientConnectionHealth vpnClientConnectionHealth = default(VpnClientConnectionHealth), System.Collections.Generic.IList customDnsServers = default(System.Collections.Generic.IList), bool? isRoutingPreferenceInternet = default(bool?)) + + { + this.VirtualHub = virtualHub; + this.P2SConnectionConfigurations = p2SConnectionConfigurations; + this.ProvisioningState = provisioningState; + this.VpnGatewayScaleUnit = vpnGatewayScaleUnit; + this.VpnServerConfiguration = vpnServerConfiguration; + this.VpnClientConnectionHealth = vpnClientConnectionHealth; + this.CustomDnsServers = customDnsServers; + this.IsRoutingPreferenceInternet = isRoutingPreferenceInternet; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the VirtualHub to which the gateway belongs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHub")] + public SubResource VirtualHub {get; set; } + + /// + /// Gets or sets list of all p2s connection configurations of the gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "p2SConnectionConfigurations")] + public System.Collections.Generic.IList P2SConnectionConfigurations {get; set; } + + /// + /// Gets the provisioning state of the P2S VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the scale unit for this p2s vpn gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnGatewayScaleUnit")] + public int? VpnGatewayScaleUnit {get; set; } + + /// + /// Gets or sets the VpnServerConfiguration to which the p2sVpnGateway is + /// attached to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnServerConfiguration")] + public SubResource VpnServerConfiguration {get; set; } + + /// + /// Gets all P2S VPN clients' connection health status. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientConnectionHealth")] + public VpnClientConnectionHealth VpnClientConnectionHealth {get; private set; } + + /// + /// Gets or sets list of all customer specified DNS servers IP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customDnsServers")] + public System.Collections.Generic.IList CustomDnsServers {get; set; } + + /// + /// Gets or sets enable Routing Preference property for the Public IP Interface + /// of the P2SVpnGateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isRoutingPreferenceInternet")] + public bool? IsRoutingPreferenceInternet {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnProfileParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnProfileParameters.cs index b74a9a62b69e..3ab5234662c6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnProfileParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/P2SVpnProfileParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public P2SVpnProfileParameters() /// /// Initializes a new instance of the P2SVpnProfileParameters class. /// - /// VPN client authentication - /// method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + + /// VPN client authentication method. + /// Possible values include: 'EAPTLS', 'EAPMSCHAPv2' public P2SVpnProfileParameters(string authenticationMethod = default(string)) + { - AuthenticationMethod = authenticationMethod; + this.AuthenticationMethod = authenticationMethod; CustomInit(); } @@ -42,12 +38,11 @@ public P2SVpnProfileParameters() /// partial void CustomInit(); + /// - /// Gets or sets VPN client authentication method. Possible values - /// include: 'EAPTLS', 'EAPMSCHAPv2' + /// Gets or sets vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' /// - [JsonProperty(PropertyName = "authenticationMethod")] - public string AuthenticationMethod { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationMethod")] + public string AuthenticationMethod {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCapture.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCapture.cs index 8e55e5c63b60..a6b09eed2348 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCapture.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCapture.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Parameters that define the create packet capture operation. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PacketCapture { /// @@ -34,33 +24,44 @@ public PacketCapture() /// /// Initializes a new instance of the PacketCapture class. /// - /// The ID of the targeted resource, only AzureVM - /// and AzureVMSS as target type are currently supported. - /// The storage location for a packet - /// capture session. - /// A list of AzureVMSS instances which can be - /// included or excluded to run packet capture. If both included and - /// excluded are empty, then the packet capture will run on all - /// instances of AzureVMSS. + + /// The ID of the targeted resource, only AzureVM and AzureVMSS as target type + /// are currently supported. + /// + + /// A list of AzureVMSS instances which can be included or excluded to run + /// packet capture. If both included and excluded are empty, then the packet + /// capture will run on all instances of AzureVMSS. + /// + /// Target type of the resource provided. - /// Possible values include: 'AzureVM', 'AzureVMSS' - /// Number of bytes captured per - /// packet, the remaining bytes are truncated. - /// Maximum size of the capture - /// output. - /// Maximum duration of the capture - /// session in seconds. - /// A list of packet capture filters. - public PacketCapture(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList)) + /// Possible values include: 'AzureVM', 'AzureVMSS' + + /// Number of bytes captured per packet, the remaining bytes are truncated. + /// + + /// Maximum size of the capture output. + /// + + /// Maximum duration of the capture session in seconds. + /// + + /// The storage location for a packet capture session. + /// + + /// A list of packet capture filters. + /// + public PacketCapture(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), System.Collections.Generic.IList filters = default(System.Collections.Generic.IList)) + { - Target = target; - Scope = scope; - TargetType = targetType; - BytesToCapturePerPacket = bytesToCapturePerPacket; - TotalBytesPerSession = totalBytesPerSession; - TimeLimitInSeconds = timeLimitInSeconds; - StorageLocation = storageLocation; - Filters = filters; + this.Target = target; + this.Scope = scope; + this.TargetType = targetType; + this.BytesToCapturePerPacket = bytesToCapturePerPacket; + this.TotalBytesPerSession = totalBytesPerSession; + this.TimeLimitInSeconds = timeLimitInSeconds; + this.StorageLocation = storageLocation; + this.Filters = filters; CustomInit(); } @@ -69,109 +70,112 @@ public PacketCapture() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the targeted resource, only AzureVM and - /// AzureVMSS as target type are currently supported. + /// Gets or sets the ID of the targeted resource, only AzureVM and AzureVMSS as + /// target type are currently supported. /// - [JsonProperty(PropertyName = "properties.target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.target")] + public string Target {get; set; } /// /// Gets or sets a list of AzureVMSS instances which can be included or - /// excluded to run packet capture. If both included and excluded are - /// empty, then the packet capture will run on all instances of - /// AzureVMSS. + /// excluded to run packet capture. If both included and excluded are empty, + /// then the packet capture will run on all instances of AzureVMSS. /// - [JsonProperty(PropertyName = "properties.scope")] - public PacketCaptureMachineScope Scope { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scope")] + public PacketCaptureMachineScope Scope {get; set; } /// - /// Gets or sets target type of the resource provided. Possible values - /// include: 'AzureVM', 'AzureVMSS' + /// Gets or sets target type of the resource provided. Possible values include: 'AzureVM', 'AzureVMSS' /// - [JsonProperty(PropertyName = "properties.targetType")] - public PacketCaptureTargetType? TargetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetType")] + public PacketCaptureTargetType? TargetType {get; set; } /// - /// Gets or sets number of bytes captured per packet, the remaining - /// bytes are truncated. + /// Gets or sets number of bytes captured per packet, the remaining bytes are + /// truncated. /// - [JsonProperty(PropertyName = "properties.bytesToCapturePerPacket")] - public long? BytesToCapturePerPacket { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bytesToCapturePerPacket")] + public long? BytesToCapturePerPacket {get; set; } /// /// Gets or sets maximum size of the capture output. /// - [JsonProperty(PropertyName = "properties.totalBytesPerSession")] - public long? TotalBytesPerSession { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.totalBytesPerSession")] + public long? TotalBytesPerSession {get; set; } /// /// Gets or sets maximum duration of the capture session in seconds. /// - [JsonProperty(PropertyName = "properties.timeLimitInSeconds")] - public int? TimeLimitInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeLimitInSeconds")] + public int? TimeLimitInSeconds {get; set; } /// /// Gets or sets the storage location for a packet capture session. /// - [JsonProperty(PropertyName = "properties.storageLocation")] - public PacketCaptureStorageLocation StorageLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageLocation")] + public PacketCaptureStorageLocation StorageLocation {get; set; } /// /// Gets or sets a list of packet capture filters. /// - [JsonProperty(PropertyName = "properties.filters")] - public IList Filters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.filters")] + public System.Collections.Generic.IList Filters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Target == null) + if (this.Target == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Target"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Target"); } - if (StorageLocation == null) + if (this.StorageLocation == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageLocation"); } - if (BytesToCapturePerPacket != null) + + + + if (this.BytesToCapturePerPacket != null) { - if (BytesToCapturePerPacket > 4294967295) + if (this.BytesToCapturePerPacket > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); } - if (BytesToCapturePerPacket < 0) + if (this.BytesToCapturePerPacket < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); } } - if (TotalBytesPerSession != null) + if (this.TotalBytesPerSession != null) { - if (TotalBytesPerSession > 4294967295) + if (this.TotalBytesPerSession > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); } - if (TotalBytesPerSession < 0) + if (this.TotalBytesPerSession < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); } } - if (TimeLimitInSeconds != null) + if (this.TimeLimitInSeconds != null) { - if (TimeLimitInSeconds > 18000) + if (this.TimeLimitInSeconds > 18000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); } - if (TimeLimitInSeconds < 0) + if (this.TimeLimitInSeconds < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureFilter.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureFilter.cs index 348f3ad2e7bd..8f1cf1fb65a1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureFilter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureFilter.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Filter that is applied to packet capture request. Multiple filters can - /// be applied. + /// Filter that is applied to packet capture request. Multiple filters can be + /// applied. /// public partial class PacketCaptureFilter { @@ -30,37 +24,41 @@ public PacketCaptureFilter() /// /// Initializes a new instance of the PacketCaptureFilter class. /// - /// Protocol to be filtered on. Possible values - /// include: 'TCP', 'UDP', 'Any' - /// 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. - /// 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. - /// 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. - /// 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. + + /// Protocol to be filtered on. + /// Possible values include: 'TCP', 'UDP', 'Any' + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// + + /// 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. + /// public PacketCaptureFilter(string protocol = default(string), string localIPAddress = default(string), string remoteIPAddress = default(string), string localPort = default(string), string remotePort = default(string)) + { - Protocol = protocol; - LocalIPAddress = localIPAddress; - RemoteIPAddress = remoteIPAddress; - LocalPort = localPort; - RemotePort = remotePort; + this.Protocol = protocol; + this.LocalIPAddress = localIPAddress; + this.RemoteIPAddress = remoteIPAddress; + this.LocalPort = localPort; + this.RemotePort = remotePort; CustomInit(); } @@ -69,50 +67,49 @@ public PacketCaptureFilter() /// partial void CustomInit(); + /// - /// Gets or sets protocol to be filtered on. Possible values include: - /// 'TCP', 'UDP', 'Any' + /// Gets or sets protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "localIPAddress")] - public string LocalIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localIPAddress")] + public string LocalIPAddress {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "remoteIPAddress")] - public string RemoteIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteIPAddress")] + public string RemoteIPAddress {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "localPort")] - public string LocalPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localPort")] + public string LocalPort {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "remotePort")] - public string RemotePort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "remotePort")] + public string RemotePort {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureMachineScope.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureMachineScope.cs index e85a9f139610..14c5a335d536 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureMachineScope.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureMachineScope.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A list of AzureVMSS instances which can be included or excluded to run - /// packet capture. If both included and excluded are empty, then the - /// packet capture will run on all instances of AzureVMSS. + /// packet capture. If both included and excluded are empty, then the packet + /// capture will run on all instances of AzureVMSS. /// public partial class PacketCaptureMachineScope { @@ -33,14 +25,18 @@ public PacketCaptureMachineScope() /// /// Initializes a new instance of the PacketCaptureMachineScope class. /// - /// List of AzureVMSS instances to run packet - /// capture on. - /// List of AzureVMSS instances which has to be - /// excluded from the AzureVMSS from running packet capture. - public PacketCaptureMachineScope(IList include = default(IList), IList exclude = default(IList)) + + /// List of AzureVMSS instances to run packet capture on. + /// + + /// List of AzureVMSS instances which has to be excluded from the AzureVMSS + /// from running packet capture. + /// + public PacketCaptureMachineScope(System.Collections.Generic.IList include = default(System.Collections.Generic.IList), System.Collections.Generic.IList exclude = default(System.Collections.Generic.IList)) + { - Include = include; - Exclude = exclude; + this.Include = include; + this.Exclude = exclude; CustomInit(); } @@ -49,18 +45,18 @@ public PacketCaptureMachineScope() /// partial void CustomInit(); + /// /// Gets or sets list of AzureVMSS instances to run packet capture on. /// - [JsonProperty(PropertyName = "include")] - public IList Include { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "include")] + public System.Collections.Generic.IList Include {get; set; } /// - /// Gets or sets list of AzureVMSS instances which has to be excluded - /// from the AzureVMSS from running packet capture. + /// Gets or sets list of AzureVMSS instances which has to be excluded from the + /// AzureVMSS from running packet capture. /// - [JsonProperty(PropertyName = "exclude")] - public IList Exclude { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "exclude")] + public System.Collections.Generic.IList Exclude {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureParameters.cs index 437ef2c50996..da995acca0cd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureParameters.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,33 +23,44 @@ public PacketCaptureParameters() /// /// Initializes a new instance of the PacketCaptureParameters class. /// - /// The ID of the targeted resource, only AzureVM - /// and AzureVMSS as target type are currently supported. - /// The storage location for a packet - /// capture session. - /// A list of AzureVMSS instances which can be - /// included or excluded to run packet capture. If both included and - /// excluded are empty, then the packet capture will run on all - /// instances of AzureVMSS. + + /// The ID of the targeted resource, only AzureVM and AzureVMSS as target type + /// are currently supported. + /// + + /// A list of AzureVMSS instances which can be included or excluded to run + /// packet capture. If both included and excluded are empty, then the packet + /// capture will run on all instances of AzureVMSS. + /// + /// Target type of the resource provided. - /// Possible values include: 'AzureVM', 'AzureVMSS' - /// Number of bytes captured per - /// packet, the remaining bytes are truncated. - /// Maximum size of the capture - /// output. - /// Maximum duration of the capture - /// session in seconds. - /// A list of packet capture filters. - public PacketCaptureParameters(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList)) + /// Possible values include: 'AzureVM', 'AzureVMSS' + + /// Number of bytes captured per packet, the remaining bytes are truncated. + /// + + /// Maximum size of the capture output. + /// + + /// Maximum duration of the capture session in seconds. + /// + + /// The storage location for a packet capture session. + /// + + /// A list of packet capture filters. + /// + public PacketCaptureParameters(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), System.Collections.Generic.IList filters = default(System.Collections.Generic.IList)) + { - Target = target; - Scope = scope; - TargetType = targetType; - BytesToCapturePerPacket = bytesToCapturePerPacket; - TotalBytesPerSession = totalBytesPerSession; - TimeLimitInSeconds = timeLimitInSeconds; - StorageLocation = storageLocation; - Filters = filters; + this.Target = target; + this.Scope = scope; + this.TargetType = targetType; + this.BytesToCapturePerPacket = bytesToCapturePerPacket; + this.TotalBytesPerSession = totalBytesPerSession; + this.TimeLimitInSeconds = timeLimitInSeconds; + this.StorageLocation = storageLocation; + this.Filters = filters; CustomInit(); } @@ -67,109 +69,112 @@ public PacketCaptureParameters() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the targeted resource, only AzureVM and - /// AzureVMSS as target type are currently supported. + /// Gets or sets the ID of the targeted resource, only AzureVM and AzureVMSS as + /// target type are currently supported. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// /// Gets or sets a list of AzureVMSS instances which can be included or - /// excluded to run packet capture. If both included and excluded are - /// empty, then the packet capture will run on all instances of - /// AzureVMSS. + /// excluded to run packet capture. If both included and excluded are empty, + /// then the packet capture will run on all instances of AzureVMSS. /// - [JsonProperty(PropertyName = "scope")] - public PacketCaptureMachineScope Scope { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public PacketCaptureMachineScope Scope {get; set; } /// - /// Gets or sets target type of the resource provided. Possible values - /// include: 'AzureVM', 'AzureVMSS' + /// Gets or sets target type of the resource provided. Possible values include: 'AzureVM', 'AzureVMSS' /// - [JsonProperty(PropertyName = "targetType")] - public PacketCaptureTargetType? TargetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetType")] + public PacketCaptureTargetType? TargetType {get; set; } /// - /// Gets or sets number of bytes captured per packet, the remaining - /// bytes are truncated. + /// Gets or sets number of bytes captured per packet, the remaining bytes are + /// truncated. /// - [JsonProperty(PropertyName = "bytesToCapturePerPacket")] - public long? BytesToCapturePerPacket { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bytesToCapturePerPacket")] + public long? BytesToCapturePerPacket {get; set; } /// /// Gets or sets maximum size of the capture output. /// - [JsonProperty(PropertyName = "totalBytesPerSession")] - public long? TotalBytesPerSession { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "totalBytesPerSession")] + public long? TotalBytesPerSession {get; set; } /// /// Gets or sets maximum duration of the capture session in seconds. /// - [JsonProperty(PropertyName = "timeLimitInSeconds")] - public int? TimeLimitInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeLimitInSeconds")] + public int? TimeLimitInSeconds {get; set; } /// /// Gets or sets the storage location for a packet capture session. /// - [JsonProperty(PropertyName = "storageLocation")] - public PacketCaptureStorageLocation StorageLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageLocation")] + public PacketCaptureStorageLocation StorageLocation {get; set; } /// /// Gets or sets a list of packet capture filters. /// - [JsonProperty(PropertyName = "filters")] - public IList Filters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filters")] + public System.Collections.Generic.IList Filters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Target == null) + if (this.Target == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Target"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Target"); } - if (StorageLocation == null) + if (this.StorageLocation == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageLocation"); } - if (BytesToCapturePerPacket != null) + + + + if (this.BytesToCapturePerPacket != null) { - if (BytesToCapturePerPacket > 4294967295) + if (this.BytesToCapturePerPacket > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); } - if (BytesToCapturePerPacket < 0) + if (this.BytesToCapturePerPacket < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); } } - if (TotalBytesPerSession != null) + if (this.TotalBytesPerSession != null) { - if (TotalBytesPerSession > 4294967295) + if (this.TotalBytesPerSession > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); } - if (TotalBytesPerSession < 0) + if (this.TotalBytesPerSession < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); } } - if (TimeLimitInSeconds != null) + if (this.TimeLimitInSeconds != null) { - if (TimeLimitInSeconds > 18000) + if (this.TimeLimitInSeconds > 18000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); } - if (TimeLimitInSeconds < 0) + if (this.TimeLimitInSeconds < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureQueryStatusResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureQueryStatusResult.cs index 4ba56a0c2ea2..10418e62b38f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureQueryStatusResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureQueryStatusResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PacketCaptureQueryStatusResult { /// - /// Initializes a new instance of the PacketCaptureQueryStatusResult - /// class. + /// Initializes a new instance of the PacketCaptureQueryStatusResult class. /// public PacketCaptureQueryStatusResult() { @@ -30,28 +21,36 @@ public PacketCaptureQueryStatusResult() } /// - /// Initializes a new instance of the PacketCaptureQueryStatusResult - /// class. + /// Initializes a new instance of the PacketCaptureQueryStatusResult class. /// - /// The name of the packet capture resource. - /// The ID of the packet capture resource. - /// The start time of the packet capture - /// session. - /// The status of the packet capture - /// session. Possible values include: 'NotStarted', 'Running', - /// 'Stopped', 'Error', 'Unknown' - /// The reason the current packet capture - /// session was stopped. - /// List of errors of packet capture - /// session. - public PacketCaptureQueryStatusResult(string name = default(string), string id = default(string), System.DateTime? captureStartTime = default(System.DateTime?), string packetCaptureStatus = default(string), string stopReason = default(string), IList packetCaptureError = default(IList)) + + /// The name of the packet capture resource. + /// + + /// The ID of the packet capture resource. + /// + + /// The start time of the packet capture session. + /// + + /// The status of the packet capture session. + /// Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + /// 'Unknown' + + /// The reason the current packet capture session was stopped. + /// + + /// List of errors of packet capture session. + /// + public PacketCaptureQueryStatusResult(string name = default(string), string id = default(string), System.DateTime? captureStartTime = default(System.DateTime?), string packetCaptureStatus = default(string), string stopReason = default(string), System.Collections.Generic.IList packetCaptureError = default(System.Collections.Generic.IList)) + { - Name = name; - Id = id; - CaptureStartTime = captureStartTime; - PacketCaptureStatus = packetCaptureStatus; - StopReason = stopReason; - PacketCaptureError = packetCaptureError; + this.Name = name; + this.Id = id; + this.CaptureStartTime = captureStartTime; + this.PacketCaptureStatus = packetCaptureStatus; + this.StopReason = stopReason; + this.PacketCaptureError = packetCaptureError; CustomInit(); } @@ -60,44 +59,41 @@ public PacketCaptureQueryStatusResult() /// partial void CustomInit(); + /// /// Gets or sets the name of the packet capture resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the ID of the packet capture resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the start time of the packet capture session. /// - [JsonProperty(PropertyName = "captureStartTime")] - public System.DateTime? CaptureStartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "captureStartTime")] + public System.DateTime? CaptureStartTime {get; set; } /// - /// Gets or sets the status of the packet capture session. Possible - /// values include: 'NotStarted', 'Running', 'Stopped', 'Error', - /// 'Unknown' + /// Gets or sets the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown' /// - [JsonProperty(PropertyName = "packetCaptureStatus")] - public string PacketCaptureStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "packetCaptureStatus")] + public string PacketCaptureStatus {get; set; } /// - /// Gets or sets the reason the current packet capture session was - /// stopped. + /// Gets or sets the reason the current packet capture session was stopped. /// - [JsonProperty(PropertyName = "stopReason")] - public string StopReason { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "stopReason")] + public string StopReason {get; set; } /// /// Gets or sets list of errors of packet capture session. /// - [JsonProperty(PropertyName = "packetCaptureError")] - public IList PacketCaptureError { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "packetCaptureError")] + public System.Collections.Generic.IList PacketCaptureError {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResult.cs index 322ec67b2be7..e5d0a717ddda 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResult.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Information about packet capture session. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PacketCaptureResult { /// @@ -34,44 +24,60 @@ public PacketCaptureResult() /// /// Initializes a new instance of the PacketCaptureResult class. /// - /// The ID of the targeted resource, only AzureVM - /// and AzureVMSS as target type are currently supported. - /// The storage location for a packet - /// capture session. - /// Name of the packet capture session. - /// ID of the packet capture operation. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A list of AzureVMSS instances which can be - /// included or excluded to run packet capture. If both included and - /// excluded are empty, then the packet capture will run on all - /// instances of AzureVMSS. + + /// Name of the packet capture session. + /// + + /// ID of the packet capture operation. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the packet capture session. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The ID of the targeted resource, only AzureVM and AzureVMSS as target type + /// are currently supported. + /// + + /// A list of AzureVMSS instances which can be included or excluded to run + /// packet capture. If both included and excluded are empty, then the packet + /// capture will run on all instances of AzureVMSS. + /// + /// Target type of the resource provided. - /// Possible values include: 'AzureVM', 'AzureVMSS' - /// Number of bytes captured per - /// packet, the remaining bytes are truncated. - /// Maximum size of the capture - /// output. - /// Maximum duration of the capture - /// session in seconds. - /// A list of packet capture filters. - /// The provisioning state of the - /// packet capture session. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - public PacketCaptureResult(string target, PacketCaptureStorageLocation storageLocation, string name = default(string), string id = default(string), string etag = default(string), PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList), string provisioningState = default(string)) + /// Possible values include: 'AzureVM', 'AzureVMSS' + + /// Number of bytes captured per packet, the remaining bytes are truncated. + /// + + /// Maximum size of the capture output. + /// + + /// Maximum duration of the capture session in seconds. + /// + + /// The storage location for a packet capture session. + /// + + /// A list of packet capture filters. + /// + public PacketCaptureResult(string name = default(string), string id = default(string), string etag = default(string), string provisioningState = default(string), string target = default(string), PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), PacketCaptureStorageLocation storageLocation = default(PacketCaptureStorageLocation), System.Collections.Generic.IList filters = default(System.Collections.Generic.IList)) + { - Name = name; - Id = id; - Etag = etag; - Target = target; - Scope = scope; - TargetType = targetType; - BytesToCapturePerPacket = bytesToCapturePerPacket; - TotalBytesPerSession = totalBytesPerSession; - TimeLimitInSeconds = timeLimitInSeconds; - StorageLocation = storageLocation; - Filters = filters; - ProvisioningState = provisioningState; + this.Name = name; + this.Id = id; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Target = target; + this.Scope = scope; + this.TargetType = targetType; + this.BytesToCapturePerPacket = bytesToCapturePerPacket; + this.TotalBytesPerSession = totalBytesPerSession; + this.TimeLimitInSeconds = timeLimitInSeconds; + this.StorageLocation = storageLocation; + this.Filters = filters; CustomInit(); } @@ -80,135 +86,133 @@ public PacketCaptureResult() /// partial void CustomInit(); + /// /// Gets name of the packet capture session. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } + + /// + /// Gets iD of the packet capture operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// - /// Gets ID of the packet capture operation. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the ID of the targeted resource, only AzureVM and - /// AzureVMSS as target type are currently supported. + /// Gets or sets the ID of the targeted resource, only AzureVM and AzureVMSS as + /// target type are currently supported. /// - [JsonProperty(PropertyName = "properties.target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.target")] + public string Target {get; set; } /// /// Gets or sets a list of AzureVMSS instances which can be included or - /// excluded to run packet capture. If both included and excluded are - /// empty, then the packet capture will run on all instances of - /// AzureVMSS. + /// excluded to run packet capture. If both included and excluded are empty, + /// then the packet capture will run on all instances of AzureVMSS. /// - [JsonProperty(PropertyName = "properties.scope")] - public PacketCaptureMachineScope Scope { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scope")] + public PacketCaptureMachineScope Scope {get; set; } /// - /// Gets or sets target type of the resource provided. Possible values - /// include: 'AzureVM', 'AzureVMSS' + /// Gets or sets target type of the resource provided. Possible values include: 'AzureVM', 'AzureVMSS' /// - [JsonProperty(PropertyName = "properties.targetType")] - public PacketCaptureTargetType? TargetType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetType")] + public PacketCaptureTargetType? TargetType {get; set; } /// - /// Gets or sets number of bytes captured per packet, the remaining - /// bytes are truncated. + /// Gets or sets number of bytes captured per packet, the remaining bytes are + /// truncated. /// - [JsonProperty(PropertyName = "properties.bytesToCapturePerPacket")] - public long? BytesToCapturePerPacket { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bytesToCapturePerPacket")] + public long? BytesToCapturePerPacket {get; set; } /// /// Gets or sets maximum size of the capture output. /// - [JsonProperty(PropertyName = "properties.totalBytesPerSession")] - public long? TotalBytesPerSession { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.totalBytesPerSession")] + public long? TotalBytesPerSession {get; set; } /// /// Gets or sets maximum duration of the capture session in seconds. /// - [JsonProperty(PropertyName = "properties.timeLimitInSeconds")] - public int? TimeLimitInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeLimitInSeconds")] + public int? TimeLimitInSeconds {get; set; } /// /// Gets or sets the storage location for a packet capture session. /// - [JsonProperty(PropertyName = "properties.storageLocation")] - public PacketCaptureStorageLocation StorageLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageLocation")] + public PacketCaptureStorageLocation StorageLocation {get; set; } /// /// Gets or sets a list of packet capture filters. /// - [JsonProperty(PropertyName = "properties.filters")] - public IList Filters { get; set; } - - /// - /// Gets the provisioning state of the packet capture session. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.filters")] + public System.Collections.Generic.IList Filters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Target == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Target"); - } - if (StorageLocation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); - } - if (BytesToCapturePerPacket != null) + + + + + + + + if (this.BytesToCapturePerPacket != null) { - if (BytesToCapturePerPacket > 4294967295) + if (this.BytesToCapturePerPacket > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); } - if (BytesToCapturePerPacket < 0) + if (this.BytesToCapturePerPacket < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); } } - if (TotalBytesPerSession != null) + if (this.TotalBytesPerSession != null) { - if (TotalBytesPerSession > 4294967295) + if (this.TotalBytesPerSession > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); } - if (TotalBytesPerSession < 0) + if (this.TotalBytesPerSession < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); } } - if (TimeLimitInSeconds != null) + if (this.TimeLimitInSeconds != null) { - if (TimeLimitInSeconds > 18000) + if (this.TimeLimitInSeconds > 18000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); } - if (TimeLimitInSeconds < 0) + if (this.TimeLimitInSeconds < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); } } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResultProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResultProperties.cs new file mode 100644 index 000000000000..0ff2628798b3 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureResultProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// The properties of a packet capture session. + /// + public partial class PacketCaptureResultProperties : PacketCaptureParameters + { + /// + /// Initializes a new instance of the PacketCaptureResultProperties class. + /// + public PacketCaptureResultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PacketCaptureResultProperties class. + /// + + /// The ID of the targeted resource, only AzureVM and AzureVMSS as target type + /// are currently supported. + /// + + /// A list of AzureVMSS instances which can be included or excluded to run + /// packet capture. If both included and excluded are empty, then the packet + /// capture will run on all instances of AzureVMSS. + /// + + /// Target type of the resource provided. + /// Possible values include: 'AzureVM', 'AzureVMSS' + + /// Number of bytes captured per packet, the remaining bytes are truncated. + /// + + /// Maximum size of the capture output. + /// + + /// Maximum duration of the capture session in seconds. + /// + + /// The storage location for a packet capture session. + /// + + /// A list of packet capture filters. + /// + + /// The provisioning state of the packet capture session. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public PacketCaptureResultProperties(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), System.Collections.Generic.IList filters = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + : base(target, storageLocation, scope, targetType, bytesToCapturePerPacket, totalBytesPerSession, timeLimitInSeconds, filters) + { + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureStorageLocation.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureStorageLocation.cs index 3604622fb276..130c6e6e5c48 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureStorageLocation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureStorageLocation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PacketCaptureStorageLocation { /// - /// Initializes a new instance of the PacketCaptureStorageLocation - /// class. + /// Initializes a new instance of the PacketCaptureStorageLocation class. /// public PacketCaptureStorageLocation() { @@ -28,24 +21,27 @@ public PacketCaptureStorageLocation() } /// - /// Initializes a new instance of the PacketCaptureStorageLocation - /// class. + /// Initializes a new instance of the PacketCaptureStorageLocation class. /// - /// The ID of the storage account to save the - /// packet capture session. Required if no local file path is - /// provided. - /// 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. - /// 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. + + /// The ID of the storage account to save the packet capture session. Required + /// if no local file path is provided. + /// + + /// 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. + /// + + /// 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. + /// public PacketCaptureStorageLocation(string storageId = default(string), string storagePath = default(string), string filePath = default(string)) + { - StorageId = storageId; - StoragePath = storagePath; - FilePath = filePath; + this.StorageId = storageId; + this.StoragePath = storagePath; + this.FilePath = filePath; CustomInit(); } @@ -54,29 +50,27 @@ public PacketCaptureStorageLocation() /// partial void CustomInit(); + /// - /// Gets or sets the ID of the storage account to save the packet - /// capture session. Required if no local file path is provided. + /// Gets or sets the ID of the storage account to save the packet capture + /// session. Required if no local file path is provided. /// - [JsonProperty(PropertyName = "storageId")] - public string StorageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageId")] + public string StorageId {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "storagePath")] - public string StoragePath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storagePath")] + public string StoragePath {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "filePath")] - public string FilePath { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filePath")] + public string FilePath {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureTargetType.cs b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureTargetType.cs index bf25862e14b0..6495b0d173bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureTargetType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PacketCaptureTargetType.cs @@ -1,30 +1,23 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for PacketCaptureTargetType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum PacketCaptureTargetType { - [EnumMember(Value = "AzureVM")] + [System.Runtime.Serialization.EnumMember(Value = "AzureVM")] AzureVM, - [EnumMember(Value = "AzureVMSS")] - AzureVMSS + [System.Runtime.Serialization.EnumMember(Value = "AzureVMSS")] + AzureVmss } internal static class PacketCaptureTargetTypeEnumExtension { @@ -32,19 +25,17 @@ internal static string ToSerializedValue(this PacketCaptureTargetType? value) { return value == null ? null : ((PacketCaptureTargetType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this PacketCaptureTargetType value) { switch( value ) { case PacketCaptureTargetType.AzureVM: return "AzureVM"; - case PacketCaptureTargetType.AzureVMSS: + case PacketCaptureTargetType.AzureVmss: return "AzureVMSS"; } return null; } - internal static PacketCaptureTargetType? ParsePacketCaptureTargetType(this string value) { switch( value ) @@ -52,9 +43,9 @@ internal static string ToSerializedValue(this PacketCaptureTargetType value) case "AzureVM": return PacketCaptureTargetType.AzureVM; case "AzureVMSS": - return PacketCaptureTargetType.AzureVMSS; + return PacketCaptureTargetType.AzureVmss; } return null; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Page.cs b/src/Network/Network.Management.Sdk/Generated/Models/Page.cs index 7924980c06da..13d5e53160ce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Page.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Page1.cs b/src/Network/Network.Management.Sdk/Generated/Models/Page1.cs index da9fd90c65fa..80ef154f7784 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Page1.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Page1.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page1 : IPage + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Parameter.cs b/src/Network/Network.Management.Sdk/Generated/Models/Parameter.cs index 84ea618c0ba6..80aca42df9f9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Parameter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Parameter.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,21 @@ public Parameter() /// /// Initializes a new instance of the Parameter class. /// - /// List of route prefixes. - /// List of BGP communities. - /// List of AS paths. - public Parameter(IList routePrefix = default(IList), IList community = default(IList), IList asPath = default(IList)) + + /// List of route prefixes. + /// + + /// List of BGP communities. + /// + + /// List of AS paths. + /// + public Parameter(System.Collections.Generic.IList routePrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList community = default(System.Collections.Generic.IList), System.Collections.Generic.IList asPath = default(System.Collections.Generic.IList)) + { - RoutePrefix = routePrefix; - Community = community; - AsPath = asPath; + this.RoutePrefix = routePrefix; + this.Community = community; + this.AsPath = asPath; CustomInit(); } @@ -47,23 +46,23 @@ public Parameter() /// partial void CustomInit(); + /// /// Gets or sets list of route prefixes. /// - [JsonProperty(PropertyName = "routePrefix")] - public IList RoutePrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "routePrefix")] + public System.Collections.Generic.IList RoutePrefix {get; set; } /// /// Gets or sets list of BGP communities. /// - [JsonProperty(PropertyName = "community")] - public IList Community { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "community")] + public System.Collections.Generic.IList Community {get; set; } /// /// Gets or sets list of AS paths. /// - [JsonProperty(PropertyName = "asPath")] - public IList AsPath { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "asPath")] + public System.Collections.Generic.IList AsPath {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PartnerManagedResourceProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PartnerManagedResourceProperties.cs index 0bbbebb93471..e04f548a3514 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PartnerManagedResourceProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PartnerManagedResourceProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PartnerManagedResourceProperties { /// - /// Initializes a new instance of the PartnerManagedResourceProperties - /// class. + /// Initializes a new instance of the PartnerManagedResourceProperties class. /// public PartnerManagedResourceProperties() { @@ -28,19 +21,23 @@ public PartnerManagedResourceProperties() } /// - /// Initializes a new instance of the PartnerManagedResourceProperties - /// class. + /// Initializes a new instance of the PartnerManagedResourceProperties class. /// - /// The partner managed resource id. - /// The partner managed ILB - /// resource id - /// The partner managed SLB - /// resource id + + /// The partner managed resource id. + /// + + /// The partner managed ILB resource id + /// + + /// The partner managed SLB resource id + /// public PartnerManagedResourceProperties(string id = default(string), string internalLoadBalancerId = default(string), string standardLoadBalancerId = default(string)) + { - Id = id; - InternalLoadBalancerId = internalLoadBalancerId; - StandardLoadBalancerId = standardLoadBalancerId; + this.Id = id; + this.InternalLoadBalancerId = internalLoadBalancerId; + this.StandardLoadBalancerId = standardLoadBalancerId; CustomInit(); } @@ -49,23 +46,23 @@ public PartnerManagedResourceProperties() /// partial void CustomInit(); + /// /// Gets the partner managed resource id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the partner managed ILB resource id /// - [JsonProperty(PropertyName = "internalLoadBalancerId")] - public string InternalLoadBalancerId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "internalLoadBalancerId")] + public string InternalLoadBalancerId {get; private set; } /// /// Gets the partner managed SLB resource id /// - [JsonProperty(PropertyName = "standardLoadBalancerId")] - public string StandardLoadBalancerId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "standardLoadBalancerId")] + public string StandardLoadBalancerId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PatchObject.cs b/src/Network/Network.Management.Sdk/Generated/Models/PatchObject.cs index 799e3ee9fa96..8c96c6dd19eb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PatchObject.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PatchObject.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public PatchObject() /// /// Initializes a new instance of the PatchObject class. /// - /// Resource tags. - public PatchObject(IDictionary tags = default(IDictionary)) + + /// Resource tags. + /// + public PatchObject(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -43,11 +38,11 @@ public PatchObject() /// partial void CustomInit(); + /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilter.cs b/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilter.cs index 6fef99dbf985..c23b436a0c8a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilter.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Route Filter Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PatchRouteFilter : SubResource { /// @@ -34,34 +24,46 @@ public PatchRouteFilter() /// /// Initializes a new instance of the PatchRouteFilter class. /// - /// Resource ID. - /// Collection of RouteFilterRules contained within - /// a route filter. - /// A collection of references to express route - /// circuit peerings. - /// A collection of references to express - /// route circuit ipv6 peerings. - /// The provisioning state of the route - /// filter resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - /// Resource tags. - public PatchRouteFilter(string id = default(string), IList rules = default(IList), IList peerings = default(IList), IList ipv6Peerings = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// Resource tags. + /// + + /// The provisioning state of the route filter resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Collection of RouteFilterRules contained within a route filter. + /// + + /// A collection of references to express route circuit peerings. + /// + + /// A collection of references to express route circuit ipv6 peerings. + /// + public PatchRouteFilter(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string provisioningState = default(string), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipv6Peerings = default(System.Collections.Generic.IList)) + + : base(id) { - Rules = rules; - Peerings = peerings; - Ipv6Peerings = ipv6Peerings; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; - Tags = tags; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.Tags = tags; + this.ProvisioningState = provisioningState; + this.Rules = rules; + this.Peerings = peerings; + this.Ipv6Peerings = ipv6Peerings; CustomInit(); } @@ -70,58 +72,56 @@ public PatchRouteFilter() /// partial void CustomInit(); + /// - /// Gets or sets collection of RouteFilterRules contained within a - /// route filter. + /// Gets the name of the resource that is unique within a resource group. This + /// name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets a collection of references to express route circuit peerings. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets a collection of references to express route circuit ipv6 - /// peerings. + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.ipv6Peerings")] - public IList Ipv6Peerings { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the route filter resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets the name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets the provisioning state of the route filter resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets collection of RouteFilterRules contained within a route + /// filter. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } /// - /// Gets resource type. + /// Gets a collection of references to express route circuit peerings. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] + public System.Collections.Generic.IList Peerings {get; private set; } /// - /// Gets or sets resource tags. + /// Gets a collection of references to express route circuit ipv6 peerings. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipv6Peerings")] + public System.Collections.Generic.IList Ipv6Peerings {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilterRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilterRule.cs index dc7c4a6c263f..eb431e5506a0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilterRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PatchRouteFilterRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Route Filter Rule Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PatchRouteFilterRule : SubResource { /// @@ -34,100 +24,85 @@ public PatchRouteFilterRule() /// /// Initializes a new instance of the PatchRouteFilterRule class. /// - /// The access type of the rule. Possible values - /// include: 'Allow', 'Deny' - /// The collection for bgp community values - /// to filter on. e.g. ['12076:5010','12076:5020']. - /// Resource ID. - /// The provisioning state of the route - /// filter rule resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public PatchRouteFilterRule(string access, IList communities, string id = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The access type of the rule. + /// Possible values include: 'Allow', 'Deny' + + /// The provisioning state of the route filter rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The rule type of the rule. + /// Possible values include: 'Community' + + /// The collection for bgp community values to filter on. e.g. + /// ['12076:5010','12076:5020']. + /// + public PatchRouteFilterRule(string id = default(string), string name = default(string), string etag = default(string), string access = default(string), string provisioningState = default(string), string routeFilterRuleType = default(string), System.Collections.Generic.IList communities = default(System.Collections.Generic.IList)) + + : base(id) { - Access = access; - Communities = communities; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.Access = access; + this.ProvisioningState = provisioningState; + this.RouteFilterRuleType = routeFilterRuleType; + this.Communities = communities; CustomInit(); } - /// - /// Static constructor for PatchRouteFilterRule class. - /// - static PatchRouteFilterRule() - { - RouteFilterRuleType = "Community"; - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); - /// - /// Gets or sets the access type of the rule. Possible values include: - /// 'Allow', 'Deny' - /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; set; } /// - /// Gets or sets the collection for bgp community values to filter on. - /// e.g. ['12076:5010','12076:5020']. + /// Gets the name of the resource that is unique within a resource group. This + /// name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.communities")] - public IList Communities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the provisioning state of the route filter rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets or sets the access type of the rule. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the route filter rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// The rule type of the rule. + /// Gets or sets the rule type of the rule. Possible values include: 'Community' /// - [JsonProperty(PropertyName = "properties.routeFilterRuleType")] - public static string RouteFilterRuleType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeFilterRuleType")] + public string RouteFilterRuleType {get; set; } /// - /// Validate the object. + /// Gets or sets the collection for bgp community values to filter on. e.g. + /// ['12076:5010','12076:5020']. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); - } - if (Communities == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Communities"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.communities")] + public System.Collections.Generic.IList Communities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PcError.cs b/src/Network/Network.Management.Sdk/Generated/Models/PcError.cs index 08a2278d4536..29bde40318dd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PcError.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PcError.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PcError. /// + + public static class PcError { public const string InternalError = "InternalError"; @@ -22,4 +19,4 @@ public static class PcError public const string LocalFileFailed = "LocalFileFailed"; public const string StorageFailed = "StorageFailed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PcProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/PcProtocol.cs index 64d8a9c84c1a..f775278e900f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PcProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PcProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PcProtocol. /// + + public static class PcProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; public const string Any = "Any"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PcStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/PcStatus.cs index 3194c3ce44d2..206e173c498b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PcStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PcStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PcStatus. /// + + public static class PcStatus { public const string NotStarted = "NotStarted"; @@ -22,4 +19,4 @@ public static class PcStatus public const string Error = "Error"; public const string Unknown = "Unknown"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnection.cs index abd3ccde8850..ff65c9bebd19 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnection.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering /// resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PeerExpressRouteCircuitConnection : SubResource { /// - /// Initializes a new instance of the PeerExpressRouteCircuitConnection - /// class. + /// Initializes a new instance of the PeerExpressRouteCircuitConnection class. /// public PeerExpressRouteCircuitConnection() { @@ -32,47 +23,59 @@ public PeerExpressRouteCircuitConnection() } /// - /// Initializes a new instance of the PeerExpressRouteCircuitConnection - /// class. + /// Initializes a new instance of the PeerExpressRouteCircuitConnection class. /// - /// Resource ID. - /// Reference to Express Route - /// Circuit Private Peering Resource of the circuit. - /// Reference to Express - /// Route Circuit Private Peering Resource of the peered - /// circuit. - /// /29 IP address space to carve out - /// Customer addresses for tunnels. - /// Express Route Circuit - /// connection state. Possible values include: 'Connected', - /// 'Connecting', 'Disconnected' - /// The name of the express route circuit - /// connection resource. - /// The resource guid of the - /// authorization used for the express route circuit - /// connection. - /// The provisioning state of the peer - /// express route circuit connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public PeerExpressRouteCircuitConnection(string id = default(string), SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string circuitConnectionStatus = default(string), string connectionName = default(string), string authResourceGuid = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the peer express route circuit connection + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Reference to Express Route Circuit Private Peering Resource of the circuit. + /// + + /// Reference to Express Route Circuit Private Peering Resource of the peered + /// circuit. + /// + + /// /29 IP address space to carve out Customer addresses for tunnels. + /// + + /// Express Route Circuit connection state. + /// Possible values include: 'Connected', 'Connecting', 'Disconnected' + + /// The name of the express route circuit connection resource. + /// + + /// The resource guid of the authorization used for the express route circuit + /// connection. + /// + public PeerExpressRouteCircuitConnection(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string circuitConnectionStatus = default(string), string connectionName = default(string), string authResourceGuid = default(string)) + + : base(id) { - ExpressRouteCircuitPeering = expressRouteCircuitPeering; - PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; - AddressPrefix = addressPrefix; - CircuitConnectionStatus = circuitConnectionStatus; - ConnectionName = connectionName; - AuthResourceGuid = authResourceGuid; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.ExpressRouteCircuitPeering = expressRouteCircuitPeering; + this.PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + this.AddressPrefix = addressPrefix; + this.CircuitConnectionStatus = circuitConnectionStatus; + this.ConnectionName = connectionName; + this.AuthResourceGuid = authResourceGuid; CustomInit(); } @@ -81,75 +84,72 @@ public PeerExpressRouteCircuitConnection() /// partial void CustomInit(); + /// - /// Gets or sets reference to Express Route Circuit Private Peering - /// Resource of the circuit. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] - public SubResource ExpressRouteCircuitPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets reference to Express Route Circuit Private Peering - /// Resource of the peered circuit. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.peerExpressRouteCircuitPeering")] - public SubResource PeerExpressRouteCircuitPeering { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets /29 IP address space to carve out Customer addresses - /// for tunnels. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets express Route Circuit connection state. Possible - /// values include: 'Connected', 'Connecting', 'Disconnected' + /// Gets the provisioning state of the peer express route circuit connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.circuitConnectionStatus")] - public string CircuitConnectionStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the express route circuit connection - /// resource. + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the circuit. /// - [JsonProperty(PropertyName = "properties.connectionName")] - public string ConnectionName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] + public SubResource ExpressRouteCircuitPeering {get; set; } /// - /// Gets or sets the resource guid of the authorization used for the - /// express route circuit connection. + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the peered circuit. /// - [JsonProperty(PropertyName = "properties.authResourceGuid")] - public string AuthResourceGuid { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerExpressRouteCircuitPeering")] + public SubResource PeerExpressRouteCircuitPeering {get; set; } /// - /// Gets the provisioning state of the peer express route circuit - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets or sets /29 IP address space to carve out Customer addresses for + /// tunnels. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuitConnectionStatus")] + public string CircuitConnectionStatus {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the name of the express route circuit connection resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionName")] + public string ConnectionName {get; set; } /// - /// Gets type of the resource. + /// Gets or sets the resource guid of the authorization used for the express + /// route circuit connection. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authResourceGuid")] + public string AuthResourceGuid {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnectionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnectionPropertiesFormat.cs new file mode 100644 index 000000000000..c8cddaf4973a --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PeerExpressRouteCircuitConnectionPropertiesFormat.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the peer express route circuit connection. + /// + public partial class PeerExpressRouteCircuitConnectionPropertiesFormat + { + /// + /// Initializes a new instance of the PeerExpressRouteCircuitConnectionPropertiesFormat class. + /// + public PeerExpressRouteCircuitConnectionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeerExpressRouteCircuitConnectionPropertiesFormat class. + /// + + /// Reference to Express Route Circuit Private Peering Resource of the circuit. + /// + + /// Reference to Express Route Circuit Private Peering Resource of the peered + /// circuit. + /// + + /// /29 IP address space to carve out Customer addresses for tunnels. + /// + + /// Express Route Circuit connection state. + /// Possible values include: 'Connected', 'Connecting', 'Disconnected' + + /// The name of the express route circuit connection resource. + /// + + /// The resource guid of the authorization used for the express route circuit + /// connection. + /// + + /// The provisioning state of the peer express route circuit connection + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public PeerExpressRouteCircuitConnectionPropertiesFormat(SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string circuitConnectionStatus = default(string), string connectionName = default(string), string authResourceGuid = default(string), string provisioningState = default(string)) + + { + this.ExpressRouteCircuitPeering = expressRouteCircuitPeering; + this.PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + this.AddressPrefix = addressPrefix; + this.CircuitConnectionStatus = circuitConnectionStatus; + this.ConnectionName = connectionName; + this.AuthResourceGuid = authResourceGuid; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteCircuitPeering")] + public SubResource ExpressRouteCircuitPeering {get; set; } + + /// + /// Gets or sets reference to Express Route Circuit Private Peering Resource of + /// the peered circuit. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerExpressRouteCircuitPeering")] + public SubResource PeerExpressRouteCircuitPeering {get; set; } + + /// + /// Gets or sets /29 IP address space to carve out Customer addresses for + /// tunnels. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } + + /// + /// Gets express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "circuitConnectionStatus")] + public string CircuitConnectionStatus {get; private set; } + + /// + /// Gets or sets the name of the express route circuit connection resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionName")] + public string ConnectionName {get; set; } + + /// + /// Gets or sets the resource guid of the authorization used for the express + /// route circuit connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authResourceGuid")] + public string AuthResourceGuid {get; set; } + + /// + /// Gets the provisioning state of the peer express route circuit connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PeerRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/PeerRoute.cs index 4652c6c4d956..dfa501a801c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PeerRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PeerRoute.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,24 +23,37 @@ public PeerRoute() /// /// Initializes a new instance of the PeerRoute class. /// - /// The peer's local address. - /// The route's network prefix. - /// The route's next hop. - /// The peer this route was learned - /// from. - /// The source this route was learned - /// from. - /// The route's AS path sequence. - /// The route's weight. + + /// The peer's local address. + /// + + /// The route's network prefix. + /// + + /// The route's next hop. + /// + + /// The peer this route was learned from. + /// + + /// The source this route was learned from. + /// + + /// The route's AS path sequence. + /// + + /// The route's weight. + /// public PeerRoute(string localAddress = default(string), string network = default(string), string nextHop = default(string), string sourcePeer = default(string), string origin = default(string), string asPath = default(string), int? weight = default(int?)) + { - LocalAddress = localAddress; - Network = network; - NextHop = nextHop; - SourcePeer = sourcePeer; - Origin = origin; - AsPath = asPath; - Weight = weight; + this.LocalAddress = localAddress; + this.Network = network; + this.NextHop = nextHop; + this.SourcePeer = sourcePeer; + this.Origin = origin; + this.AsPath = asPath; + this.Weight = weight; CustomInit(); } @@ -55,47 +62,47 @@ public PeerRoute() /// partial void CustomInit(); + /// - /// Gets the peer's local address. + /// Gets the peer's local address. /// - [JsonProperty(PropertyName = "localAddress")] - public string LocalAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localAddress")] + public string LocalAddress {get; private set; } /// - /// Gets the route's network prefix. + /// Gets the route's network prefix. /// - [JsonProperty(PropertyName = "network")] - public string Network { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "network")] + public string Network {get; private set; } /// - /// Gets the route's next hop. + /// Gets the route's next hop. /// - [JsonProperty(PropertyName = "nextHop")] - public string NextHop { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] + public string NextHop {get; private set; } /// /// Gets the peer this route was learned from. /// - [JsonProperty(PropertyName = "sourcePeer")] - public string SourcePeer { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePeer")] + public string SourcePeer {get; private set; } /// /// Gets the source this route was learned from. /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; private set; } /// - /// Gets the route's AS path sequence. + /// Gets the route's AS path sequence. /// - [JsonProperty(PropertyName = "asPath")] - public string AsPath { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asPath")] + public string AsPath {get; private set; } /// - /// Gets the route's weight. + /// Gets the route's weight. /// - [JsonProperty(PropertyName = "weight")] - public int? Weight { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "weight")] + public int? Weight {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PfsGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/PfsGroup.cs index f57d2fc2ead6..9b75acb68016 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PfsGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PfsGroup.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PfsGroup. /// + + public static class PfsGroup { public const string None = "None"; @@ -24,6 +21,6 @@ public static class PfsGroup public const string ECP384 = "ECP384"; public const string PFS24 = "PFS24"; public const string PFS14 = "PFS14"; - public const string PFSMM = "PFSMM"; + public const string Pfsmm = "PFSMM"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PolicySettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/PolicySettings.cs index 0f4811b936c0..8a397db1ec4f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PolicySettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PolicySettings.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,41 +23,55 @@ public PolicySettings() /// /// Initializes a new instance of the PolicySettings class. /// - /// The state of the policy. Possible values - /// include: 'Disabled', 'Enabled' - /// The mode of the policy. Possible values include: - /// 'Prevention', 'Detection' - /// Whether to allow WAF to check - /// request Body. - /// Max inspection limit in - /// KB for request body inspection for WAF. - /// Whether allow WAF to enforce - /// request body limits. - /// Maximum request body size in - /// Kb for WAF. - /// Whether allow WAF to enforce - /// file upload limits. - /// Maximum file upload size in Mb - /// for WAF. - /// If the action type is - /// block, customer can override the response status code. - /// If the action type is block, - /// customer can override the response body. The body must be specified - /// in base64 encoding. - /// To scrub sensitive log fields - public PolicySettings(string state = default(string), string mode = default(string), bool? requestBodyCheck = default(bool?), int? requestBodyInspectLimitInKB = default(int?), bool? requestBodyEnforcement = default(bool?), int? maxRequestBodySizeInKb = default(int?), bool? fileUploadEnforcement = default(bool?), int? fileUploadLimitInMb = default(int?), int? customBlockResponseStatusCode = default(int?), string customBlockResponseBody = default(string), PolicySettingsLogScrubbing logScrubbing = default(PolicySettingsLogScrubbing)) + + /// The state of the policy. + /// Possible values include: 'Disabled', 'Enabled' + + /// The mode of the policy. + /// Possible values include: 'Prevention', 'Detection' + + /// Whether to allow WAF to check request Body. + /// + + /// Max inspection limit in KB for request body inspection for WAF. + /// + + /// Whether allow WAF to enforce request body limits. + /// + + /// Maximum request body size in Kb for WAF. + /// + + /// Whether allow WAF to enforce file upload limits. + /// + + /// Maximum file upload size in Mb for WAF. + /// + + /// If the action type is block, customer can override the response status + /// code. + /// + + /// If the action type is block, customer can override the response body. The + /// body must be specified in base64 encoding. + /// + + /// To scrub sensitive log fields + /// + public PolicySettings(string state = default(string), string mode = default(string), bool? requestBodyCheck = default(bool?), int? requestBodyInspectLimitInKb = default(int?), bool? requestBodyEnforcement = default(bool?), int? maxRequestBodySizeInKb = default(int?), bool? fileUploadEnforcement = default(bool?), int? fileUploadLimitInMb = default(int?), int? customBlockResponseStatusCode = default(int?), string customBlockResponseBody = default(string), PolicySettingsLogScrubbing logScrubbing = default(PolicySettingsLogScrubbing)) + { - State = state; - Mode = mode; - RequestBodyCheck = requestBodyCheck; - RequestBodyInspectLimitInKB = requestBodyInspectLimitInKB; - RequestBodyEnforcement = requestBodyEnforcement; - MaxRequestBodySizeInKb = maxRequestBodySizeInKb; - FileUploadEnforcement = fileUploadEnforcement; - FileUploadLimitInMb = fileUploadLimitInMb; - CustomBlockResponseStatusCode = customBlockResponseStatusCode; - CustomBlockResponseBody = customBlockResponseBody; - LogScrubbing = logScrubbing; + this.State = state; + this.Mode = mode; + this.RequestBodyCheck = requestBodyCheck; + this.RequestBodyInspectLimitInKb = requestBodyInspectLimitInKb; + this.RequestBodyEnforcement = requestBodyEnforcement; + this.MaxRequestBodySizeInKb = maxRequestBodySizeInKb; + this.FileUploadEnforcement = fileUploadEnforcement; + this.FileUploadLimitInMb = fileUploadLimitInMb; + this.CustomBlockResponseStatusCode = customBlockResponseStatusCode; + this.CustomBlockResponseBody = customBlockResponseBody; + this.LogScrubbing = logScrubbing; CustomInit(); } @@ -73,117 +80,118 @@ public PolicySettings() /// partial void CustomInit(); + /// - /// Gets or sets the state of the policy. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets or sets the state of the policy. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// - /// Gets or sets the mode of the policy. Possible values include: - /// 'Prevention', 'Detection' + /// Gets or sets the mode of the policy. Possible values include: 'Prevention', 'Detection' /// - [JsonProperty(PropertyName = "mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } /// /// Gets or sets whether to allow WAF to check request Body. /// - [JsonProperty(PropertyName = "requestBodyCheck")] - public bool? RequestBodyCheck { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestBodyCheck")] + public bool? RequestBodyCheck {get; set; } /// - /// Gets or sets max inspection limit in KB for request body inspection - /// for WAF. + /// Gets or sets max inspection limit in KB for request body inspection for + /// WAF. /// - [JsonProperty(PropertyName = "requestBodyInspectLimitInKB")] - public int? RequestBodyInspectLimitInKB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestBodyInspectLimitInKB")] + public int? RequestBodyInspectLimitInKb {get; set; } /// /// Gets or sets whether allow WAF to enforce request body limits. /// - [JsonProperty(PropertyName = "requestBodyEnforcement")] - public bool? RequestBodyEnforcement { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestBodyEnforcement")] + public bool? RequestBodyEnforcement {get; set; } /// /// Gets or sets maximum request body size in Kb for WAF. /// - [JsonProperty(PropertyName = "maxRequestBodySizeInKb")] - public int? MaxRequestBodySizeInKb { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxRequestBodySizeInKb")] + public int? MaxRequestBodySizeInKb {get; set; } /// /// Gets or sets whether allow WAF to enforce file upload limits. /// - [JsonProperty(PropertyName = "fileUploadEnforcement")] - public bool? FileUploadEnforcement { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fileUploadEnforcement")] + public bool? FileUploadEnforcement {get; set; } /// /// Gets or sets maximum file upload size in Mb for WAF. /// - [JsonProperty(PropertyName = "fileUploadLimitInMb")] - public int? FileUploadLimitInMb { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fileUploadLimitInMb")] + public int? FileUploadLimitInMb {get; set; } /// /// Gets or sets if the action type is block, customer can override the /// response status code. /// - [JsonProperty(PropertyName = "customBlockResponseStatusCode")] - public int? CustomBlockResponseStatusCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customBlockResponseStatusCode")] + public int? CustomBlockResponseStatusCode {get; set; } /// /// Gets or sets if the action type is block, customer can override the /// response body. The body must be specified in base64 encoding. /// - [JsonProperty(PropertyName = "customBlockResponseBody")] - public string CustomBlockResponseBody { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customBlockResponseBody")] + public string CustomBlockResponseBody {get; set; } /// /// Gets or sets to scrub sensitive log fields /// - [JsonProperty(PropertyName = "logScrubbing")] - public PolicySettingsLogScrubbing LogScrubbing { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "logScrubbing")] + public PolicySettingsLogScrubbing LogScrubbing {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MaxRequestBodySizeInKb != null) + + + if (this.MaxRequestBodySizeInKb != null) { - if (MaxRequestBodySizeInKb < 8) + if (this.MaxRequestBodySizeInKb < 8) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); } } - if (FileUploadLimitInMb != null) + if (this.FileUploadLimitInMb != null) { - if (FileUploadLimitInMb < 0) + if (this.FileUploadLimitInMb < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); } } - if (CustomBlockResponseStatusCode != null) + if (this.CustomBlockResponseStatusCode != null) { - if (CustomBlockResponseStatusCode < 0) + if (this.CustomBlockResponseStatusCode < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CustomBlockResponseStatusCode", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "CustomBlockResponseStatusCode", 0); } } - if (CustomBlockResponseBody != null) + if (this.CustomBlockResponseBody != null) { - if (CustomBlockResponseBody.Length > 32768) + if (this.CustomBlockResponseBody.Length > 32768) { - throw new ValidationException(ValidationRules.MaxLength, "CustomBlockResponseBody", 32768); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "CustomBlockResponseBody", 32768); } - if (!System.Text.RegularExpressions.Regex.IsMatch(CustomBlockResponseBody, "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.CustomBlockResponseBody, "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$")) { - throw new ValidationException(ValidationRules.Pattern, "CustomBlockResponseBody", "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "CustomBlockResponseBody", "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$"); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PolicySettingsLogScrubbing.cs b/src/Network/Network.Management.Sdk/Generated/Models/PolicySettingsLogScrubbing.cs index 9397d46bd86e..c3dce42040dd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PolicySettingsLogScrubbing.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PolicySettingsLogScrubbing.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,15 +23,17 @@ public PolicySettingsLogScrubbing() /// /// Initializes a new instance of the PolicySettingsLogScrubbing class. /// - /// State of the log scrubbing config. Default - /// value is Enabled. Possible values include: 'Disabled', - /// 'Enabled' - /// The rules that are applied to the logs - /// for scrubbing. - public PolicySettingsLogScrubbing(string state = default(string), IList scrubbingRules = default(IList)) + + /// State of the log scrubbing config. Default value is Enabled. + /// Possible values include: 'Disabled', 'Enabled' + + /// The rules that are applied to the logs for scrubbing. + /// + public PolicySettingsLogScrubbing(string state = default(string), System.Collections.Generic.IList scrubbingRules = default(System.Collections.Generic.IList)) + { - State = state; - ScrubbingRules = scrubbingRules; + this.State = state; + this.ScrubbingRules = scrubbingRules; CustomInit(); } @@ -48,18 +42,17 @@ public PolicySettingsLogScrubbing() /// partial void CustomInit(); + /// - /// Gets or sets state of the log scrubbing config. Default value is - /// Enabled. Possible values include: 'Disabled', 'Enabled' + /// Gets or sets state of the log scrubbing config. Default value is Enabled. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// /// Gets or sets the rules that are applied to the logs for scrubbing. /// - [JsonProperty(PropertyName = "scrubbingRules")] - public IList ScrubbingRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scrubbingRules")] + public System.Collections.Generic.IList ScrubbingRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PreferredIPVersion.cs b/src/Network/Network.Management.Sdk/Generated/Models/PreferredIPVersion.cs index 3dc6ad964af5..17510ad6e2ff 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PreferredIPVersion.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PreferredIPVersion.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PreferredIPVersion. /// + + public static class PreferredIPVersion { public const string IPv4 = "IPv4"; public const string IPv6 = "IPv6"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PreferredRoutingGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/PreferredRoutingGateway.cs index 0e8946f41322..e8593e2a06ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PreferredRoutingGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PreferredRoutingGateway.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PreferredRoutingGateway. /// + + public static class PreferredRoutingGateway { public const string ExpressRoute = "ExpressRoute"; public const string VpnGateway = "VpnGateway"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrepareNetworkPoliciesRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrepareNetworkPoliciesRequest.cs index 03049ba46c11..1413d59686d0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrepareNetworkPoliciesRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrepareNetworkPoliciesRequest.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PrepareNetworkPoliciesRequest { /// - /// Initializes a new instance of the PrepareNetworkPoliciesRequest - /// class. + /// Initializes a new instance of the PrepareNetworkPoliciesRequest class. /// public PrepareNetworkPoliciesRequest() { @@ -30,17 +21,19 @@ public PrepareNetworkPoliciesRequest() } /// - /// Initializes a new instance of the PrepareNetworkPoliciesRequest - /// class. + /// Initializes a new instance of the PrepareNetworkPoliciesRequest class. /// - /// The name of the service for which subnet - /// is being prepared for. - /// A list of - /// NetworkIntentPolicyConfiguration. - public PrepareNetworkPoliciesRequest(string serviceName = default(string), IList networkIntentPolicyConfigurations = default(IList)) + + /// The name of the service for which subnet is being prepared for. + /// + + /// A list of NetworkIntentPolicyConfiguration. + /// + public PrepareNetworkPoliciesRequest(string serviceName = default(string), System.Collections.Generic.IList networkIntentPolicyConfigurations = default(System.Collections.Generic.IList)) + { - ServiceName = serviceName; - NetworkIntentPolicyConfigurations = networkIntentPolicyConfigurations; + this.ServiceName = serviceName; + this.NetworkIntentPolicyConfigurations = networkIntentPolicyConfigurations; CustomInit(); } @@ -49,18 +42,18 @@ public PrepareNetworkPoliciesRequest() /// partial void CustomInit(); + /// - /// Gets or sets the name of the service for which subnet is being - /// prepared for. + /// Gets or sets the name of the service for which subnet is being prepared + /// for. /// - [JsonProperty(PropertyName = "serviceName")] - public string ServiceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } /// /// Gets or sets a list of NetworkIntentPolicyConfiguration. /// - [JsonProperty(PropertyName = "networkIntentPolicyConfigurations")] - public IList NetworkIntentPolicyConfigurations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkIntentPolicyConfigurations")] + public System.Collections.Generic.IList NetworkIntentPolicyConfigurations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneConfig.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneConfig.cs index 45810f3374ca..42b47d0cd5a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneConfig.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneConfig.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// PrivateDnsZoneConfig resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateDnsZoneConfig { /// @@ -34,19 +24,23 @@ public PrivateDnsZoneConfig() /// /// Initializes a new instance of the PrivateDnsZoneConfig class. /// - /// Name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// The resource id of the private dns - /// zone. - /// A collection of information regarding a - /// recordSet, holding information to identify private - /// resources. - public PrivateDnsZoneConfig(string name = default(string), string privateDnsZoneId = default(string), IList recordSets = default(IList)) + + /// Name of the resource that is unique within a resource group. This name can + /// be used to access the resource. + /// + + /// The resource id of the private dns zone. + /// + + /// A collection of information regarding a recordSet, holding information to + /// identify private resources. + /// + public PrivateDnsZoneConfig(string name = default(string), string privateDnsZoneId = default(string), System.Collections.Generic.IList recordSets = default(System.Collections.Generic.IList)) + { - Name = name; - PrivateDnsZoneId = privateDnsZoneId; - RecordSets = recordSets; + this.Name = name; + this.PrivateDnsZoneId = privateDnsZoneId; + this.RecordSets = recordSets; CustomInit(); } @@ -55,25 +49,25 @@ public PrivateDnsZoneConfig() /// partial void CustomInit(); + /// - /// Gets or sets name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets or sets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the resource id of the private dns zone. /// - [JsonProperty(PropertyName = "properties.privateDnsZoneId")] - public string PrivateDnsZoneId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateDnsZoneId")] + public string PrivateDnsZoneId {get; set; } /// - /// Gets a collection of information regarding a recordSet, holding - /// information to identify private resources. + /// Gets a collection of information regarding a recordSet, holding information + /// to identify private resources. /// - [JsonProperty(PropertyName = "properties.recordSets")] - public IList RecordSets { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.recordSets")] + public System.Collections.Generic.IList RecordSets {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroup.cs index caf5c38ff790..9f510b2ffdce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroup.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Private dns zone group resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateDnsZoneGroup : SubResource { /// @@ -34,24 +24,31 @@ public PrivateDnsZoneGroup() /// /// Initializes a new instance of the PrivateDnsZoneGroup class. /// - /// Resource ID. - /// Name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The provisioning state of the - /// private dns zone group resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// A collection of private dns - /// zone configurations of the private dns zone group. - public PrivateDnsZoneGroup(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), IList privateDnsZoneConfigs = default(IList)) - : base(id) + + /// Resource ID. + /// + + /// Name of the resource that is unique within a resource group. This name can + /// be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the private dns zone group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A collection of private dns zone configurations of the private dns zone + /// group. + /// + public PrivateDnsZoneGroup(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList privateDnsZoneConfigs = default(System.Collections.Generic.IList)) + + : base(id) { - Name = name; - Etag = etag; - ProvisioningState = provisioningState; - PrivateDnsZoneConfigs = privateDnsZoneConfigs; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.PrivateDnsZoneConfigs = privateDnsZoneConfigs; CustomInit(); } @@ -60,34 +57,32 @@ public PrivateDnsZoneGroup() /// partial void CustomInit(); + /// - /// Gets or sets name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets or sets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the private dns zone group resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the private dns zone group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets a collection of private dns zone configurations of the - /// private dns zone group. + /// Gets or sets a collection of private dns zone configurations of the private + /// dns zone group. /// - [JsonProperty(PropertyName = "properties.privateDnsZoneConfigs")] - public IList PrivateDnsZoneConfigs { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateDnsZoneConfigs")] + public System.Collections.Generic.IList PrivateDnsZoneConfigs {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroupPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroupPropertiesFormat.cs new file mode 100644 index 000000000000..0f03fe2d3d04 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZoneGroupPropertiesFormat.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the private dns zone group. + /// + public partial class PrivateDnsZoneGroupPropertiesFormat + { + /// + /// Initializes a new instance of the PrivateDnsZoneGroupPropertiesFormat class. + /// + public PrivateDnsZoneGroupPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateDnsZoneGroupPropertiesFormat class. + /// + + /// The provisioning state of the private dns zone group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A collection of private dns zone configurations of the private dns zone + /// group. + /// + public PrivateDnsZoneGroupPropertiesFormat(string provisioningState = default(string), System.Collections.Generic.IList privateDnsZoneConfigs = default(System.Collections.Generic.IList)) + + { + this.ProvisioningState = provisioningState; + this.PrivateDnsZoneConfigs = privateDnsZoneConfigs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the private dns zone group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets a collection of private dns zone configurations of the private + /// dns zone group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateDnsZoneConfigs")] + public System.Collections.Generic.IList PrivateDnsZoneConfigs {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZonePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZonePropertiesFormat.cs new file mode 100644 index 000000000000..18a5c152c7ba --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateDnsZonePropertiesFormat.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the private dns zone configuration resource. + /// + public partial class PrivateDnsZonePropertiesFormat + { + /// + /// Initializes a new instance of the PrivateDnsZonePropertiesFormat class. + /// + public PrivateDnsZonePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateDnsZonePropertiesFormat class. + /// + + /// The resource id of the private dns zone. + /// + + /// A collection of information regarding a recordSet, holding information to + /// identify private resources. + /// + public PrivateDnsZonePropertiesFormat(string privateDnsZoneId = default(string), System.Collections.Generic.IList recordSets = default(System.Collections.Generic.IList)) + + { + this.PrivateDnsZoneId = privateDnsZoneId; + this.RecordSets = recordSets; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource id of the private dns zone. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateDnsZoneId")] + public string PrivateDnsZoneId {get; set; } + + /// + /// Gets a collection of information regarding a recordSet, holding information + /// to identify private resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recordSets")] + public System.Collections.Generic.IList RecordSets {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpoint.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpoint.cs index a1bb0fdda2b0..6d98465ae0de 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpoint.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpoint.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Private endpoint resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateEndpoint : Resource { /// @@ -34,51 +24,74 @@ public PrivateEndpoint() /// /// Initializes a new instance of the PrivateEndpoint class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the load - /// balancer. - /// The ID of the subnet from which the private IP - /// will be allocated. - /// An array of references to the - /// network interfaces created for this private endpoint. - /// The provisioning state of the - /// private endpoint resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A grouping of - /// information about the connection to the remote resource. - /// A grouping of - /// information about the connection to the remote resource. Used when - /// the network admin does not have access to approve connections to - /// the remote resource. - /// An array of custom dns - /// configurations. - /// Application security groups - /// in which the private endpoint IP configuration is included. - /// A list of IP configurations of the - /// private endpoint. This will be used to map to the First Party - /// Service's endpoints. - /// The custom name of the - /// network interface attached to the private endpoint. - /// A unique read-only string that changes whenever - /// the resource is updated. - public PrivateEndpoint(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), Subnet subnet = default(Subnet), IList networkInterfaces = default(IList), string provisioningState = default(string), IList privateLinkServiceConnections = default(IList), IList manualPrivateLinkServiceConnections = default(IList), IList customDnsConfigs = default(IList), IList applicationSecurityGroups = default(IList), IList ipConfigurations = default(IList), string customNetworkInterfaceName = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the load balancer. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The ID of the subnet from which the private IP will be allocated. + /// + + /// The provisioning state of the private endpoint resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// An array of references to the network interfaces created for this private + /// endpoint. + /// + + /// A grouping of information about the connection to the remote resource. + /// + + /// A grouping of information about the connection to the remote resource. Used + /// when the network admin does not have access to approve connections to the + /// remote resource. + /// + + /// An array of custom dns configurations. + /// + + /// Application security groups in which the private endpoint IP configuration + /// is included. + /// + + /// A list of IP configurations of the private endpoint. This will be used to + /// map to the First Party Service's endpoints. + /// + + /// The custom name of the network interface attached to the private endpoint. + /// + public PrivateEndpoint(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateLinkServiceConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList manualPrivateLinkServiceConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList customDnsConfigs = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string customNetworkInterfaceName = default(string)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - Subnet = subnet; - NetworkInterfaces = networkInterfaces; - ProvisioningState = provisioningState; - PrivateLinkServiceConnections = privateLinkServiceConnections; - ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; - CustomDnsConfigs = customDnsConfigs; - ApplicationSecurityGroups = applicationSecurityGroups; - IpConfigurations = ipConfigurations; - CustomNetworkInterfaceName = customNetworkInterfaceName; - Etag = etag; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + this.NetworkInterfaces = networkInterfaces; + this.PrivateLinkServiceConnections = privateLinkServiceConnections; + this.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; + this.CustomDnsConfigs = customDnsConfigs; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.IPConfigurations = ipConfigurations; + this.CustomNetworkInterfaceName = customNetworkInterfaceName; CustomInit(); } @@ -87,82 +100,80 @@ public PrivateEndpoint() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the load balancer. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets the ID of the subnet from which the private IP will be - /// allocated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets an array of references to the network interfaces created for - /// this private endpoint. + /// Gets or sets the ID of the subnet from which the private IP will be + /// allocated. /// - [JsonProperty(PropertyName = "properties.networkInterfaces")] - public IList NetworkInterfaces { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets the provisioning state of the private endpoint resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the private endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets a grouping of information about the connection to the - /// remote resource. + /// Gets an array of references to the network interfaces created for this + /// private endpoint. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnections")] - public IList PrivateLinkServiceConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; private set; } /// - /// Gets or sets a grouping of information about the connection to the - /// remote resource. Used when the network admin does not have access - /// to approve connections to the remote resource. + /// Gets or sets a grouping of information about the connection to the remote + /// resource. /// - [JsonProperty(PropertyName = "properties.manualPrivateLinkServiceConnections")] - public IList ManualPrivateLinkServiceConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceConnections")] + public System.Collections.Generic.IList PrivateLinkServiceConnections {get; set; } /// - /// Gets or sets an array of custom dns configurations. + /// Gets or sets a grouping of information about the connection to the remote + /// resource. Used when the network admin does not have access to approve + /// connections to the remote resource. /// - [JsonProperty(PropertyName = "properties.customDnsConfigs")] - public IList CustomDnsConfigs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.manualPrivateLinkServiceConnections")] + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections {get; set; } /// - /// Gets or sets application security groups in which the private - /// endpoint IP configuration is included. + /// Gets or sets an array of custom dns configurations. /// - [JsonProperty(PropertyName = "properties.applicationSecurityGroups")] - public IList ApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customDnsConfigs")] + public System.Collections.Generic.IList CustomDnsConfigs {get; set; } /// - /// Gets or sets a list of IP configurations of the private endpoint. - /// This will be used to map to the First Party Service's endpoints. + /// Gets or sets application security groups in which the private endpoint IP + /// configuration is included. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } /// - /// Gets or sets the custom name of the network interface attached to - /// the private endpoint. + /// Gets or sets a list of IP configurations of the private endpoint. This will + /// be used to map to the First Party Service's endpoints. /// - [JsonProperty(PropertyName = "properties.customNetworkInterfaceName")] - public string CustomNetworkInterfaceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the custom name of the network interface attached to the + /// private endpoint. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customNetworkInterfaceName")] + public string CustomNetworkInterfaceName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs index 686913ec6712..e1029604b0d9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// PrivateEndpointConnection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateEndpointConnection : SubResource { /// @@ -32,35 +24,47 @@ public PrivateEndpointConnection() /// /// Initializes a new instance of the PrivateEndpointConnection class. /// - /// Resource ID. - /// The resource of private end - /// point. - /// A collection of - /// information about the state of the connection between service - /// consumer and provider. - /// The provisioning state of the - /// private endpoint connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The consumer link id. - /// The location of the private - /// endpoint. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// The resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public PrivateEndpointConnection(string id = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string), string linkIdentifier = default(string), string privateEndpointLocation = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// The resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The resource of private end point. + /// + + /// The provisioning state of the private endpoint connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + + /// The consumer link id. + /// + + /// The location of the private endpoint. + /// + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string linkIdentifier = default(string), string privateEndpointLocation = default(string)) + + : base(id) { - PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - ProvisioningState = provisioningState; - LinkIdentifier = linkIdentifier; - PrivateEndpointLocation = privateEndpointLocation; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.PrivateEndpoint = privateEndpoint; + this.ProvisioningState = provisioningState; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + this.LinkIdentifier = linkIdentifier; + this.PrivateEndpointLocation = privateEndpointLocation; CustomInit(); } @@ -69,58 +73,56 @@ public PrivateEndpointConnection() /// partial void CustomInit(); + /// - /// Gets the resource of private end point. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.privateEndpoint")] - public PrivateEndpoint PrivateEndpoint { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets a collection of information about the state of the - /// connection between service consumer and provider. + /// Gets the resource type. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] - public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the private endpoint connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the consumer link id. + /// Gets the resource of private end point. /// - [JsonProperty(PropertyName = "properties.linkIdentifier")] - public string LinkIdentifier { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } /// - /// Gets the location of the private endpoint. + /// Gets the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.privateEndpointLocation")] - public string PrivateEndpointLocation { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets a collection of information about the state of the connection + /// between service consumer and provider. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } /// - /// Gets the resource type. + /// Gets the consumer link id. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkIdentifier")] + public string LinkIdentifier {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the location of the private endpoint. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpointLocation")] + public string PrivateEndpointLocation {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..baf98e938be6 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the PrivateEndpointConnectProperties. + /// + public partial class PrivateEndpointConnectionProperties + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionProperties class. + /// + public PrivateEndpointConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionProperties class. + /// + + /// The resource of private end point. + /// + + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + + /// The provisioning state of the private endpoint connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The consumer link id. + /// + + /// The location of the private endpoint. + /// + public PrivateEndpointConnectionProperties(PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string), string linkIdentifier = default(string), string privateEndpointLocation = default(string)) + + { + this.PrivateEndpoint = privateEndpoint; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + this.ProvisioningState = provisioningState; + this.LinkIdentifier = linkIdentifier; + this.PrivateEndpointLocation = privateEndpointLocation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the resource of private end point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } + + /// + /// Gets or sets a collection of information about the state of the connection + /// between service consumer and provider. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } + + /// + /// Gets the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the consumer link id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkIdentifier")] + public string LinkIdentifier {get; private set; } + + /// + /// Gets the location of the private endpoint. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointLocation")] + public string PrivateEndpointLocation {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfiguration.cs index 10ee8558b747..74f87a2dd070 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// An IP Configuration of the private endpoint. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateEndpointIPConfiguration { /// - /// Initializes a new instance of the PrivateEndpointIPConfiguration - /// class. + /// Initializes a new instance of the PrivateEndpointIPConfiguration class. /// public PrivateEndpointIPConfiguration() { @@ -31,29 +22,37 @@ public PrivateEndpointIPConfiguration() } /// - /// Initializes a new instance of the PrivateEndpointIPConfiguration - /// class. + /// Initializes a new instance of the PrivateEndpointIPConfiguration class. /// - /// The ID of a group obtained from the remote - /// resource that this private endpoint should connect to. - /// The member name of a group obtained from - /// the remote resource that this private endpoint should connect - /// to. - /// A private ip address obtained from - /// the private endpoint's subnet. - /// The name of the resource that is unique within a - /// resource group. - /// The resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public PrivateEndpointIPConfiguration(string groupId = default(string), string memberName = default(string), string privateIPAddress = default(string), string name = default(string), string type = default(string), string etag = default(string)) + + /// The name of the resource that is unique within a resource group. + /// + + /// The resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The ID of a group obtained from the remote resource that this private + /// endpoint should connect to. + /// + + /// The member name of a group obtained from the remote resource that this + /// private endpoint should connect to. + /// + + /// A private ip address obtained from the private endpoint's subnet. + /// + public PrivateEndpointIPConfiguration(string name = default(string), string type = default(string), string etag = default(string), string groupId = default(string), string memberName = default(string), string privateIPAddress = default(string)) + { - GroupId = groupId; - MemberName = memberName; - PrivateIPAddress = privateIPAddress; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.GroupId = groupId; + this.MemberName = memberName; + this.PrivateIPAddress = privateIPAddress; CustomInit(); } @@ -62,46 +61,46 @@ public PrivateEndpointIPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the ID of a group obtained from the remote resource - /// that this private endpoint should connect to. + /// Gets or sets the name of the resource that is unique within a resource + /// group. /// - [JsonProperty(PropertyName = "properties.groupId")] - public string GroupId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the member name of a group obtained from the remote - /// resource that this private endpoint should connect to. + /// Gets the resource type. /// - [JsonProperty(PropertyName = "properties.memberName")] - public string MemberName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets a private ip address obtained from the private - /// endpoint's subnet. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. + /// Gets or sets the ID of a group obtained from the remote resource that this + /// private endpoint should connect to. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.groupId")] + public string GroupId {get; set; } /// - /// Gets the resource type. + /// Gets or sets the member name of a group obtained from the remote resource + /// that this private endpoint should connect to. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.memberName")] + public string MemberName {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets a private ip address obtained from the private endpoint's + /// subnet. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfigurationProperties.cs new file mode 100644 index 000000000000..35e7beb0bc65 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointIPConfigurationProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of an IP Configuration of the private endpoint. + /// + public partial class PrivateEndpointIPConfigurationProperties + { + /// + /// Initializes a new instance of the PrivateEndpointIPConfigurationProperties class. + /// + public PrivateEndpointIPConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointIPConfigurationProperties class. + /// + + /// The ID of a group obtained from the remote resource that this private + /// endpoint should connect to. + /// + + /// The member name of a group obtained from the remote resource that this + /// private endpoint should connect to. + /// + + /// A private ip address obtained from the private endpoint's subnet. + /// + public PrivateEndpointIPConfigurationProperties(string groupId = default(string), string memberName = default(string), string privateIPAddress = default(string)) + + { + this.GroupId = groupId; + this.MemberName = memberName; + this.PrivateIPAddress = privateIPAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the ID of a group obtained from the remote resource that this + /// private endpoint should connect to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "groupId")] + public string GroupId {get; set; } + + /// + /// Gets or sets the member name of a group obtained from the remote resource + /// that this private endpoint should connect to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "memberName")] + public string MemberName {get; set; } + + /// + /// Gets or sets a private ip address obtained from the private endpoint's + /// subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointProperties.cs new file mode 100644 index 000000000000..f91fae25417b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateEndpointProperties.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the private endpoint. + /// + public partial class PrivateEndpointProperties + { + /// + /// Initializes a new instance of the PrivateEndpointProperties class. + /// + public PrivateEndpointProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointProperties class. + /// + + /// The ID of the subnet from which the private IP will be allocated. + /// + + /// An array of references to the network interfaces created for this private + /// endpoint. + /// + + /// The provisioning state of the private endpoint resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A grouping of information about the connection to the remote resource. + /// + + /// A grouping of information about the connection to the remote resource. Used + /// when the network admin does not have access to approve connections to the + /// remote resource. + /// + + /// An array of custom dns configurations. + /// + + /// Application security groups in which the private endpoint IP configuration + /// is included. + /// + + /// A list of IP configurations of the private endpoint. This will be used to + /// map to the First Party Service's endpoints. + /// + + /// The custom name of the network interface attached to the private endpoint. + /// + public PrivateEndpointProperties(Subnet subnet = default(Subnet), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), string provisioningState = default(string), System.Collections.Generic.IList privateLinkServiceConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList manualPrivateLinkServiceConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList customDnsConfigs = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string customNetworkInterfaceName = default(string)) + + { + this.Subnet = subnet; + this.NetworkInterfaces = networkInterfaces; + this.ProvisioningState = provisioningState; + this.PrivateLinkServiceConnections = privateLinkServiceConnections; + this.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; + this.CustomDnsConfigs = customDnsConfigs; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.IPConfigurations = ipConfigurations; + this.CustomNetworkInterfaceName = customNetworkInterfaceName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the ID of the subnet from which the private IP will be + /// allocated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets an array of references to the network interfaces created for this + /// private endpoint. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; private set; } + + /// + /// Gets the provisioning state of the private endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets a grouping of information about the connection to the remote + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceConnections")] + public System.Collections.Generic.IList PrivateLinkServiceConnections {get; set; } + + /// + /// Gets or sets a grouping of information about the connection to the remote + /// resource. Used when the network admin does not have access to approve + /// connections to the remote resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "manualPrivateLinkServiceConnections")] + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections {get; set; } + + /// + /// Gets or sets an array of custom dns configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customDnsConfigs")] + public System.Collections.Generic.IList CustomDnsConfigs {get; set; } + + /// + /// Gets or sets application security groups in which the private endpoint IP + /// configuration is included. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } + + /// + /// Gets or sets a list of IP configurations of the private endpoint. This will + /// be used to map to the First Party Service's endpoints. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets or sets the custom name of the network interface attached to the + /// private endpoint. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customNetworkInterfaceName")] + public string CustomNetworkInterfaceName {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkService.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkService.cs index 2929365f8956..86c5e18f3e6c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkService.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkService.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Private link service resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateLinkService : Resource { /// @@ -34,49 +24,74 @@ public PrivateLinkService() /// /// Initializes a new instance of the PrivateLinkService class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the load - /// balancer. - /// An array of - /// references to the load balancer IP configurations. - /// An array of private link service IP - /// configurations. - /// An array of references to the - /// network interfaces created for this private link service. - /// The provisioning state of the - /// private link service resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// An array of list about - /// connections to the private endpoint. - /// The visibility list of the private link - /// service. - /// The auto-approval list of the private - /// link service. - /// The list of Fqdn. - /// The alias of the private link service. - /// Whether the private link service - /// is enabled for proxy protocol or not. - /// A unique read-only string that changes whenever - /// the resource is updated. - public PrivateLinkService(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), IList loadBalancerFrontendIpConfigurations = default(IList), IList ipConfigurations = default(IList), IList networkInterfaces = default(IList), string provisioningState = default(string), IList privateEndpointConnections = default(IList), PrivateLinkServicePropertiesVisibility visibility = default(PrivateLinkServicePropertiesVisibility), PrivateLinkServicePropertiesAutoApproval autoApproval = default(PrivateLinkServicePropertiesAutoApproval), IList fqdns = default(IList), string alias = default(string), bool? enableProxyProtocol = default(bool?), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the load balancer. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the private link service resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// An array of references to the load balancer IP configurations. + /// + + /// An array of private link service IP configurations. + /// + + /// An array of references to the network interfaces created for this private + /// link service. + /// + + /// An array of list about connections to the private endpoint. + /// + + /// The visibility list of the private link service. + /// + + /// The auto-approval list of the private link service. + /// + + /// The list of Fqdn. + /// + + /// The alias of the private link service. + /// + + /// Whether the private link service is enabled for proxy protocol or not. + /// + public PrivateLinkService(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList loadBalancerFrontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), PrivateLinkServicePropertiesVisibility visibility = default(PrivateLinkServicePropertiesVisibility), PrivateLinkServicePropertiesAutoApproval autoApproval = default(PrivateLinkServicePropertiesAutoApproval), System.Collections.Generic.IList fqdns = default(System.Collections.Generic.IList), string alias = default(string), bool? enableProxyProtocol = default(bool?)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - LoadBalancerFrontendIpConfigurations = loadBalancerFrontendIpConfigurations; - IpConfigurations = ipConfigurations; - NetworkInterfaces = networkInterfaces; - ProvisioningState = provisioningState; - PrivateEndpointConnections = privateEndpointConnections; - Visibility = visibility; - AutoApproval = autoApproval; - Fqdns = fqdns; - Alias = alias; - EnableProxyProtocol = enableProxyProtocol; - Etag = etag; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.LoadBalancerFrontendIPConfigurations = loadBalancerFrontendIPConfigurations; + this.IPConfigurations = ipConfigurations; + this.NetworkInterfaces = networkInterfaces; + this.PrivateEndpointConnections = privateEndpointConnections; + this.Visibility = visibility; + this.AutoApproval = autoApproval; + this.Fqdns = fqdns; + this.Alias = alias; + this.EnableProxyProtocol = enableProxyProtocol; CustomInit(); } @@ -85,83 +100,80 @@ public PrivateLinkService() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the load balancer. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets an array of references to the load balancer IP - /// configurations. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.loadBalancerFrontendIpConfigurations")] - public IList LoadBalancerFrontendIpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets an array of private link service IP configurations. + /// Gets the provisioning state of the private link service resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets an array of references to the load balancer IP configurations. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerFrontendIpConfigurations")] + public System.Collections.Generic.IList LoadBalancerFrontendIPConfigurations {get; set; } /// - /// Gets an array of references to the network interfaces created for - /// this private link service. + /// Gets or sets an array of private link service IP configurations. /// - [JsonProperty(PropertyName = "properties.networkInterfaces")] - public IList NetworkInterfaces { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// - /// Gets the provisioning state of the private link service resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets an array of references to the network interfaces created for this + /// private link service. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; private set; } /// /// Gets an array of list about connections to the private endpoint. /// - [JsonProperty(PropertyName = "properties.privateEndpointConnections")] - public IList PrivateEndpointConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } /// /// Gets or sets the visibility list of the private link service. /// - [JsonProperty(PropertyName = "properties.visibility")] - public PrivateLinkServicePropertiesVisibility Visibility { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.visibility")] + public PrivateLinkServicePropertiesVisibility Visibility {get; set; } /// /// Gets or sets the auto-approval list of the private link service. /// - [JsonProperty(PropertyName = "properties.autoApproval")] - public PrivateLinkServicePropertiesAutoApproval AutoApproval { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoApproval")] + public PrivateLinkServicePropertiesAutoApproval AutoApproval {get; set; } /// /// Gets or sets the list of Fqdn. /// - [JsonProperty(PropertyName = "properties.fqdns")] - public IList Fqdns { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdns")] + public System.Collections.Generic.IList Fqdns {get; set; } /// /// Gets the alias of the private link service. /// - [JsonProperty(PropertyName = "properties.alias")] - public string Alias { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.alias")] + public string Alias {get; private set; } /// - /// Gets or sets whether the private link service is enabled for proxy - /// protocol or not. + /// Gets or sets whether the private link service is enabled for proxy protocol + /// or not. /// - [JsonProperty(PropertyName = "properties.enableProxyProtocol")] - public bool? EnableProxyProtocol { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableProxyProtocol")] + public bool? EnableProxyProtocol {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnection.cs index 0419eda5fe07..341d4430c2f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// PrivateLinkServiceConnection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateLinkServiceConnection : SubResource { /// - /// Initializes a new instance of the PrivateLinkServiceConnection - /// class. + /// Initializes a new instance of the PrivateLinkServiceConnection class. /// public PrivateLinkServiceConnection() { @@ -33,41 +22,51 @@ public PrivateLinkServiceConnection() } /// - /// Initializes a new instance of the PrivateLinkServiceConnection - /// class. + /// Initializes a new instance of the PrivateLinkServiceConnection class. /// - /// Resource ID. - /// The provisioning state of the - /// private link service connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The resource id of private link - /// service. - /// The ID(s) of the group(s) obtained from the - /// remote resource that this private endpoint should connect - /// to. - /// A message passed to the owner of the - /// remote resource with this connection request. Restricted to 140 - /// chars. - /// A collection of - /// read-only information about the state of the connection to the - /// remote resource. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// The resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public PrivateLinkServiceConnection(string id = default(string), string provisioningState = default(string), string privateLinkServiceId = default(string), IList groupIds = default(IList), string requestMessage = default(string), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string name = default(string), string type = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// The resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the private link service connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The resource id of private link service. + /// + + /// The ID(s) of the group(s) obtained from the remote resource that this + /// private endpoint should connect to. + /// + + /// A message passed to the owner of the remote resource with this connection + /// request. Restricted to 140 chars. + /// + + /// A collection of read-only information about the state of the connection to + /// the remote resource. + /// + public PrivateLinkServiceConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string privateLinkServiceId = default(string), System.Collections.Generic.IList groupIds = default(System.Collections.Generic.IList), string requestMessage = default(string), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState)) + + : base(id) { - ProvisioningState = provisioningState; - PrivateLinkServiceId = privateLinkServiceId; - GroupIds = groupIds; - RequestMessage = requestMessage; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - Name = name; - Type = type; - Etag = etag; + this.Name = name; + this.Type = type; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.PrivateLinkServiceId = privateLinkServiceId; + this.GroupIds = groupIds; + this.RequestMessage = requestMessage; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; CustomInit(); } @@ -76,60 +75,59 @@ public PrivateLinkServiceConnection() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the private link service connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the resource id of private link service. + /// Gets the resource type. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceId")] - public string PrivateLinkServiceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the ID(s) of the group(s) obtained from the remote - /// resource that this private endpoint should connect to. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.groupIds")] - public IList GroupIds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets a message passed to the owner of the remote resource - /// with this connection request. Restricted to 140 chars. + /// Gets the provisioning state of the private link service connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.requestMessage")] - public string RequestMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets a collection of read-only information about the state - /// of the connection to the remote resource. + /// Gets or sets the resource id of private link service. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] - public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceId")] + public string PrivateLinkServiceId {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the ID(s) of the group(s) obtained from the remote resource + /// that this private endpoint should connect to. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.groupIds")] + public System.Collections.Generic.IList GroupIds {get; set; } /// - /// Gets the resource type. + /// Gets or sets a message passed to the owner of the remote resource with this + /// connection request. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestMessage")] + public string RequestMessage {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets a collection of read-only information about the state of the + /// connection to the remote resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionProperties.cs new file mode 100644 index 000000000000..aa3c6020b756 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionProperties.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the PrivateLinkServiceConnection. + /// + public partial class PrivateLinkServiceConnectionProperties + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionProperties class. + /// + public PrivateLinkServiceConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionProperties class. + /// + + /// The provisioning state of the private link service connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The resource id of private link service. + /// + + /// The ID(s) of the group(s) obtained from the remote resource that this + /// private endpoint should connect to. + /// + + /// A message passed to the owner of the remote resource with this connection + /// request. Restricted to 140 chars. + /// + + /// A collection of read-only information about the state of the connection to + /// the remote resource. + /// + public PrivateLinkServiceConnectionProperties(string provisioningState = default(string), string privateLinkServiceId = default(string), System.Collections.Generic.IList groupIds = default(System.Collections.Generic.IList), string requestMessage = default(string), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState)) + + { + this.ProvisioningState = provisioningState; + this.PrivateLinkServiceId = privateLinkServiceId; + this.GroupIds = groupIds; + this.RequestMessage = requestMessage; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the private link service connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the resource id of private link service. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceId")] + public string PrivateLinkServiceId {get; set; } + + /// + /// Gets or sets the ID(s) of the group(s) obtained from the remote resource + /// that this private endpoint should connect to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "groupIds")] + public System.Collections.Generic.IList GroupIds {get; set; } + + /// + /// Gets or sets a message passed to the owner of the remote resource with this + /// connection request. Restricted to 140 chars. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestMessage")] + public string RequestMessage {get; set; } + + /// + /// Gets or sets a collection of read-only information about the state of the + /// connection to the remote resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs index ac7d390187ae..a9c487f9c20a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PrivateLinkServiceConnectionState { /// - /// Initializes a new instance of the PrivateLinkServiceConnectionState - /// class. + /// Initializes a new instance of the PrivateLinkServiceConnectionState class. /// public PrivateLinkServiceConnectionState() { @@ -29,20 +22,25 @@ public PrivateLinkServiceConnectionState() } /// - /// Initializes a new instance of the PrivateLinkServiceConnectionState - /// class. + /// Initializes a new instance of the PrivateLinkServiceConnectionState class. /// - /// Indicates whether the connection has been - /// Approved/Rejected/Removed by the owner of the service. - /// The reason for approval/rejection of the - /// connection. - /// A message indicating if changes on - /// the service provider require any updates on the consumer. + + /// Indicates whether the connection has been Approved/Rejected/Removed by the + /// owner of the service. + /// + + /// The reason for approval/rejection of the connection. + /// + + /// A message indicating if changes on the service provider require any updates + /// on the consumer. + /// public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) + { - Status = status; - Description = description; - ActionsRequired = actionsRequired; + this.Status = status; + this.Description = description; + this.ActionsRequired = actionsRequired; CustomInit(); } @@ -51,25 +49,25 @@ public PrivateLinkServiceConnectionState() /// partial void CustomInit(); + /// /// Gets or sets indicates whether the connection has been /// Approved/Rejected/Removed by the owner of the service. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the reason for approval/rejection of the connection. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets a message indicating if changes on the service - /// provider require any updates on the consumer. + /// Gets or sets a message indicating if changes on the service provider + /// require any updates on the consumer. /// - [JsonProperty(PropertyName = "actionsRequired")] - public string ActionsRequired { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfiguration.cs index e310d4a7132b..a896b3afa668 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The private link service ip configuration. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateLinkServiceIpConfiguration : SubResource { /// - /// Initializes a new instance of the PrivateLinkServiceIpConfiguration - /// class. + /// Initializes a new instance of the PrivateLinkServiceIpConfiguration class. /// public PrivateLinkServiceIpConfiguration() { @@ -31,41 +22,52 @@ public PrivateLinkServiceIpConfiguration() } /// - /// Initializes a new instance of the PrivateLinkServiceIpConfiguration - /// class. + /// Initializes a new instance of the PrivateLinkServiceIpConfiguration class. /// - /// Resource ID. - /// The private IP address of the IP - /// configuration. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// The reference to the subnet resource. - /// Whether the ip configuration is primary or - /// not. - /// The provisioning state of the - /// private link service IP configuration resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Whether the specific IP - /// configuration is IPv4 or IPv6. Default is IPv4. Possible values - /// include: 'IPv4', 'IPv6' - /// The name of private link service ip - /// configuration. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The resource type. - public PrivateLinkServiceIpConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), string provisioningState = default(string), string privateIPAddressVersion = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of private link service ip configuration. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The resource type. + /// + + /// The reference to the subnet resource. + /// + + /// The provisioning state of the private link service IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// Whether the ip configuration is primary or not. + /// + + /// Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + /// Possible values include: 'IPv4', 'IPv6' + public PrivateLinkServiceIpConfiguration(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), Subnet subnet = default(Subnet), string provisioningState = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), bool? primary = default(bool?), string privateIPAddressVersion = default(string)) + + : base(id) { - PrivateIPAddress = privateIPAddress; - PrivateIPAllocationMethod = privateIPAllocationMethod; - Subnet = subnet; - Primary = primary; - ProvisioningState = provisioningState; - PrivateIPAddressVersion = privateIPAddressVersion; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.Subnet = subnet; + this.ProvisioningState = provisioningState; + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Primary = primary; + this.PrivateIPAddressVersion = privateIPAddressVersion; CustomInit(); } @@ -74,64 +76,62 @@ public PrivateLinkServiceIpConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the private IP address of the IP configuration. + /// Gets or sets the name of private link service ip configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the subnet resource. + /// Gets the resource type. /// - [JsonProperty(PropertyName = "properties.subnet")] - public Subnet Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets whether the ip configuration is primary or not. + /// Gets or sets the reference to the subnet resource. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public Subnet Subnet {get; set; } /// - /// Gets the provisioning state of the private link service IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the private link service IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. - /// Default is IPv4. Possible values include: 'IPv4', 'IPv6' + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] - public string PrivateIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; set; } /// - /// Gets or sets the name of private link service ip configuration. + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets whether the ip configuration is primary or not. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// - /// Gets the resource type. + /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. Default + /// is IPv4. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfigurationProperties.cs new file mode 100644 index 000000000000..6c0095a5953f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceIpConfigurationProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of private link service IP configuration. + /// + public partial class PrivateLinkServiceIpConfigurationProperties + { + /// + /// Initializes a new instance of the PrivateLinkServiceIpConfigurationProperties class. + /// + public PrivateLinkServiceIpConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceIpConfigurationProperties class. + /// + + /// The private IP address of the IP configuration. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the subnet resource. + /// + + /// Whether the ip configuration is primary or not. + /// + + /// The provisioning state of the private link service IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + /// Possible values include: 'IPv4', 'IPv6' + public PrivateLinkServiceIpConfigurationProperties(string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), string provisioningState = default(string), string privateIPAddressVersion = default(string)) + + { + this.PrivateIPAddress = privateIPAddress; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.Primary = primary; + this.ProvisioningState = provisioningState; + this.PrivateIPAddressVersion = privateIPAddressVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the private IP address of the IP configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; set; } + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets the reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public Subnet Subnet {get; set; } + + /// + /// Gets or sets whether the ip configuration is primary or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets the provisioning state of the private link service IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. Default + /// is IPv4. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceProperties.cs new file mode 100644 index 000000000000..a64fc6cdb60c --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceProperties.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the private link service. + /// + public partial class PrivateLinkServiceProperties + { + /// + /// Initializes a new instance of the PrivateLinkServiceProperties class. + /// + public PrivateLinkServiceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceProperties class. + /// + + /// An array of references to the load balancer IP configurations. + /// + + /// An array of private link service IP configurations. + /// + + /// An array of references to the network interfaces created for this private + /// link service. + /// + + /// The provisioning state of the private link service resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// An array of list about connections to the private endpoint. + /// + + /// The visibility list of the private link service. + /// + + /// The auto-approval list of the private link service. + /// + + /// The list of Fqdn. + /// + + /// The alias of the private link service. + /// + + /// Whether the private link service is enabled for proxy protocol or not. + /// + public PrivateLinkServiceProperties(System.Collections.Generic.IList loadBalancerFrontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), string provisioningState = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), PrivateLinkServicePropertiesVisibility visibility = default(PrivateLinkServicePropertiesVisibility), PrivateLinkServicePropertiesAutoApproval autoApproval = default(PrivateLinkServicePropertiesAutoApproval), System.Collections.Generic.IList fqdns = default(System.Collections.Generic.IList), string alias = default(string), bool? enableProxyProtocol = default(bool?)) + + { + this.LoadBalancerFrontendIPConfigurations = loadBalancerFrontendIPConfigurations; + this.IPConfigurations = ipConfigurations; + this.NetworkInterfaces = networkInterfaces; + this.ProvisioningState = provisioningState; + this.PrivateEndpointConnections = privateEndpointConnections; + this.Visibility = visibility; + this.AutoApproval = autoApproval; + this.Fqdns = fqdns; + this.Alias = alias; + this.EnableProxyProtocol = enableProxyProtocol; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets an array of references to the load balancer IP configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerFrontendIpConfigurations")] + public System.Collections.Generic.IList LoadBalancerFrontendIPConfigurations {get; set; } + + /// + /// Gets or sets an array of private link service IP configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets an array of references to the network interfaces created for this + /// private link service. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; private set; } + + /// + /// Gets the provisioning state of the private link service resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets an array of list about connections to the private endpoint. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } + + /// + /// Gets or sets the visibility list of the private link service. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "visibility")] + public PrivateLinkServicePropertiesVisibility Visibility {get; set; } + + /// + /// Gets or sets the auto-approval list of the private link service. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoApproval")] + public PrivateLinkServicePropertiesAutoApproval AutoApproval {get; set; } + + /// + /// Gets or sets the list of Fqdn. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdns")] + public System.Collections.Generic.IList Fqdns {get; set; } + + /// + /// Gets the alias of the private link service. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "alias")] + public string Alias {get; private set; } + + /// + /// Gets or sets whether the private link service is enabled for proxy protocol + /// or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableProxyProtocol")] + public bool? EnableProxyProtocol {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesAutoApproval.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesAutoApproval.cs index dee94f4e20f4..3ccf1ead85f4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesAutoApproval.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesAutoApproval.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PrivateLinkServicePropertiesAutoApproval : ResourceSet { /// - /// Initializes a new instance of the - /// PrivateLinkServicePropertiesAutoApproval class. + /// Initializes a new instance of the PrivateLinkServicePropertiesAutoApproval class. /// public PrivateLinkServicePropertiesAutoApproval() { @@ -29,12 +21,14 @@ public PrivateLinkServicePropertiesAutoApproval() } /// - /// Initializes a new instance of the - /// PrivateLinkServicePropertiesAutoApproval class. + /// Initializes a new instance of the PrivateLinkServicePropertiesAutoApproval class. /// - /// The list of subscriptions. - public PrivateLinkServicePropertiesAutoApproval(IList subscriptions = default(IList)) - : base(subscriptions) + + /// The list of subscriptions. + /// + public PrivateLinkServicePropertiesAutoApproval(System.Collections.Generic.IList subscriptions = default(System.Collections.Generic.IList)) + + : base(subscriptions) { CustomInit(); } @@ -45,4 +39,4 @@ public PrivateLinkServicePropertiesAutoApproval() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesVisibility.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesVisibility.cs index 4859766d0b7b..308308b4025d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesVisibility.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServicePropertiesVisibility.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PrivateLinkServicePropertiesVisibility : ResourceSet { /// - /// Initializes a new instance of the - /// PrivateLinkServicePropertiesVisibility class. + /// Initializes a new instance of the PrivateLinkServicePropertiesVisibility class. /// public PrivateLinkServicePropertiesVisibility() { @@ -29,12 +21,14 @@ public PrivateLinkServicePropertiesVisibility() } /// - /// Initializes a new instance of the - /// PrivateLinkServicePropertiesVisibility class. + /// Initializes a new instance of the PrivateLinkServicePropertiesVisibility class. /// - /// The list of subscriptions. - public PrivateLinkServicePropertiesVisibility(IList subscriptions = default(IList)) - : base(subscriptions) + + /// The list of subscriptions. + /// + public PrivateLinkServicePropertiesVisibility(System.Collections.Generic.IList subscriptions = default(System.Collections.Generic.IList)) + + : base(subscriptions) { CustomInit(); } @@ -45,4 +39,4 @@ public PrivateLinkServicePropertiesVisibility() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceVisibility.cs b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceVisibility.cs index d0f0d8cd2b76..87f112e2fee7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceVisibility.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PrivateLinkServiceVisibility.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class PrivateLinkServiceVisibility { /// - /// Initializes a new instance of the PrivateLinkServiceVisibility - /// class. + /// Initializes a new instance of the PrivateLinkServiceVisibility class. /// public PrivateLinkServiceVisibility() { @@ -28,14 +21,15 @@ public PrivateLinkServiceVisibility() } /// - /// Initializes a new instance of the PrivateLinkServiceVisibility - /// class. + /// Initializes a new instance of the PrivateLinkServiceVisibility class. /// - /// Private Link Service Visibility - /// (True/False). + + /// Private Link Service Visibility (True/False). + /// public PrivateLinkServiceVisibility(bool? visible = default(bool?)) + { - Visible = visible; + this.Visible = visible; CustomInit(); } @@ -44,11 +38,11 @@ public PrivateLinkServiceVisibility() /// partial void CustomInit(); + /// /// Gets or sets private Link Service Visibility (True/False). /// - [JsonProperty(PropertyName = "visible")] - public bool? Visible { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "visible")] + public bool? Visible {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Probe.cs b/src/Network/Network.Management.Sdk/Generated/Models/Probe.cs index a1c1d1f7a1f5..fb6a45d10567 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Probe.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Probe.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A load balancer probe. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Probe : SubResource { /// @@ -34,59 +24,75 @@ public Probe() /// /// Initializes a new instance of the Probe class. /// - /// The protocol of the end point. 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' - /// The port for communicating the probe. Possible - /// values range from 1 to 65535, inclusive. - /// Resource ID. - /// The load balancer rules that use - /// this probe. - /// 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. - /// 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. - /// The number of consecutive successful - /// or failed probes in order to allow or deny traffic from being - /// delivered to this endpoint. After failing the number of consecutive - /// probes equal to this value, the endpoint will be taken out of - /// rotation and require the same number of successful consecutive - /// probes to be placed back in rotation. - /// 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. - /// The provisioning state of the probe - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The name of the resource that is unique within - /// the set of probes used by the load balancer. This name can be used - /// to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Type of the resource. - public Probe(string protocol, int port, string id = default(string), IList loadBalancingRules = default(IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), int? probeThreshold = default(int?), string requestPath = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within the set of probes used by + /// the load balancer. This name can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Type of the resource. + /// + + /// The provisioning state of the probe resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The load balancer rules that use this probe. + /// + + /// The protocol of the end point. 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' + + /// The port for communicating the probe. Possible values range from 1 to + /// 65535, inclusive. + /// + + /// 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. + /// + + /// 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. + /// + + /// The number of consecutive successful or failed probes in order to allow or + /// deny traffic from being delivered to this endpoint. After failing the + /// number of consecutive probes equal to this value, the endpoint will be + /// taken out of rotation and require the same number of successful consecutive + /// probes to be placed back in rotation. + /// + + /// 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. + /// + public Probe(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), string protocol = default(string), int? port = default(int?), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), int? probeThreshold = default(int?), string requestPath = default(string)) + + : base(id) { - LoadBalancingRules = loadBalancingRules; - Protocol = protocol; - Port = port; - IntervalInSeconds = intervalInSeconds; - NumberOfProbes = numberOfProbes; - ProbeThreshold = probeThreshold; - RequestPath = requestPath; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.LoadBalancingRules = loadBalancingRules; + this.Protocol = protocol; + this.Port = port; + this.IntervalInSeconds = intervalInSeconds; + this.NumberOfProbes = numberOfProbes; + this.ProbeThreshold = probeThreshold; + this.RequestPath = requestPath; CustomInit(); } @@ -95,107 +101,91 @@ public Probe() /// partial void CustomInit(); - /// - /// Gets the load balancer rules that use this probe. - /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } /// - /// Gets or sets the protocol of the end point. 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' + /// Gets or sets the name of the resource that is unique within the set of + /// probes used by the load balancer. This name can be used to access the + /// resource. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the port for communicating the probe. Possible values - /// range from 1 to 65535, inclusive. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.port")] - public int Port { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets 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. + /// Gets type of the resource. /// - [JsonProperty(PropertyName = "properties.intervalInSeconds")] - public int? IntervalInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets 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. + /// Gets the provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.numberOfProbes")] - public int? NumberOfProbes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the number of consecutive successful or failed probes - /// in order to allow or deny traffic from being delivered to this - /// endpoint. After failing the number of consecutive probes equal to - /// this value, the endpoint will be taken out of rotation and require - /// the same number of successful consecutive probes to be placed back - /// in rotation. + /// Gets the load balancer rules that use this probe. /// - [JsonProperty(PropertyName = "properties.probeThreshold")] - public int? ProbeThreshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; private set; } /// - /// Gets or sets 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. + /// Gets or sets the protocol of the end point. 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' /// - [JsonProperty(PropertyName = "properties.requestPath")] - public string RequestPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets the provisioning state of the probe resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the port for communicating the probe. Possible values range + /// from 1 to 65535, inclusive. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + public int? Port {get; set; } /// - /// Gets or sets the name of the resource that is unique within the set - /// of probes used by the load balancer. This name can be used to - /// access the resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.intervalInSeconds")] + public int? IntervalInSeconds {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.numberOfProbes")] + public int? NumberOfProbes {get; set; } /// - /// Gets type of the resource. + /// Gets or sets the number of consecutive successful or failed probes in order + /// to allow or deny traffic from being delivered to this endpoint. After + /// failing the number of consecutive probes equal to this value, the endpoint + /// will be taken out of rotation and require the same number of successful + /// consecutive probes to be placed back in rotation. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probeThreshold")] + public int? ProbeThreshold {get; set; } /// - /// Validate the object. + /// Gets or sets 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. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestPath")] + public string RequestPath {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ProbePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ProbePropertiesFormat.cs new file mode 100644 index 000000000000..6e62aa271270 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ProbePropertiesFormat.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Load balancer probe resource. + /// + public partial class ProbePropertiesFormat + { + /// + /// Initializes a new instance of the ProbePropertiesFormat class. + /// + public ProbePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProbePropertiesFormat class. + /// + + /// The load balancer rules that use this probe. + /// + + /// The protocol of the end point. 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' + + /// The port for communicating the probe. Possible values range from 1 to + /// 65535, inclusive. + /// + + /// 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. + /// + + /// 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. + /// + + /// The number of consecutive successful or failed probes in order to allow or + /// deny traffic from being delivered to this endpoint. After failing the + /// number of consecutive probes equal to this value, the endpoint will be + /// taken out of rotation and require the same number of successful consecutive + /// probes to be placed back in rotation. + /// + + /// 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. + /// + + /// The provisioning state of the probe resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ProbePropertiesFormat(string protocol, int port, System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), int? probeThreshold = default(int?), string requestPath = default(string), string provisioningState = default(string)) + + { + this.LoadBalancingRules = loadBalancingRules; + this.Protocol = protocol; + this.Port = port; + this.IntervalInSeconds = intervalInSeconds; + this.NumberOfProbes = numberOfProbes; + this.ProbeThreshold = probeThreshold; + this.RequestPath = requestPath; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the load balancer rules that use this probe. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules {get; private set; } + + /// + /// Gets or sets the protocol of the end point. 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' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets the port for communicating the probe. Possible values range + /// from 1 to 65535, inclusive. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "port")] + public int Port {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "intervalInSeconds")] + public int? IntervalInSeconds {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "numberOfProbes")] + public int? NumberOfProbes {get; set; } + + /// + /// Gets or sets the number of consecutive successful or failed probes in order + /// to allow or deny traffic from being delivered to this endpoint. After + /// failing the number of consecutive probes equal to this value, the endpoint + /// will be taken out of rotation and require the same number of successful + /// consecutive probes to be placed back in rotation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "probeThreshold")] + public int? ProbeThreshold {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requestPath")] + public string RequestPath {get; set; } + + /// + /// Gets the provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Protocol == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ProbeProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/ProbeProtocol.cs index 44127f4c7f9b..2682413ebcbb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ProbeProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ProbeProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ProbeProtocol. /// + + public static class ProbeProtocol { public const string Http = "Http"; public const string Tcp = "Tcp"; public const string Https = "Https"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ProcessorArchitecture.cs b/src/Network/Network.Management.Sdk/Generated/Models/ProcessorArchitecture.cs index ab3a5452e37e..ae57cf768677 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ProcessorArchitecture.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ProcessorArchitecture.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ProcessorArchitecture. /// + + public static class ProcessorArchitecture { public const string Amd64 = "Amd64"; public const string X86 = "X86"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PropagatedRouteTable.cs b/src/Network/Network.Management.Sdk/Generated/Models/PropagatedRouteTable.cs index c880fa8b60ed..211196749b9f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PropagatedRouteTable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PropagatedRouteTable.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public PropagatedRouteTable() /// /// Initializes a new instance of the PropagatedRouteTable class. /// - /// The list of labels. - /// The list of resource ids of all the - /// RouteTables. - public PropagatedRouteTable(IList labels = default(IList), IList ids = default(IList)) + + /// The list of labels. + /// + + /// The list of resource ids of all the RouteTables. + /// + public PropagatedRouteTable(System.Collections.Generic.IList labels = default(System.Collections.Generic.IList), System.Collections.Generic.IList ids = default(System.Collections.Generic.IList)) + { - Labels = labels; - Ids = ids; + this.Labels = labels; + this.Ids = ids; CustomInit(); } @@ -46,17 +42,17 @@ public PropagatedRouteTable() /// partial void CustomInit(); + /// /// Gets or sets the list of labels. /// - [JsonProperty(PropertyName = "labels")] - public IList Labels { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "labels")] + public System.Collections.Generic.IList Labels {get; set; } /// /// Gets or sets the list of resource ids of all the RouteTables. /// - [JsonProperty(PropertyName = "ids")] - public IList Ids { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ids")] + public System.Collections.Generic.IList Ids {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Protocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/Protocol.cs index d13b5a3bfb13..71e5c833a19c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Protocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Protocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for Protocol. /// + + public static class Protocol { public const string Tcp = "Tcp"; @@ -21,4 +18,4 @@ public static class Protocol public const string Https = "Https"; public const string Icmp = "Icmp"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ProtocolConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/ProtocolConfiguration.cs index 1f5094bc14a4..94cee9b04a4e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ProtocolConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ProtocolConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public ProtocolConfiguration() /// /// Initializes a new instance of the ProtocolConfiguration class. /// - /// HTTP configuration of the - /// connectivity check. - public ProtocolConfiguration(HTTPConfiguration hTTPConfiguration = default(HTTPConfiguration)) + + /// HTTP configuration of the connectivity check. + /// + public ProtocolConfiguration(HttpConfiguration httpConfiguration = default(HttpConfiguration)) + { - HTTPConfiguration = hTTPConfiguration; + this.HttpConfiguration = httpConfiguration; CustomInit(); } @@ -42,11 +38,11 @@ public ProtocolConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets HTTP configuration of the connectivity check. + /// Gets or sets hTTP configuration of the connectivity check. /// - [JsonProperty(PropertyName = "HTTPConfiguration")] - public HTTPConfiguration HTTPConfiguration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "HTTPConfiguration")] + public HttpConfiguration HttpConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ProtocolType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ProtocolType.cs index 59f0b26f29d9..224d3bc19ecd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ProtocolType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ProtocolType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ProtocolType. /// + + public static class ProtocolType { public const string DoNotUse = "DoNotUse"; @@ -26,4 +23,4 @@ public static class ProtocolType public const string Vxlan = "Vxlan"; public const string All = "All"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ProvisioningState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ProvisioningState.cs index 3b6c9216ff02..094bdb422e2f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ProvisioningState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ProvisioningState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ProvisioningState. /// + + public static class ProvisioningState { public const string Succeeded = "Succeeded"; @@ -21,4 +18,4 @@ public static class ProvisioningState public const string Deleting = "Deleting"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddress.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddress.cs index e3988bc735bb..875ecf3bda4c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddress.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddress.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Public IP address resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PublicIPAddress : Resource { /// @@ -34,77 +24,107 @@ public PublicIPAddress() /// /// Initializes a new instance of the PublicIPAddress class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the public - /// ip address. - /// The public IP address SKU. - /// The public IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the public ip address. + /// + + /// The public IP address SKU. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// A list of availability zones denoting the IP allocated for the resource + /// needs to come from. + /// + + /// The IP configuration associated with the public IP address. + /// + + /// The DDoS protection custom policy associated with the public IP address. + /// + + /// The provisioning state of the public IP address resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The NatGateway for the Public IP address. + /// + + /// The public IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + /// The public IP address version. - /// Possible values include: 'IPv4', 'IPv6' - /// The IP configuration associated with - /// the public IP address. - /// The FQDN of the DNS record associated - /// with the public IP address. - /// The DDoS protection custom policy - /// associated with the public IP address. - /// The list of tags associated with the public IP - /// address. - /// The IP address associated with the public - /// IP address resource. - /// The Public IP Prefix this Public IP - /// Address should be allocated from. - /// The idle timeout of the public - /// IP address. - /// The resource GUID property of the public - /// IP address resource. - /// The provisioning state of the - /// public IP address resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The service public IP address - /// of the public IP address resource. - /// The NatGateway for the Public IP - /// address. + /// Possible values include: 'IPv4', 'IPv6' + + /// The FQDN of the DNS record associated with the public IP address. + /// + + /// The list of tags associated with the public IP address. + /// + + /// The IP address associated with the public IP address resource. + /// + + /// The Public IP Prefix this Public IP Address should be allocated from. + /// + + /// The idle timeout of the public IP address. + /// + + /// The resource GUID property of the public IP address resource. + /// + + /// The service public IP address of the public IP address resource. + /// + /// Migration phase of Public IP Address. - /// Possible values include: 'None', 'Prepare', 'Commit', 'Abort', - /// 'Committed' - /// The linked public IP address of - /// the public IP address resource. - /// Specify what happens to the public IP - /// address when the VM using it is deleted. Possible values include: - /// 'Delete', 'Detach' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A list of availability zones denoting the IP - /// allocated for the resource needs to come from. - public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PublicIPAddressSku sku = default(PublicIPAddressSku), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), DdosSettings ddosSettings = default(DdosSettings), IList ipTags = default(IList), string ipAddress = default(string), SubResource publicIPPrefix = default(SubResource), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), PublicIPAddress servicePublicIPAddress = default(PublicIPAddress), NatGateway natGateway = default(NatGateway), string migrationPhase = default(string), PublicIPAddress linkedPublicIPAddress = default(PublicIPAddress), string deleteOption = default(string), string etag = default(string), IList zones = default(IList)) - : base(id, name, type, location, tags) + /// Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + + /// The linked public IP address of the public IP address resource. + /// + + /// Specify what happens to the public IP address when the VM using it is + /// deleted + /// Possible values include: 'Delete', 'Detach' + public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PublicIPAddressSku sku = default(PublicIPAddressSku), string etag = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), IPConfiguration ipConfiguration = default(IPConfiguration), DdosSettings ddosSettings = default(DdosSettings), string provisioningState = default(string), NatGateway natGateway = default(NatGateway), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), string ipAddress = default(string), SubResource publicIPPrefix = default(SubResource), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), PublicIPAddress servicePublicIPAddress = default(PublicIPAddress), string migrationPhase = default(string), PublicIPAddress linkedPublicIPAddress = default(PublicIPAddress), string deleteOption = default(string)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - Sku = sku; - PublicIPAllocationMethod = publicIPAllocationMethod; - PublicIPAddressVersion = publicIPAddressVersion; - IpConfiguration = ipConfiguration; - DnsSettings = dnsSettings; - DdosSettings = ddosSettings; - IpTags = ipTags; - IpAddress = ipAddress; - PublicIPPrefix = publicIPPrefix; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - ServicePublicIPAddress = servicePublicIPAddress; - NatGateway = natGateway; - MigrationPhase = migrationPhase; - LinkedPublicIPAddress = linkedPublicIPAddress; - DeleteOption = deleteOption; - Etag = etag; - Zones = zones; + this.ExtendedLocation = extendedLocation; + this.Sku = sku; + this.Etag = etag; + this.Zones = zones; + this.IPConfiguration = ipConfiguration; + this.DdosSettings = ddosSettings; + this.ProvisioningState = provisioningState; + this.NatGateway = natGateway; + this.PublicIPAllocationMethod = publicIPAllocationMethod; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.DnsSettings = dnsSettings; + this.IPTags = ipTags; + this.IPAddress = ipAddress; + this.PublicIPPrefix = publicIPPrefix; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.ResourceGuid = resourceGuid; + this.ServicePublicIPAddress = servicePublicIPAddress; + this.MigrationPhase = migrationPhase; + this.LinkedPublicIPAddress = linkedPublicIPAddress; + this.DeleteOption = deleteOption; CustomInit(); } @@ -113,140 +133,133 @@ public PublicIPAddress() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the public ip address. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// /// Gets or sets the public IP address SKU. /// - [JsonProperty(PropertyName = "sku")] - public PublicIPAddressSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public PublicIPAddressSku Sku {get; set; } /// - /// Gets or sets the public IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] - public string PublicIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the public IP address version. Possible values - /// include: 'IPv4', 'IPv6' + /// Gets or sets a list of availability zones denoting the IP allocated for the + /// resource needs to come from. /// - [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] - public string PublicIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// /// Gets the IP configuration associated with the public IP address. /// - [JsonProperty(PropertyName = "properties.ipConfiguration")] - public IPConfiguration IpConfiguration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfiguration")] + public IPConfiguration IPConfiguration {get; private set; } /// - /// Gets or sets the FQDN of the DNS record associated with the public + /// Gets or sets the DDoS protection custom policy associated with the public /// IP address. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public PublicIPAddressDnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ddosSettings")] + public DdosSettings DdosSettings {get; set; } /// - /// Gets or sets the DDoS protection custom policy associated with the - /// public IP address. + /// Gets the provisioning state of the public IP address resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.ddosSettings")] - public DdosSettings DdosSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the list of tags associated with the public IP - /// address. + /// Gets or sets the NatGateway for the Public IP address. /// - [JsonProperty(PropertyName = "properties.ipTags")] - public IList IpTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.natGateway")] + public NatGateway NatGateway {get; set; } /// - /// Gets or sets the IP address associated with the public IP address - /// resource. + /// Gets or sets the public IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.ipAddress")] - public string IpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] + public string PublicIPAllocationMethod {get; set; } /// - /// Gets or sets the Public IP Prefix this Public IP Address should be - /// allocated from. + /// Gets or sets the public IP address version. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.publicIPPrefix")] - public SubResource PublicIPPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } /// - /// Gets or sets the idle timeout of the public IP address. + /// Gets or sets the FQDN of the DNS record associated with the public IP + /// address. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public PublicIPAddressDnsSettings DnsSettings {get; set; } /// - /// Gets the resource GUID property of the public IP address resource. + /// Gets or sets the list of tags associated with the public IP address. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipTags")] + public System.Collections.Generic.IList IPTags {get; set; } /// - /// Gets the provisioning state of the public IP address resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets the IP address associated with the public IP address resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] + public string IPAddress {get; set; } /// - /// Gets or sets the service public IP address of the public IP address - /// resource. + /// Gets or sets the Public IP Prefix this Public IP Address should be + /// allocated from. /// - [JsonProperty(PropertyName = "properties.servicePublicIPAddress")] - public PublicIPAddress ServicePublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } /// - /// Gets or sets the NatGateway for the Public IP address. + /// Gets or sets the idle timeout of the public IP address. /// - [JsonProperty(PropertyName = "properties.natGateway")] - public NatGateway NatGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets or sets migration phase of Public IP Address. Possible values - /// include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + /// Gets the resource GUID property of the public IP address resource. /// - [JsonProperty(PropertyName = "properties.migrationPhase")] - public string MigrationPhase { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets the linked public IP address of the public IP address + /// Gets or sets the service public IP address of the public IP address /// resource. /// - [JsonProperty(PropertyName = "properties.linkedPublicIPAddress")] - public PublicIPAddress LinkedPublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.servicePublicIPAddress")] + public PublicIPAddress ServicePublicIPAddress {get; set; } /// - /// Gets or sets specify what happens to the public IP address when the - /// VM using it is deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets migration phase of Public IP Address. Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.migrationPhase")] + public string MigrationPhase {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the linked public IP address of the public IP address + /// resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkedPublicIPAddress")] + public PublicIPAddress LinkedPublicIPAddress {get; set; } /// - /// Gets or sets a list of availability zones denoting the IP allocated - /// for the resource needs to come from. + /// Gets or sets specify what happens to the public IP address when the VM + /// using it is deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressDnsSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressDnsSettings.cs index 7e04861df54f..1f9cc26f146f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressDnsSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressDnsSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,32 +23,36 @@ public PublicIPAddressDnsSettings() /// /// Initializes a new instance of the PublicIPAddressDnsSettings class. /// - /// 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. - /// The domain name label scope. If - /// a domain name label and a domain name label scope are specified, an - /// A DNS record is created for the public IP in the Microsoft Azure - /// DNS system with a hashed value includes in FQDN. Possible values - /// include: 'TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', - /// 'NoReuse' - /// The 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. - /// 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. + + /// 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. + /// + + /// The domain name label scope. If a domain name label and a domain name label + /// scope are specified, an A DNS record is created for the public IP in the + /// Microsoft Azure DNS system with a hashed value includes in FQDN. + /// Possible values include: 'TenantReuse', 'SubscriptionReuse', + /// 'ResourceGroupReuse', 'NoReuse' + + /// The 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. + /// + + /// 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. + /// public PublicIPAddressDnsSettings(string domainNameLabel = default(string), PublicIpAddressDnsSettingsDomainNameLabelScope? domainNameLabelScope = default(PublicIpAddressDnsSettingsDomainNameLabelScope?), string fqdn = default(string), string reverseFqdn = default(string)) + { - DomainNameLabel = domainNameLabel; - DomainNameLabelScope = domainNameLabelScope; - Fqdn = fqdn; - ReverseFqdn = reverseFqdn; + this.DomainNameLabel = domainNameLabel; + this.DomainNameLabelScope = domainNameLabelScope; + this.Fqdn = fqdn; + this.ReverseFqdn = reverseFqdn; CustomInit(); } @@ -63,42 +61,41 @@ public PublicIPAddressDnsSettings() /// partial void CustomInit(); + /// - /// 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. + /// 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. /// - [JsonProperty(PropertyName = "domainNameLabel")] - public string DomainNameLabel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabel")] + public string DomainNameLabel {get; set; } /// - /// Gets or sets the domain name label scope. If a domain name label - /// and a domain name label scope are specified, an A DNS record is - /// created for the public IP in the Microsoft Azure DNS system with a - /// hashed value includes in FQDN. Possible values include: - /// 'TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse' + /// Gets or sets the domain name label scope. If a domain name label and a + /// domain name label scope are specified, an A DNS record is created for the + /// public IP in the Microsoft Azure DNS system with a hashed value includes in + /// FQDN. Possible values include: 'TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse' /// - [JsonProperty(PropertyName = "domainNameLabelScope")] - public PublicIpAddressDnsSettingsDomainNameLabelScope? DomainNameLabelScope { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabelScope")] + public PublicIpAddressDnsSettingsDomainNameLabelScope? DomainNameLabelScope {get; set; } /// - /// Gets or sets the 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. + /// Gets or sets the 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. /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } /// - /// 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. + /// 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. /// - [JsonProperty(PropertyName = "reverseFqdn")] - public string ReverseFqdn { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "reverseFqdn")] + public string ReverseFqdn {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressMigrationPhase.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressMigrationPhase.cs index 2f5004d60e14..dcb9861479d6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressMigrationPhase.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressMigrationPhase.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PublicIPAddressMigrationPhase. /// + + public static class PublicIPAddressMigrationPhase { public const string None = "None"; @@ -22,4 +19,4 @@ public static class PublicIPAddressMigrationPhase public const string Abort = "Abort"; public const string Committed = "Committed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressPropertiesFormat.cs new file mode 100644 index 000000000000..2e6de8b13062 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressPropertiesFormat.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Public IP address properties. + /// + public partial class PublicIPAddressPropertiesFormat + { + /// + /// Initializes a new instance of the PublicIPAddressPropertiesFormat class. + /// + public PublicIPAddressPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PublicIPAddressPropertiesFormat class. + /// + + /// The public IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The public IP address version. + /// Possible values include: 'IPv4', 'IPv6' + + /// The IP configuration associated with the public IP address. + /// + + /// The FQDN of the DNS record associated with the public IP address. + /// + + /// The DDoS protection custom policy associated with the public IP address. + /// + + /// The list of tags associated with the public IP address. + /// + + /// The IP address associated with the public IP address resource. + /// + + /// The Public IP Prefix this Public IP Address should be allocated from. + /// + + /// The idle timeout of the public IP address. + /// + + /// The resource GUID property of the public IP address resource. + /// + + /// The provisioning state of the public IP address resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The service public IP address of the public IP address resource. + /// + + /// The NatGateway for the Public IP address. + /// + + /// Migration phase of Public IP Address. + /// Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + + /// The linked public IP address of the public IP address resource. + /// + + /// Specify what happens to the public IP address when the VM using it is + /// deleted + /// Possible values include: 'Delete', 'Detach' + public PublicIPAddressPropertiesFormat(string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), DdosSettings ddosSettings = default(DdosSettings), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), string ipAddress = default(string), SubResource publicIPPrefix = default(SubResource), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), PublicIPAddress servicePublicIPAddress = default(PublicIPAddress), NatGateway natGateway = default(NatGateway), string migrationPhase = default(string), PublicIPAddress linkedPublicIPAddress = default(PublicIPAddress), string deleteOption = default(string)) + + { + this.PublicIPAllocationMethod = publicIPAllocationMethod; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.IPConfiguration = ipConfiguration; + this.DnsSettings = dnsSettings; + this.DdosSettings = ddosSettings; + this.IPTags = ipTags; + this.IPAddress = ipAddress; + this.PublicIPPrefix = publicIPPrefix; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.ServicePublicIPAddress = servicePublicIPAddress; + this.NatGateway = natGateway; + this.MigrationPhase = migrationPhase; + this.LinkedPublicIPAddress = linkedPublicIPAddress; + this.DeleteOption = deleteOption; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the public IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAllocationMethod")] + public string PublicIPAllocationMethod {get; set; } + + /// + /// Gets or sets the public IP address version. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } + + /// + /// Gets the IP configuration associated with the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfiguration")] + public IPConfiguration IPConfiguration {get; private set; } + + /// + /// Gets or sets the FQDN of the DNS record associated with the public IP + /// address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public PublicIPAddressDnsSettings DnsSettings {get; set; } + + /// + /// Gets or sets the DDoS protection custom policy associated with the public + /// IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ddosSettings")] + public DdosSettings DdosSettings {get; set; } + + /// + /// Gets or sets the list of tags associated with the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTags")] + public System.Collections.Generic.IList IPTags {get; set; } + + /// + /// Gets or sets the IP address associated with the public IP address resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } + + /// + /// Gets or sets the Public IP Prefix this Public IP Address should be + /// allocated from. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } + + /// + /// Gets or sets the idle timeout of the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets the resource GUID property of the public IP address resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the public IP address resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the service public IP address of the public IP address + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "servicePublicIPAddress")] + public PublicIPAddress ServicePublicIPAddress {get; set; } + + /// + /// Gets or sets the NatGateway for the Public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "natGateway")] + public NatGateway NatGateway {get; set; } + + /// + /// Gets or sets migration phase of Public IP Address. Possible values include: 'None', 'Prepare', 'Commit', 'Abort', 'Committed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "migrationPhase")] + public string MigrationPhase {get; set; } + + /// + /// Gets or sets the linked public IP address of the public IP address + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkedPublicIPAddress")] + public PublicIPAddress LinkedPublicIPAddress {get; set; } + + /// + /// Gets or sets specify what happens to the public IP address when the VM + /// using it is deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSku.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSku.cs index b08c74d5bfc5..a3908423fd30 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public PublicIPAddressSku() /// /// Initializes a new instance of the PublicIPAddressSku class. /// - /// Name of a public IP address SKU. Possible values - /// include: 'Basic', 'Standard' - /// Tier of a public IP address SKU. Possible values - /// include: 'Regional', 'Global' + + /// Name of a public IP address SKU. + /// Possible values include: 'Basic', 'Standard' + + /// Tier of a public IP address SKU. + /// Possible values include: 'Regional', 'Global' public PublicIPAddressSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -45,19 +42,17 @@ public PublicIPAddressSku() /// partial void CustomInit(); + /// - /// Gets or sets name of a public IP address SKU. Possible values - /// include: 'Basic', 'Standard' + /// Gets or sets name of a public IP address SKU. Possible values include: 'Basic', 'Standard' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets tier of a public IP address SKU. Possible values - /// include: 'Regional', 'Global' + /// Gets or sets tier of a public IP address SKU. Possible values include: 'Regional', 'Global' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs index d6200e4cf37e..d0a5e207e4df 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PublicIPAddressSkuName. /// + + public static class PublicIPAddressSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs index 0c40a4fbdceb..61f47e7569fc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PublicIPAddressSkuTier. /// + + public static class PublicIPAddressSkuTier { public const string Regional = "Regional"; public const string Global = "Global"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDdosProtectionStatusHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDdosProtectionStatusHeaders.cs index dd8d6b0eb771..feb71a95c097 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDdosProtectionStatusHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDdosProtectionStatusHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for DdosProtectionStatus operation. - /// public partial class PublicIPAddressesDdosProtectionStatusHeaders { /// - /// Initializes a new instance of the - /// PublicIPAddressesDdosProtectionStatusHeaders class. + /// Initializes a new instance of the PublicIPAddressesDdosProtectionStatusHeaders class. /// public PublicIPAddressesDdosProtectionStatusHeaders() { @@ -28,14 +18,15 @@ public PublicIPAddressesDdosProtectionStatusHeaders() } /// - /// Initializes a new instance of the - /// PublicIPAddressesDdosProtectionStatusHeaders class. + /// Initializes a new instance of the PublicIPAddressesDdosProtectionStatusHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public PublicIPAddressesDdosProtectionStatusHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public PublicIPAddressesDdosProtectionStatusHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDeleteHeaders.cs index 1bbb521a0970..18bda2901dc8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPAddressesDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class PublicIPAddressesDeleteHeaders { /// - /// Initializes a new instance of the PublicIPAddressesDeleteHeaders - /// class. + /// Initializes a new instance of the PublicIPAddressesDeleteHeaders class. /// public PublicIPAddressesDeleteHeaders() { @@ -28,14 +18,15 @@ public PublicIPAddressesDeleteHeaders() } /// - /// Initializes a new instance of the PublicIPAddressesDeleteHeaders - /// class. + /// Initializes a new instance of the PublicIPAddressesDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public PublicIPAddressesDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public PublicIPAddressesDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefix.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefix.cs index 9492698563f9..9ab0b4361e5d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefix.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefix.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Public IP prefix resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PublicIPPrefix : Resource { /// @@ -34,55 +24,83 @@ public PublicIPPrefix() /// /// Initializes a new instance of the PublicIPPrefix class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the public - /// ip address. - /// The public IP prefix SKU. + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the public ip address. + /// + + /// The public IP prefix SKU. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// A list of availability zones denoting the IP allocated for the resource + /// needs to come from. + /// + + /// The provisioning state of the public IP prefix resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// NatGateway of Public IP Prefix. + /// + /// The public IP address version. - /// Possible values include: 'IPv4', 'IPv6' - /// The list of tags associated with the public IP - /// prefix. - /// The Length of the Public IP - /// Prefix. - /// The allocated Prefix. - /// The list of all referenced - /// PublicIPAddresses. - /// The reference to - /// load balancer frontend IP configuration associated with the public - /// IP prefix. - /// The customIpPrefix that this prefix is - /// associated with. - /// The resource GUID property of the public - /// IP prefix resource. - /// The provisioning state of the - /// public IP prefix resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// NatGateway of Public IP Prefix. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A list of availability zones denoting the IP - /// allocated for the resource needs to come from. - public PublicIPPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PublicIPPrefixSku sku = default(PublicIPPrefixSku), string publicIPAddressVersion = default(string), IList ipTags = default(IList), int? prefixLength = default(int?), string ipPrefix = default(string), IList publicIPAddresses = default(IList), SubResource loadBalancerFrontendIpConfiguration = default(SubResource), SubResource customIPPrefix = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), NatGateway natGateway = default(NatGateway), string etag = default(string), IList zones = default(IList)) - : base(id, name, type, location, tags) + /// Possible values include: 'IPv4', 'IPv6' + + /// The list of tags associated with the public IP prefix. + /// + + /// The Length of the Public IP Prefix. + /// + + /// The allocated Prefix. + /// + + /// The list of all referenced PublicIPAddresses. + /// + + /// The reference to load balancer frontend IP configuration associated with + /// the public IP prefix. + /// + + /// The customIpPrefix that this prefix is associated with. + /// + + /// The resource GUID property of the public IP prefix resource. + /// + public PublicIPPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PublicIPPrefixSku sku = default(PublicIPPrefixSku), string etag = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string provisioningState = default(string), NatGateway natGateway = default(NatGateway), string publicIPAddressVersion = default(string), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), int? prefixLength = default(int?), string ipPrefix = default(string), System.Collections.Generic.IList publicIPAddresses = default(System.Collections.Generic.IList), SubResource loadBalancerFrontendIPConfiguration = default(SubResource), SubResource customIPPrefix = default(SubResource), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - Sku = sku; - PublicIPAddressVersion = publicIPAddressVersion; - IpTags = ipTags; - PrefixLength = prefixLength; - IpPrefix = ipPrefix; - PublicIPAddresses = publicIPAddresses; - LoadBalancerFrontendIpConfiguration = loadBalancerFrontendIpConfiguration; - CustomIPPrefix = customIPPrefix; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - NatGateway = natGateway; - Etag = etag; - Zones = zones; + this.ExtendedLocation = extendedLocation; + this.Sku = sku; + this.Etag = etag; + this.Zones = zones; + this.ProvisioningState = provisioningState; + this.NatGateway = natGateway; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.IPTags = ipTags; + this.PrefixLength = prefixLength; + this.IPPrefix = ipPrefix; + this.PublicIPAddresses = publicIPAddresses; + this.LoadBalancerFrontendIPConfiguration = loadBalancerFrontendIPConfiguration; + this.CustomIPPrefix = customIPPrefix; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -91,96 +109,92 @@ public PublicIPPrefix() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the public ip address. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// /// Gets or sets the public IP prefix SKU. /// - [JsonProperty(PropertyName = "sku")] - public PublicIPPrefixSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public PublicIPPrefixSku Sku {get; set; } /// - /// Gets or sets the public IP address version. Possible values - /// include: 'IPv4', 'IPv6' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] - public string PublicIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the list of tags associated with the public IP prefix. + /// Gets or sets a list of availability zones denoting the IP allocated for the + /// resource needs to come from. /// - [JsonProperty(PropertyName = "properties.ipTags")] - public IList IpTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets the Length of the Public IP Prefix. + /// Gets the provisioning state of the public IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.prefixLength")] - public int? PrefixLength { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the allocated Prefix. + /// Gets or sets natGateway of Public IP Prefix. /// - [JsonProperty(PropertyName = "properties.ipPrefix")] - public string IpPrefix { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.natGateway")] + public NatGateway NatGateway {get; set; } /// - /// Gets the list of all referenced PublicIPAddresses. + /// Gets or sets the public IP address version. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.publicIPAddresses")] - public IList PublicIPAddresses { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } /// - /// Gets the reference to load balancer frontend IP configuration - /// associated with the public IP prefix. + /// Gets or sets the list of tags associated with the public IP prefix. /// - [JsonProperty(PropertyName = "properties.loadBalancerFrontendIpConfiguration")] - public SubResource LoadBalancerFrontendIpConfiguration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipTags")] + public System.Collections.Generic.IList IPTags {get; set; } /// - /// Gets or sets the customIpPrefix that this prefix is associated - /// with. + /// Gets or sets the Length of the Public IP Prefix. /// - [JsonProperty(PropertyName = "properties.customIPPrefix")] - public SubResource CustomIPPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.prefixLength")] + public int? PrefixLength {get; set; } /// - /// Gets the resource GUID property of the public IP prefix resource. + /// Gets the allocated Prefix. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipPrefix")] + public string IPPrefix {get; private set; } /// - /// Gets the provisioning state of the public IP prefix resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the list of all referenced PublicIPAddresses. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddresses")] + public System.Collections.Generic.IList PublicIPAddresses {get; private set; } /// - /// Gets or sets natGateway of Public IP Prefix. + /// Gets the reference to load balancer frontend IP configuration associated + /// with the public IP prefix. /// - [JsonProperty(PropertyName = "properties.natGateway")] - public NatGateway NatGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerFrontendIpConfiguration")] + public SubResource LoadBalancerFrontendIPConfiguration {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the customIpPrefix that this prefix is associated with. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customIPPrefix")] + public SubResource CustomIPPrefix {get; set; } /// - /// Gets or sets a list of availability zones denoting the IP allocated - /// for the resource needs to come from. + /// Gets the resource GUID property of the public IP prefix resource. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixPropertiesFormat.cs new file mode 100644 index 000000000000..72488700c622 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixPropertiesFormat.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Public IP prefix properties. + /// + public partial class PublicIPPrefixPropertiesFormat + { + /// + /// Initializes a new instance of the PublicIPPrefixPropertiesFormat class. + /// + public PublicIPPrefixPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PublicIPPrefixPropertiesFormat class. + /// + + /// The public IP address version. + /// Possible values include: 'IPv4', 'IPv6' + + /// The list of tags associated with the public IP prefix. + /// + + /// The Length of the Public IP Prefix. + /// + + /// The allocated Prefix. + /// + + /// The list of all referenced PublicIPAddresses. + /// + + /// The reference to load balancer frontend IP configuration associated with + /// the public IP prefix. + /// + + /// The customIpPrefix that this prefix is associated with. + /// + + /// The resource GUID property of the public IP prefix resource. + /// + + /// The provisioning state of the public IP prefix resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// NatGateway of Public IP Prefix. + /// + public PublicIPPrefixPropertiesFormat(string publicIPAddressVersion = default(string), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), int? prefixLength = default(int?), string ipPrefix = default(string), System.Collections.Generic.IList publicIPAddresses = default(System.Collections.Generic.IList), SubResource loadBalancerFrontendIPConfiguration = default(SubResource), SubResource customIPPrefix = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), NatGateway natGateway = default(NatGateway)) + + { + this.PublicIPAddressVersion = publicIPAddressVersion; + this.IPTags = ipTags; + this.PrefixLength = prefixLength; + this.IPPrefix = ipPrefix; + this.PublicIPAddresses = publicIPAddresses; + this.LoadBalancerFrontendIPConfiguration = loadBalancerFrontendIPConfiguration; + this.CustomIPPrefix = customIPPrefix; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.NatGateway = natGateway; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the public IP address version. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } + + /// + /// Gets or sets the list of tags associated with the public IP prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTags")] + public System.Collections.Generic.IList IPTags {get; set; } + + /// + /// Gets or sets the Length of the Public IP Prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "prefixLength")] + public int? PrefixLength {get; set; } + + /// + /// Gets the allocated Prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipPrefix")] + public string IPPrefix {get; private set; } + + /// + /// Gets the list of all referenced PublicIPAddresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddresses")] + public System.Collections.Generic.IList PublicIPAddresses {get; private set; } + + /// + /// Gets the reference to load balancer frontend IP configuration associated + /// with the public IP prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerFrontendIpConfiguration")] + public SubResource LoadBalancerFrontendIPConfiguration {get; private set; } + + /// + /// Gets or sets the customIpPrefix that this prefix is associated with. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customIPPrefix")] + public SubResource CustomIPPrefix {get; set; } + + /// + /// Gets the resource GUID property of the public IP prefix resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the public IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets natGateway of Public IP Prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "natGateway")] + public NatGateway NatGateway {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSku.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSku.cs index 5fadd6fb6678..77fbcd9235e2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public PublicIPPrefixSku() /// /// Initializes a new instance of the PublicIPPrefixSku class. /// - /// Name of a public IP prefix SKU. Possible values - /// include: 'Standard' - /// Tier of a public IP prefix SKU. Possible values - /// include: 'Regional', 'Global' + + /// Name of a public IP prefix SKU. + /// Possible values include: 'Standard' + + /// Tier of a public IP prefix SKU. + /// Possible values include: 'Regional', 'Global' public PublicIPPrefixSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -45,19 +42,17 @@ public PublicIPPrefixSku() /// partial void CustomInit(); + /// - /// Gets or sets name of a public IP prefix SKU. Possible values - /// include: 'Standard' + /// Gets or sets name of a public IP prefix SKU. Possible values include: 'Standard' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets tier of a public IP prefix SKU. Possible values - /// include: 'Regional', 'Global' + /// Gets or sets tier of a public IP prefix SKU. Possible values include: 'Regional', 'Global' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuName.cs index 8b38a2db37af..30436b606f18 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PublicIPPrefixSkuName. /// + + public static class PublicIPPrefixSkuName { public const string Standard = "Standard"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuTier.cs index 6d0dd808b63a..d483f3a981b6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIPPrefixSkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for PublicIPPrefixSkuTier. /// + + public static class PublicIPPrefixSkuTier { public const string Regional = "Regional"; public const string Global = "Global"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIpAddressDnsSettingsDomainNameLabelScope.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIpAddressDnsSettingsDomainNameLabelScope.cs index 58fec574f97e..52a2d824d46a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIpAddressDnsSettingsDomainNameLabelScope.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIpAddressDnsSettingsDomainNameLabelScope.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for PublicIpAddressDnsSettingsDomainNameLabelScope. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum PublicIpAddressDnsSettingsDomainNameLabelScope { - [EnumMember(Value = "TenantReuse")] + [System.Runtime.Serialization.EnumMember(Value = "TenantReuse")] TenantReuse, - [EnumMember(Value = "SubscriptionReuse")] + [System.Runtime.Serialization.EnumMember(Value = "SubscriptionReuse")] SubscriptionReuse, - [EnumMember(Value = "ResourceGroupReuse")] + [System.Runtime.Serialization.EnumMember(Value = "ResourceGroupReuse")] ResourceGroupReuse, - [EnumMember(Value = "NoReuse")] + [System.Runtime.Serialization.EnumMember(Value = "NoReuse")] NoReuse } internal static class PublicIpAddressDnsSettingsDomainNameLabelScopeEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this PublicIpAddressDnsSettingsDomainNa { return value == null ? null : ((PublicIpAddressDnsSettingsDomainNameLabelScope)value).ToSerializedValue(); } - internal static string ToSerializedValue(this PublicIpAddressDnsSettingsDomainNameLabelScope value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this PublicIpAddressDnsSettingsDomainNa } return null; } - internal static PublicIpAddressDnsSettingsDomainNameLabelScope? ParsePublicIpAddressDnsSettingsDomainNameLabelScope(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this PublicIpAddressDnsSettingsDomainNa return null; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/PublicIpDdosProtectionStatusResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/PublicIpDdosProtectionStatusResult.cs index 801efa0962fb..86ce825229e0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/PublicIpDdosProtectionStatusResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/PublicIpDdosProtectionStatusResult.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Response for GetPublicIpAddressDdosProtectionStatusOperation API - /// service call. + /// Response for GetPublicIpAddressDdosProtectionStatusOperation API service + /// call. /// public partial class PublicIpDdosProtectionStatusResult { /// - /// Initializes a new instance of the - /// PublicIpDdosProtectionStatusResult class. + /// Initializes a new instance of the PublicIpDdosProtectionStatusResult class. /// public PublicIpDdosProtectionStatusResult() { @@ -29,23 +22,28 @@ public PublicIpDdosProtectionStatusResult() } /// - /// Initializes a new instance of the - /// PublicIpDdosProtectionStatusResult class. + /// Initializes a new instance of the PublicIpDdosProtectionStatusResult class. /// - /// Public IP ARM resource ID - /// IP Address of the Public IP - /// Resource - /// Value indicating whether the IP - /// address is DDoS workload protected or not. Possible values include: - /// 'False', 'True' - /// DDoS protection plan Resource - /// Id of a if IP address is protected through a plan. - public PublicIpDdosProtectionStatusResult(string publicIpAddressId = default(string), string publicIpAddress = default(string), string isWorkloadProtected = default(string), string ddosProtectionPlanId = default(string)) + + /// Public IP ARM resource ID + /// + + /// IP Address of the Public IP Resource + /// + + /// Value indicating whether the IP address is DDoS workload protected or not. + /// Possible values include: 'False', 'True' + + /// DDoS protection plan Resource Id of a if IP address is protected through a + /// plan. + /// + public PublicIpDdosProtectionStatusResult(string publicIPAddressId = default(string), string publicIPAddress = default(string), string isWorkloadProtected = default(string), string ddosProtectionPlanId = default(string)) + { - PublicIpAddressId = publicIpAddressId; - PublicIpAddress = publicIpAddress; - IsWorkloadProtected = isWorkloadProtected; - DdosProtectionPlanId = ddosProtectionPlanId; + this.PublicIPAddressId = publicIPAddressId; + this.PublicIPAddress = publicIPAddress; + this.IsWorkloadProtected = isWorkloadProtected; + this.DdosProtectionPlanId = ddosProtectionPlanId; CustomInit(); } @@ -54,31 +52,31 @@ public PublicIpDdosProtectionStatusResult() /// partial void CustomInit(); + /// /// Gets or sets public IP ARM resource ID /// - [JsonProperty(PropertyName = "publicIpAddressId")] - public string PublicIpAddressId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddressId")] + public string PublicIPAddressId {get; set; } /// - /// Gets or sets IP Address of the Public IP Resource + /// Gets or sets iP Address of the Public IP Resource /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIPAddress {get; set; } /// - /// Gets or sets value indicating whether the IP address is DDoS - /// workload protected or not. Possible values include: 'False', 'True' + /// Gets or sets value indicating whether the IP address is DDoS workload + /// protected or not. Possible values include: 'False', 'True' /// - [JsonProperty(PropertyName = "isWorkloadProtected")] - public string IsWorkloadProtected { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isWorkloadProtected")] + public string IsWorkloadProtected {get; set; } /// - /// Gets or sets DDoS protection plan Resource Id of a if IP address - /// is protected through a plan. + /// Gets or sets DDoS protection plan Resource Id of a if IP address is + /// protected through a plan. /// - [JsonProperty(PropertyName = "ddosProtectionPlanId")] - public string DdosProtectionPlanId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ddosProtectionPlanId")] + public string DdosProtectionPlanId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QosDefinition.cs b/src/Network/Network.Management.Sdk/Generated/Models/QosDefinition.cs index 5c02d0815067..5a6609130bee 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QosDefinition.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QosDefinition.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,24 +24,34 @@ public QosDefinition() /// /// Initializes a new instance of the QosDefinition class. /// - /// List of markings to be used in the - /// configuration. - /// Source IP ranges. - /// Destination IP ranges. - /// Sources port ranges. - /// Destination port - /// ranges. - /// RNM supported protocol types. Possible - /// values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', - /// 'Ah', 'Vxlan', 'All' - public QosDefinition(IList markings = default(IList), IList sourceIpRanges = default(IList), IList destinationIpRanges = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string protocol = default(string)) + + /// List of markings to be used in the configuration. + /// + + /// Source IP ranges. + /// + + /// Destination IP ranges. + /// + + /// Sources port ranges. + /// + + /// Destination port ranges. + /// + + /// RNM supported protocol types. + /// Possible values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', + /// 'Ah', 'Vxlan', 'All' + public QosDefinition(System.Collections.Generic.IList markings = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceIPRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationIPRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string protocol = default(string)) + { - Markings = markings; - SourceIpRanges = sourceIpRanges; - DestinationIpRanges = destinationIpRanges; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Protocol = protocol; + this.Markings = markings; + this.SourceIPRanges = sourceIPRanges; + this.DestinationIPRanges = destinationIPRanges; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Protocol = protocol; CustomInit(); } @@ -58,43 +60,41 @@ public QosDefinition() /// partial void CustomInit(); + /// /// Gets or sets list of markings to be used in the configuration. /// - [JsonProperty(PropertyName = "markings")] - public IList Markings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "markings")] + public System.Collections.Generic.IList Markings {get; set; } /// /// Gets or sets source IP ranges. /// - [JsonProperty(PropertyName = "sourceIpRanges")] - public IList SourceIpRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceIpRanges")] + public System.Collections.Generic.IList SourceIPRanges {get; set; } /// /// Gets or sets destination IP ranges. /// - [JsonProperty(PropertyName = "destinationIpRanges")] - public IList DestinationIpRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationIpRanges")] + public System.Collections.Generic.IList DestinationIPRanges {get; set; } /// /// Gets or sets sources port ranges. /// - [JsonProperty(PropertyName = "sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// /// Gets or sets destination port ranges. /// - [JsonProperty(PropertyName = "destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// - /// Gets or sets RNM supported protocol types. Possible values include: - /// 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', 'Ah', 'Vxlan', - /// 'All' + /// Gets or sets rNM supported protocol types. Possible values include: 'DoNotUse', 'Icmp', 'Tcp', 'Udp', 'Gre', 'Esp', 'Ah', 'Vxlan', 'All' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QosIpRange.cs b/src/Network/Network.Management.Sdk/Generated/Models/QosIpRange.cs index 159634daca03..e5d43c7c88ed 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QosIpRange.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QosIpRange.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public QosIpRange() /// /// Initializes a new instance of the QosIpRange class. /// - /// Start IP Address. - /// End IP Address. + + /// Start IP Address. + /// + + /// End IP Address. + /// public QosIpRange(string startIP = default(string), string endIP = default(string)) + { - StartIP = startIP; - EndIP = endIP; + this.StartIP = startIP; + this.EndIP = endIP; CustomInit(); } @@ -43,17 +42,17 @@ public QosIpRange() /// partial void CustomInit(); + /// /// Gets or sets start IP Address. /// - [JsonProperty(PropertyName = "startIP")] - public string StartIP { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startIP")] + public string StartIP {get; set; } /// /// Gets or sets end IP Address. /// - [JsonProperty(PropertyName = "endIP")] - public string EndIP { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "endIP")] + public string EndIP {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QosPortRange.cs b/src/Network/Network.Management.Sdk/Generated/Models/QosPortRange.cs index b2719aff4f01..4281f77d210f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QosPortRange.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QosPortRange.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public QosPortRange() /// /// Initializes a new instance of the QosPortRange class. /// - /// Qos Port Range start. - /// Qos Port Range end. + + /// Qos Port Range start. + /// + + /// Qos Port Range end. + /// public QosPortRange(int? start = default(int?), int? end = default(int?)) + { - Start = start; - End = end; + this.Start = start; + this.End = end; CustomInit(); } @@ -43,17 +42,17 @@ public QosPortRange() /// partial void CustomInit(); + /// /// Gets or sets qos Port Range start. /// - [JsonProperty(PropertyName = "start")] - public int? Start { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "start")] + public int? Start {get; set; } /// /// Gets or sets qos Port Range end. /// - [JsonProperty(PropertyName = "end")] - public int? End { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "end")] + public int? End {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QueryInboundNatRulePortMappingRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/QueryInboundNatRulePortMappingRequest.cs index 39a849ea3c5d..793d1fa1b454 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QueryInboundNatRulePortMappingRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QueryInboundNatRulePortMappingRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class QueryInboundNatRulePortMappingRequest { /// - /// Initializes a new instance of the - /// QueryInboundNatRulePortMappingRequest class. + /// Initializes a new instance of the QueryInboundNatRulePortMappingRequest class. /// public QueryInboundNatRulePortMappingRequest() { @@ -29,17 +22,19 @@ public QueryInboundNatRulePortMappingRequest() } /// - /// Initializes a new instance of the - /// QueryInboundNatRulePortMappingRequest class. + /// Initializes a new instance of the QueryInboundNatRulePortMappingRequest class. /// - /// NetworkInterfaceIPConfiguration set - /// in load balancer backend address. - /// IP address set in load balancer backend - /// address. + + /// NetworkInterfaceIPConfiguration set in load balancer backend address. + /// + + /// IP address set in load balancer backend address. + /// public QueryInboundNatRulePortMappingRequest(SubResource ipConfiguration = default(SubResource), string ipAddress = default(string)) + { - IpConfiguration = ipConfiguration; - IpAddress = ipAddress; + this.IPConfiguration = ipConfiguration; + this.IPAddress = ipAddress; CustomInit(); } @@ -48,18 +43,18 @@ public QueryInboundNatRulePortMappingRequest() /// partial void CustomInit(); + /// - /// Gets or sets networkInterfaceIPConfiguration set in load balancer - /// backend address. + /// Gets or sets networkInterfaceIPConfiguration set in load balancer backend + /// address. /// - [JsonProperty(PropertyName = "ipConfiguration")] - public SubResource IpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfiguration")] + public SubResource IPConfiguration {get; set; } /// - /// Gets or sets IP address set in load balancer backend address. + /// Gets or sets iP address set in load balancer backend address. /// - [JsonProperty(PropertyName = "ipAddress")] - public string IpAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QueryRequestOptions.cs b/src/Network/Network.Management.Sdk/Generated/Models/QueryRequestOptions.cs index 2f0f13cbc502..bb09e21fdcfc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QueryRequestOptions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QueryRequestOptions.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,15 @@ public QueryRequestOptions() /// /// Initializes a new instance of the QueryRequestOptions class. /// - /// When present, the value can be passed to a - /// subsequent query call (together with the same query and scopes used - /// in the current request) to retrieve the next page of data. + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// public QueryRequestOptions(string skipToken = default(string)) + { - SkipToken = skipToken; + this.SkipToken = skipToken; CustomInit(); } @@ -43,13 +40,13 @@ public QueryRequestOptions() /// partial void CustomInit(); + /// - /// Gets or sets when present, the value can be passed to a subsequent - /// query call (together with the same query and scopes used in the - /// current request) to retrieve the next page of data. + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "skipToken")] + public string SkipToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QueryResults.cs b/src/Network/Network.Management.Sdk/Generated/Models/QueryResults.cs index 9e253e3072f8..37421daf6569 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QueryResults.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QueryResults.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,17 @@ public QueryResults() /// /// Initializes a new instance of the QueryResults class. /// - /// Number of total records matching - /// the query. - /// Array containing the results of the - /// query - public QueryResults(long? matchingRecordsCount = default(long?), IList signatures = default(IList)) + + /// Number of total records matching the query. + /// + + /// Array containing the results of the query + /// + public QueryResults(long? matchingRecordsCount = default(long?), System.Collections.Generic.IList signatures = default(System.Collections.Generic.IList)) + { - MatchingRecordsCount = matchingRecordsCount; - Signatures = signatures; + this.MatchingRecordsCount = matchingRecordsCount; + this.Signatures = signatures; CustomInit(); } @@ -47,17 +42,17 @@ public QueryResults() /// partial void CustomInit(); + /// /// Gets or sets number of total records matching the query. /// - [JsonProperty(PropertyName = "matchingRecordsCount")] - public long? MatchingRecordsCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchingRecordsCount")] + public long? MatchingRecordsCount {get; set; } /// /// Gets or sets array containing the results of the query /// - [JsonProperty(PropertyName = "signatures")] - public IList Signatures { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "signatures")] + public System.Collections.Generic.IList Signatures {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/QueryTroubleshootingParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/QueryTroubleshootingParameters.cs index 5cc7bf4cc6f5..172aceaac2d6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/QueryTroubleshootingParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/QueryTroubleshootingParameters.cs @@ -1,28 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Parameters that define the resource to query the troubleshooting - /// result. + /// Parameters that define the resource to query the troubleshooting result. /// public partial class QueryTroubleshootingParameters { /// - /// Initializes a new instance of the QueryTroubleshootingParameters - /// class. + /// Initializes a new instance of the QueryTroubleshootingParameters class. /// public QueryTroubleshootingParameters() { @@ -30,14 +21,15 @@ public QueryTroubleshootingParameters() } /// - /// Initializes a new instance of the QueryTroubleshootingParameters - /// class. + /// Initializes a new instance of the QueryTroubleshootingParameters class. /// - /// The target resource ID to query the - /// troubleshooting result. + + /// The target resource ID to query the troubleshooting result. + /// public QueryTroubleshootingParameters(string targetResourceId) + { - TargetResourceId = targetResourceId; + this.TargetResourceId = targetResourceId; CustomInit(); } @@ -46,25 +38,25 @@ public QueryTroubleshootingParameters(string targetResourceId) /// partial void CustomInit(); + /// - /// Gets or sets the target resource ID to query the troubleshooting - /// result. + /// Gets or sets the target resource ID to query the troubleshooting result. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RadiusServer.cs b/src/Network/Network.Management.Sdk/Generated/Models/RadiusServer.cs index a07d8ef710c1..7bb46d57bf4f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RadiusServer.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RadiusServer.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,17 +23,21 @@ public RadiusServer() /// /// Initializes a new instance of the RadiusServer class. /// - /// The address of this radius - /// server. - /// The initial score assigned to this - /// radius server. - /// The secret used for this radius - /// server. + + /// The address of this radius server. + /// + + /// The initial score assigned to this radius server. + /// + + /// The secret used for this radius server. + /// public RadiusServer(string radiusServerAddress, long? radiusServerScore = default(long?), string radiusServerSecret = default(string)) + { - RadiusServerAddress = radiusServerAddress; - RadiusServerScore = radiusServerScore; - RadiusServerSecret = radiusServerSecret; + this.RadiusServerAddress = radiusServerAddress; + this.RadiusServerScore = radiusServerScore; + this.RadiusServerSecret = radiusServerSecret; CustomInit(); } @@ -49,36 +46,38 @@ public RadiusServer() /// partial void CustomInit(); + /// /// Gets or sets the address of this radius server. /// - [JsonProperty(PropertyName = "radiusServerAddress")] - public string RadiusServerAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerAddress")] + public string RadiusServerAddress {get; set; } /// /// Gets or sets the initial score assigned to this radius server. /// - [JsonProperty(PropertyName = "radiusServerScore")] - public long? RadiusServerScore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerScore")] + public long? RadiusServerScore {get; set; } /// /// Gets or sets the secret used for this radius server. /// - [JsonProperty(PropertyName = "radiusServerSecret")] - public string RadiusServerSecret { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerSecret")] + public string RadiusServerSecret {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RadiusServerAddress == null) + if (this.RadiusServerAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RadiusServerAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RadiusServerAddress"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RecordSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/RecordSet.cs index 31c2bc4237ff..beaa1b13ecd5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RecordSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RecordSet.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,24 +23,33 @@ public RecordSet() /// /// Initializes a new instance of the RecordSet class. /// - /// Resource record type. - /// Recordset name. - /// Fqdn that resolves to private endpoint ip - /// address. - /// The provisioning state of the - /// recordset. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Recordset time to live. - /// The private ip address of the private - /// endpoint. - public RecordSet(string recordType = default(string), string recordSetName = default(string), string fqdn = default(string), string provisioningState = default(string), int? ttl = default(int?), IList ipAddresses = default(IList)) + + /// Resource record type. + /// + + /// Recordset name. + /// + + /// Fqdn that resolves to private endpoint ip address. + /// + + /// The provisioning state of the recordset. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Recordset time to live. + /// + + /// The private ip address of the private endpoint. + /// + public RecordSet(string recordType = default(string), string recordSetName = default(string), string fqdn = default(string), string provisioningState = default(string), int? ttl = default(int?), System.Collections.Generic.IList ipAddresses = default(System.Collections.Generic.IList)) + { - RecordType = recordType; - RecordSetName = recordSetName; - Fqdn = fqdn; - ProvisioningState = provisioningState; - Ttl = ttl; - IpAddresses = ipAddresses; + this.RecordType = recordType; + this.RecordSetName = recordSetName; + this.Fqdn = fqdn; + this.ProvisioningState = provisioningState; + this.Ttl = ttl; + this.IPAddresses = ipAddresses; CustomInit(); } @@ -57,42 +58,41 @@ public RecordSet() /// partial void CustomInit(); + /// /// Gets or sets resource record type. /// - [JsonProperty(PropertyName = "recordType")] - public string RecordType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "recordType")] + public string RecordType {get; set; } /// /// Gets or sets recordset name. /// - [JsonProperty(PropertyName = "recordSetName")] - public string RecordSetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "recordSetName")] + public string RecordSetName {get; set; } /// /// Gets or sets fqdn that resolves to private endpoint ip address. /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } /// - /// Gets the provisioning state of the recordset. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the recordset. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets recordset time to live. /// - [JsonProperty(PropertyName = "ttl")] - public int? Ttl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ttl")] + public int? Ttl {get; set; } /// /// Gets or sets the private ip address of the private endpoint. /// - [JsonProperty(PropertyName = "ipAddresses")] - public IList IpAddresses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddresses")] + public System.Collections.Generic.IList IPAddresses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ReferencedPublicIpAddress.cs b/src/Network/Network.Management.Sdk/Generated/Models/ReferencedPublicIpAddress.cs index 75ee4f83e1fe..681438bb155d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ReferencedPublicIpAddress.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ReferencedPublicIpAddress.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public ReferencedPublicIpAddress() /// /// Initializes a new instance of the ReferencedPublicIpAddress class. /// - /// The PublicIPAddress Reference. + + /// The PublicIPAddress Reference. + /// public ReferencedPublicIpAddress(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -41,11 +38,11 @@ public ReferencedPublicIpAddress() /// partial void CustomInit(); + /// /// Gets or sets the PublicIPAddress Reference. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Resource.cs b/src/Network/Network.Management.Sdk/Generated/Models/Resource.cs index 22c28b5a9b91..274bf1036cf4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Resource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Resource.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Common resource representation. /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -33,18 +23,29 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Tags = tags; CustomInit(); } @@ -53,35 +54,35 @@ public Resource() /// partial void CustomInit(); + /// /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ResourceIdentityType.cs b/src/Network/Network.Management.Sdk/Generated/Models/ResourceIdentityType.cs index 704cf2a0258b..900674094724 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ResourceIdentityType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ResourceIdentityType.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ResourceIdentityType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ResourceIdentityType { - [EnumMember(Value = "SystemAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned")] SystemAssigned, - [EnumMember(Value = "UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "UserAssigned")] UserAssigned, - [EnumMember(Value = "SystemAssigned, UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned, UserAssigned")] SystemAssignedUserAssigned, - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None } internal static class ResourceIdentityTypeEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this ResourceIdentityType? value) { return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ResourceIdentityType value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this ResourceIdentityType value) } return null; } - internal static ResourceIdentityType? ParseResourceIdentityType(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this ResourceIdentityType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLink.cs b/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLink.cs index a7857be163fa..144df51c3276 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLink.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLink.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// ResourceNavigationLink resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ResourceNavigationLink : SubResource { /// @@ -32,28 +24,38 @@ public ResourceNavigationLink() /// /// Initializes a new instance of the ResourceNavigationLink class. /// - /// Resource ID. - /// Resource type of the linked - /// resource. - /// Link to the external resource. - /// The provisioning state of the - /// resource navigation link resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public ResourceNavigationLink(string id = default(string), string linkedResourceType = default(string), string link = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the resource that is unique within a resource group. This name can + /// be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the resource navigation link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Resource type of the linked resource. + /// + + /// Link to the external resource. + /// + public ResourceNavigationLink(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string linkedResourceType = default(string), string link = default(string)) + + : base(id) { - LinkedResourceType = linkedResourceType; - Link = link; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.LinkedResourceType = linkedResourceType; + this.Link = link; CustomInit(); } @@ -62,45 +64,43 @@ public ResourceNavigationLink() /// partial void CustomInit(); + /// - /// Gets or sets resource type of the linked resource. + /// Gets or sets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.linkedResourceType")] - public string LinkedResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets link to the external resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.link")] - public string Link { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the resource navigation link - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets the provisioning state of the resource navigation link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets resource type of the linked resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkedResourceType")] + public string LinkedResourceType {get; set; } /// - /// Gets resource type. + /// Gets or sets link to the external resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.link")] + public string Link {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinkFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinkFormat.cs new file mode 100644 index 000000000000..c7a571263160 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinkFormat.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ResourceNavigationLink. + /// + public partial class ResourceNavigationLinkFormat + { + /// + /// Initializes a new instance of the ResourceNavigationLinkFormat class. + /// + public ResourceNavigationLinkFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceNavigationLinkFormat class. + /// + + /// Resource type of the linked resource. + /// + + /// Link to the external resource. + /// + + /// The provisioning state of the resource navigation link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ResourceNavigationLinkFormat(string linkedResourceType = default(string), string link = default(string), string provisioningState = default(string)) + + { + this.LinkedResourceType = linkedResourceType; + this.Link = link; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets resource type of the linked resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkedResourceType")] + public string LinkedResourceType {get; set; } + + /// + /// Gets or sets link to the external resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "link")] + public string Link {get; set; } + + /// + /// Gets the provisioning state of the resource navigation link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinksListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinksListResult.cs index 29c8df2ba9ff..b7fd07155ecb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinksListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ResourceNavigationLinksListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ResourceNavigationLinksListResult { /// - /// Initializes a new instance of the ResourceNavigationLinksListResult - /// class. + /// Initializes a new instance of the ResourceNavigationLinksListResult class. /// public ResourceNavigationLinksListResult() { @@ -30,17 +21,19 @@ public ResourceNavigationLinksListResult() } /// - /// Initializes a new instance of the ResourceNavigationLinksListResult - /// class. + /// Initializes a new instance of the ResourceNavigationLinksListResult class. /// - /// The resource navigation links in a - /// subnet. - /// The URL to get the next set of - /// results. - public ResourceNavigationLinksListResult(IList value = default(IList), string nextLink = default(string)) + + /// The resource navigation links in a subnet. + /// + + /// The URL to get the next set of results. + /// + public ResourceNavigationLinksListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +42,17 @@ public ResourceNavigationLinksListResult() /// partial void CustomInit(); + /// /// Gets or sets the resource navigation links in a subnet. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ResourceSet.cs b/src/Network/Network.Management.Sdk/Generated/Models/ResourceSet.cs index d7a7a64deeca..15f45d8986a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ResourceSet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ResourceSet.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public ResourceSet() /// /// Initializes a new instance of the ResourceSet class. /// - /// The list of subscriptions. - public ResourceSet(IList subscriptions = default(IList)) + + /// The list of subscriptions. + /// + public ResourceSet(System.Collections.Generic.IList subscriptions = default(System.Collections.Generic.IList)) + { - Subscriptions = subscriptions; + this.Subscriptions = subscriptions; CustomInit(); } @@ -43,11 +38,11 @@ public ResourceSet() /// partial void CustomInit(); + /// /// Gets or sets the list of subscriptions. /// - [JsonProperty(PropertyName = "subscriptions")] - public IList Subscriptions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptions")] + public System.Collections.Generic.IList Subscriptions {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RetentionPolicyParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/RetentionPolicyParameters.cs index b5b9621b1134..57b1f89d2182 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RetentionPolicyParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RetentionPolicyParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public RetentionPolicyParameters() /// /// Initializes a new instance of the RetentionPolicyParameters class. /// - /// Number of days to retain flow log - /// records. - /// Flag to enable/disable retention. + + /// Number of days to retain flow log records. + /// + + /// Flag to enable/disable retention. + /// public RetentionPolicyParameters(int? days = default(int?), bool? enabled = default(bool?)) + { - Days = days; - Enabled = enabled; + this.Days = days; + this.Enabled = enabled; CustomInit(); } @@ -44,17 +42,17 @@ public RetentionPolicyParameters() /// partial void CustomInit(); + /// /// Gets or sets number of days to retain flow log records. /// - [JsonProperty(PropertyName = "days")] - public int? Days { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "days")] + public int? Days {get; set; } /// /// Gets or sets flag to enable/disable retention. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Route.cs b/src/Network/Network.Management.Sdk/Generated/Models/Route.cs index 53bb869e3bf4..c2372e8e643f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Route.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Route.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Route resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Route : SubResource { /// @@ -32,37 +24,49 @@ public Route() /// /// Initializes a new instance of the Route class. /// - /// The type of Azure hop the packet should - /// be sent to. Possible values include: 'VirtualNetworkGateway', - /// 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' - /// Resource ID. - /// The destination CIDR to which the route - /// applies. - /// The IP address packets should be - /// forwarded to. Next hop values are only allowed in routes where the - /// next hop type is VirtualAppliance. - /// The provisioning state of the route - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// A value indicating whether this route - /// overrides overlapping BGP routes regardless of LPM. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The type of the resource. - public Route(string nextHopType, string id = default(string), string addressPrefix = default(string), string nextHopIpAddress = default(string), string provisioningState = default(string), bool? hasBgpOverride = default(bool?), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The type of the resource. + /// + + /// The provisioning state of the route resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The destination CIDR to which the route applies. + /// + + /// The type of Azure hop the packet should be sent to. + /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' + + /// The IP address packets should be forwarded to. Next hop values are only + /// allowed in routes where the next hop type is VirtualAppliance. + /// + + /// A value indicating whether this route overrides overlapping BGP routes + /// regardless of LPM. + /// + public Route(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string addressPrefix = default(string), string nextHopType = default(string), string nextHopIPAddress = default(string), bool? hasBgpOverride = default(bool?)) + + : base(id) { - AddressPrefix = addressPrefix; - NextHopType = nextHopType; - NextHopIpAddress = nextHopIpAddress; - ProvisioningState = provisioningState; - HasBgpOverride = hasBgpOverride; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AddressPrefix = addressPrefix; + this.NextHopType = nextHopType; + this.NextHopIPAddress = nextHopIPAddress; + this.HasBgpOverride = hasBgpOverride; CustomInit(); } @@ -71,74 +75,57 @@ public Route() /// partial void CustomInit(); - /// - /// Gets or sets the destination CIDR to which the route applies. - /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; set; } /// - /// Gets or sets the type of Azure hop the packet should be sent to. - /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', - /// 'Internet', 'VirtualAppliance', 'None' + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.nextHopType")] - public string NextHopType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the IP address packets should be forwarded to. Next - /// hop values are only allowed in routes where the next hop type is - /// VirtualAppliance. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.nextHopIpAddress")] - public string NextHopIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the route resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the type of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets a value indicating whether this route overrides - /// overlapping BGP routes regardless of LPM. + /// Gets the provisioning state of the route resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.hasBgpOverride")] - public bool? HasBgpOverride { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the destination CIDR to which the route applies. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextHopType")] + public string NextHopType {get; set; } /// - /// Gets or sets the type of the resource. + /// Gets or sets the IP address packets should be forwarded to. Next hop values + /// are only allowed in routes where the next hop type is VirtualAppliance. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextHopIpAddress")] + public string NextHopIPAddress {get; set; } /// - /// Validate the object. + /// Gets or sets a value indicating whether this route overrides overlapping + /// BGP routes regardless of LPM. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (NextHopType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "NextHopType"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hasBgpOverride")] + public bool? HasBgpOverride {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilter.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilter.cs index 5ea0384c459d..7fe3d3c7aa00 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilter.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Route Filter Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RouteFilter : Resource { /// @@ -34,30 +24,45 @@ public RouteFilter() /// /// Initializes a new instance of the RouteFilter class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Collection of RouteFilterRules contained within - /// a route filter. - /// A collection of references to express route - /// circuit peerings. - /// A collection of references to express - /// route circuit ipv6 peerings. - /// The provisioning state of the route - /// filter resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public RouteFilter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList rules = default(IList), IList peerings = default(IList), IList ipv6Peerings = default(IList), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the route filter resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Collection of RouteFilterRules contained within a route filter. + /// + + /// A collection of references to express route circuit peerings. + /// + + /// A collection of references to express route circuit ipv6 peerings. + /// + public RouteFilter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipv6Peerings = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - Rules = rules; - Peerings = peerings; - Ipv6Peerings = ipv6Peerings; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Rules = rules; + this.Peerings = peerings; + this.Ipv6Peerings = ipv6Peerings; CustomInit(); } @@ -66,39 +71,37 @@ public RouteFilter() /// partial void CustomInit(); + /// - /// Gets or sets collection of RouteFilterRules contained within a - /// route filter. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets a collection of references to express route circuit peerings. + /// Gets the provisioning state of the route filter resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a collection of references to express route circuit ipv6 - /// peerings. + /// Gets or sets collection of RouteFilterRules contained within a route + /// filter. /// - [JsonProperty(PropertyName = "properties.ipv6Peerings")] - public IList Ipv6Peerings { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } /// - /// Gets the provisioning state of the route filter resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets a collection of references to express route circuit peerings. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] + public System.Collections.Generic.IList Peerings {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a collection of references to express route circuit ipv6 peerings. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipv6Peerings")] + public System.Collections.Generic.IList Ipv6Peerings {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterPropertiesFormat.cs new file mode 100644 index 000000000000..734fc279984e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterPropertiesFormat.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Route Filter Resource. + /// + public partial class RouteFilterPropertiesFormat + { + /// + /// Initializes a new instance of the RouteFilterPropertiesFormat class. + /// + public RouteFilterPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteFilterPropertiesFormat class. + /// + + /// Collection of RouteFilterRules contained within a route filter. + /// + + /// A collection of references to express route circuit peerings. + /// + + /// A collection of references to express route circuit ipv6 peerings. + /// + + /// The provisioning state of the route filter resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public RouteFilterPropertiesFormat(System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipv6Peerings = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Rules = rules; + this.Peerings = peerings; + this.Ipv6Peerings = ipv6Peerings; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets collection of RouteFilterRules contained within a route + /// filter. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } + + /// + /// Gets a collection of references to express route circuit peerings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerings")] + public System.Collections.Generic.IList Peerings {get; private set; } + + /// + /// Gets a collection of references to express route circuit ipv6 peerings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipv6Peerings")] + public System.Collections.Generic.IList Ipv6Peerings {get; private set; } + + /// + /// Gets the provisioning state of the route filter resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRule.cs index 04c00af70e64..57d5847bcc58 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Route Filter Rule Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RouteFilterRule : SubResource { /// @@ -34,108 +24,95 @@ public RouteFilterRule() /// /// Initializes a new instance of the RouteFilterRule class. /// - /// The access type of the rule. Possible values - /// include: 'Allow', 'Deny' - /// The collection for bgp community values - /// to filter on. e.g. ['12076:5010','12076:5020']. - /// Resource ID. - /// The provisioning state of the route - /// filter rule resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// Resource location. - /// A unique read-only string that changes whenever - /// the resource is updated. - public RouteFilterRule(string access, IList communities, string id = default(string), string provisioningState = default(string), string name = default(string), string location = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// Resource location. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The access type of the rule. + /// Possible values include: 'Allow', 'Deny' + + /// The provisioning state of the route filter rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The rule type of the rule. + /// Possible values include: 'Community' + + /// The collection for bgp community values to filter on. e.g. + /// ['12076:5010','12076:5020']. + /// + public RouteFilterRule(string id = default(string), string name = default(string), string location = default(string), string etag = default(string), string access = default(string), string provisioningState = default(string), string routeFilterRuleType = default(string), System.Collections.Generic.IList communities = default(System.Collections.Generic.IList)) + + : base(id) { - Access = access; - Communities = communities; - ProvisioningState = provisioningState; - Name = name; - Location = location; - Etag = etag; + this.Name = name; + this.Location = location; + this.Etag = etag; + this.Access = access; + this.ProvisioningState = provisioningState; + this.RouteFilterRuleType = routeFilterRuleType; + this.Communities = communities; CustomInit(); } - /// - /// Static constructor for RouteFilterRule class. - /// - static RouteFilterRule() - { - RouteFilterRuleType = "Community"; - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); - /// - /// Gets or sets the access type of the rule. Possible values include: - /// 'Allow', 'Deny' - /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; set; } /// - /// Gets or sets the collection for bgp community values to filter on. - /// e.g. ['12076:5010','12076:5020']. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.communities")] - public IList Communities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the route filter rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets resource location. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets resource location. + /// Gets or sets the access type of the rule. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the route filter rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// The rule type of the rule. + /// Gets or sets the rule type of the rule. Possible values include: 'Community' /// - [JsonProperty(PropertyName = "properties.routeFilterRuleType")] - public static string RouteFilterRuleType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeFilterRuleType")] + public string RouteFilterRuleType {get; set; } /// - /// Validate the object. + /// Gets or sets the collection for bgp community values to filter on. e.g. + /// ['12076:5010','12076:5020']. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); - } - if (Communities == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Communities"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.communities")] + public System.Collections.Generic.IList Communities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRulePropertiesFormat.cs new file mode 100644 index 000000000000..9d389fd4ab12 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRulePropertiesFormat.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Route Filter Rule Resource. + /// + public partial class RouteFilterRulePropertiesFormat + { + /// + /// Initializes a new instance of the RouteFilterRulePropertiesFormat class. + /// + public RouteFilterRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteFilterRulePropertiesFormat class. + /// + + /// The access type of the rule. + /// Possible values include: 'Allow', 'Deny' + + /// The collection for bgp community values to filter on. e.g. + /// ['12076:5010','12076:5020']. + /// + + /// The provisioning state of the route filter rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public RouteFilterRulePropertiesFormat(string access, System.Collections.Generic.IList communities, string provisioningState = default(string)) + + { + this.Access = access; + this.Communities = communities; + this.ProvisioningState = provisioningState; + CustomInit(); + } + /// + /// Static constructor for RouteFilterRulePropertiesFormat class. + /// + static RouteFilterRulePropertiesFormat() + { + RouteFilterRuleType = "Community"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the access type of the rule. Possible values include: 'Allow', 'Deny' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; set; } + + /// + /// Gets or sets the collection for bgp community values to filter on. e.g. + /// ['12076:5010','12076:5020']. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "communities")] + public System.Collections.Generic.IList Communities {get; set; } + + /// + /// Gets the provisioning state of the route filter rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Gets or sets the rule type of the rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routeFilterRuleType")] + public static string RouteFilterRuleType {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Access == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Access"); + } + if (this.Communities == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Communities"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRuleType.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRuleType.cs new file mode 100644 index 000000000000..df29cba8d09d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteFilterRuleType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for RouteFilterRuleType. + /// + + + public static class RouteFilterRuleType + { + public const string Community = "Community"; + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteMap.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteMap.cs index ef75e727552b..fb38f53880b1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteMap.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteMap.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The RouteMap child resource of a Virtual hub. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RouteMap : SubResource { /// @@ -34,31 +24,43 @@ public RouteMap() /// /// Initializes a new instance of the RouteMap class. /// - /// Resource ID. - /// List of connections - /// which have this RoutMap associated for inbound traffic. - /// List of connections - /// which have this RoutMap associated for outbound traffic. - /// List of RouteMap rules to be applied. - /// The provisioning state of the - /// RouteMap resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public RouteMap(string id = default(string), IList associatedInboundConnections = default(IList), IList associatedOutboundConnections = default(IList), IList rules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the RouteMap resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of connections which have this RoutMap associated for inbound traffic. + /// + + /// List of connections which have this RoutMap associated for outbound + /// traffic. + /// + + /// List of RouteMap rules to be applied. + /// + public RouteMap(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList associatedInboundConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList associatedOutboundConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + + : base(id) { - AssociatedInboundConnections = associatedInboundConnections; - AssociatedOutboundConnections = associatedOutboundConnections; - Rules = rules; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AssociatedInboundConnections = associatedInboundConnections; + this.AssociatedOutboundConnections = associatedOutboundConnections; + this.Rules = rules; CustomInit(); } @@ -67,52 +69,51 @@ public RouteMap() /// partial void CustomInit(); + /// - /// Gets or sets list of connections which have this RoutMap associated - /// for inbound traffic. + /// Gets the name of the resource that is unique within a resource group. This + /// name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.associatedInboundConnections")] - public IList AssociatedInboundConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets or sets list of connections which have this RoutMap associated - /// for outbound traffic. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.associatedOutboundConnections")] - public IList AssociatedOutboundConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets list of RouteMap rules to be applied. + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets the provisioning state of the RouteMap resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the RouteMap resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets or sets list of connections which have this RoutMap associated for + /// inbound traffic. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.associatedInboundConnections")] + public System.Collections.Generic.IList AssociatedInboundConnections {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets list of connections which have this RoutMap associated for + /// outbound traffic. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.associatedOutboundConnections")] + public System.Collections.Generic.IList AssociatedOutboundConnections {get; set; } /// - /// Gets resource type. + /// Gets or sets list of RouteMap rules to be applied. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public System.Collections.Generic.IList Rules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapActionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapActionType.cs index 8a980ea83d6a..7c1436553fc9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapActionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapActionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for RouteMapActionType. /// + + public static class RouteMapActionType { public const string Unknown = "Unknown"; @@ -22,4 +19,4 @@ public static class RouteMapActionType public const string Replace = "Replace"; public const string Drop = "Drop"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapMatchCondition.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapMatchCondition.cs index c31ca214ab0d..28672c7eb02e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapMatchCondition.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapMatchCondition.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for RouteMapMatchCondition. /// + + public static class RouteMapMatchCondition { public const string Unknown = "Unknown"; @@ -22,4 +19,4 @@ public static class RouteMapMatchCondition public const string NotContains = "NotContains"; public const string NotEquals = "NotEquals"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapProperties.cs new file mode 100644 index 000000000000..482c15575602 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of RouteMap resource + /// + public partial class RouteMapProperties + { + /// + /// Initializes a new instance of the RouteMapProperties class. + /// + public RouteMapProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteMapProperties class. + /// + + /// List of connections which have this RoutMap associated for inbound traffic. + /// + + /// List of connections which have this RoutMap associated for outbound + /// traffic. + /// + + /// List of RouteMap rules to be applied. + /// + + /// The provisioning state of the RouteMap resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public RouteMapProperties(System.Collections.Generic.IList associatedInboundConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList associatedOutboundConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.AssociatedInboundConnections = associatedInboundConnections; + this.AssociatedOutboundConnections = associatedOutboundConnections; + this.Rules = rules; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of connections which have this RoutMap associated for + /// inbound traffic. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedInboundConnections")] + public System.Collections.Generic.IList AssociatedInboundConnections {get; set; } + + /// + /// Gets or sets list of connections which have this RoutMap associated for + /// outbound traffic. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedOutboundConnections")] + public System.Collections.Generic.IList AssociatedOutboundConnections {get; set; } + + /// + /// Gets or sets list of RouteMap rules to be applied. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } + + /// + /// Gets the provisioning state of the RouteMap resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapRule.cs index 7ca426f4609a..93b77ca588ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteMapRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteMapRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,21 +23,26 @@ public RouteMapRule() /// /// Initializes a new instance of the RouteMapRule class. /// - /// The unique name for the rule. - /// List of matching criterion which will - /// be applied to traffic. - /// List of actions which will be applied on a - /// match. - /// Next step after rule is evaluated. - /// Current supported behaviors are 'Continue'(to next rule) and - /// 'Terminate'. Possible values include: 'Unknown', 'Continue', - /// 'Terminate' - public RouteMapRule(string name = default(string), IList matchCriteria = default(IList), IList actions = default(IList), string nextStepIfMatched = default(string)) + + /// The unique name for the rule. + /// + + /// List of matching criterion which will be applied to traffic. + /// + + /// List of actions which will be applied on a match. + /// + + /// Next step after rule is evaluated. Current supported behaviors are + /// 'Continue'(to next rule) and 'Terminate'. + /// Possible values include: 'Unknown', 'Continue', 'Terminate' + public RouteMapRule(string name = default(string), System.Collections.Generic.IList matchCriteria = default(System.Collections.Generic.IList), System.Collections.Generic.IList actions = default(System.Collections.Generic.IList), string nextStepIfMatched = default(string)) + { - Name = name; - MatchCriteria = matchCriteria; - Actions = actions; - NextStepIfMatched = nextStepIfMatched; + this.Name = name; + this.MatchCriteria = matchCriteria; + this.Actions = actions; + this.NextStepIfMatched = nextStepIfMatched; CustomInit(); } @@ -54,32 +51,30 @@ public RouteMapRule() /// partial void CustomInit(); + /// /// Gets or sets the unique name for the rule. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets list of matching criterion which will be applied to - /// traffic. + /// Gets or sets list of matching criterion which will be applied to traffic. /// - [JsonProperty(PropertyName = "matchCriteria")] - public IList MatchCriteria { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchCriteria")] + public System.Collections.Generic.IList MatchCriteria {get; set; } /// /// Gets or sets list of actions which will be applied on a match. /// - [JsonProperty(PropertyName = "actions")] - public IList Actions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actions")] + public System.Collections.Generic.IList Actions {get; set; } /// - /// Gets or sets next step after rule is evaluated. Current supported - /// behaviors are 'Continue'(to next rule) and 'Terminate'. Possible - /// values include: 'Unknown', 'Continue', 'Terminate' + /// Gets or sets next step after rule is evaluated. Current supported behaviors + /// are 'Continue'(to next rule) and 'Terminate'. Possible values include: 'Unknown', 'Continue', 'Terminate' /// - [JsonProperty(PropertyName = "nextStepIfMatched")] - public string NextStepIfMatched { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextStepIfMatched")] + public string NextStepIfMatched {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteNextHopType.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteNextHopType.cs index 4cdbece99b0e..3e543f71699b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteNextHopType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteNextHopType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for RouteNextHopType. /// + + public static class RouteNextHopType { public const string VirtualNetworkGateway = "VirtualNetworkGateway"; @@ -22,4 +19,4 @@ public static class RouteNextHopType public const string VirtualAppliance = "VirtualAppliance"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RoutePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/RoutePropertiesFormat.cs new file mode 100644 index 000000000000..a272cb4a5da5 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RoutePropertiesFormat.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Route resource. + /// + public partial class RoutePropertiesFormat + { + /// + /// Initializes a new instance of the RoutePropertiesFormat class. + /// + public RoutePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoutePropertiesFormat class. + /// + + /// The destination CIDR to which the route applies. + /// + + /// The type of Azure hop the packet should be sent to. + /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' + + /// The IP address packets should be forwarded to. Next hop values are only + /// allowed in routes where the next hop type is VirtualAppliance. + /// + + /// The provisioning state of the route resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A value indicating whether this route overrides overlapping BGP routes + /// regardless of LPM. + /// + public RoutePropertiesFormat(string nextHopType, string addressPrefix = default(string), string nextHopIPAddress = default(string), string provisioningState = default(string), bool? hasBgpOverride = default(bool?)) + + { + this.AddressPrefix = addressPrefix; + this.NextHopType = nextHopType; + this.NextHopIPAddress = nextHopIPAddress; + this.ProvisioningState = provisioningState; + this.HasBgpOverride = hasBgpOverride; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the destination CIDR to which the route applies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } + + /// + /// Gets or sets the type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + public string NextHopType {get; set; } + + /// + /// Gets or sets the IP address packets should be forwarded to. Next hop values + /// are only allowed in routes where the next hop type is VirtualAppliance. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] + public string NextHopIPAddress {get; set; } + + /// + /// Gets the provisioning state of the route resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets a value indicating whether this route overrides overlapping + /// BGP routes regardless of LPM. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hasBgpOverride")] + public bool? HasBgpOverride {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.NextHopType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NextHopType"); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteTable.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteTable.cs index f0ada7be7d6d..e8800494f67d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RouteTable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteTable.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Route table resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RouteTable : Resource { /// @@ -34,34 +24,50 @@ public RouteTable() /// /// Initializes a new instance of the RouteTable class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Collection of routes contained within a route - /// table. - /// A collection of references to - /// subnets. - /// Whether to disable the - /// routes learned by BGP on that route table. True means - /// disable. - /// The provisioning state of the route - /// table resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The resource GUID property of the route - /// table. - /// A unique read-only string that changes whenever - /// the resource is updated. - public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList routes = default(IList), IList subnets = default(IList), bool? disableBgpRoutePropagation = default(bool?), string provisioningState = default(string), string resourceGuid = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the route table resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Collection of routes contained within a route table. + /// + + /// A collection of references to subnets. + /// + + /// Whether to disable the routes learned by BGP on that route table. True + /// means disable. + /// + + /// The resource GUID property of the route table. + /// + public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), bool? disableBgpRoutePropagation = default(bool?), string resourceGuid = default(string)) + + : base(id, name, type, location, tags) { - Routes = routes; - Subnets = subnets; - DisableBgpRoutePropagation = disableBgpRoutePropagation; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Routes = routes; + this.Subnets = subnets; + this.DisableBgpRoutePropagation = disableBgpRoutePropagation; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -70,44 +76,43 @@ public RouteTable() /// partial void CustomInit(); + /// - /// Gets or sets collection of routes contained within a route table. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.routes")] - public IList Routes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets a collection of references to subnets. + /// Gets the provisioning state of the route table resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets whether to disable the routes learned by BGP on that - /// route table. True means disable. + /// Gets or sets collection of routes contained within a route table. /// - [JsonProperty(PropertyName = "properties.disableBgpRoutePropagation")] - public bool? DisableBgpRoutePropagation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routes")] + public System.Collections.Generic.IList Routes {get; set; } /// - /// Gets the provisioning state of the route table resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets a collection of references to subnets. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } /// - /// Gets the resource GUID property of the route table. + /// Gets or sets whether to disable the routes learned by BGP on that route + /// table. True means disable. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableBgpRoutePropagation")] + public bool? DisableBgpRoutePropagation {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the resource GUID property of the route table. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RouteTablePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/RouteTablePropertiesFormat.cs new file mode 100644 index 000000000000..dea05bafb978 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RouteTablePropertiesFormat.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Route Table resource. + /// + public partial class RouteTablePropertiesFormat + { + /// + /// Initializes a new instance of the RouteTablePropertiesFormat class. + /// + public RouteTablePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RouteTablePropertiesFormat class. + /// + + /// Collection of routes contained within a route table. + /// + + /// A collection of references to subnets. + /// + + /// Whether to disable the routes learned by BGP on that route table. True + /// means disable. + /// + + /// The provisioning state of the route table resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The resource GUID property of the route table. + /// + public RouteTablePropertiesFormat(System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), bool? disableBgpRoutePropagation = default(bool?), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Routes = routes; + this.Subnets = subnets; + this.DisableBgpRoutePropagation = disableBgpRoutePropagation; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets collection of routes contained within a route table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routes")] + public System.Collections.Generic.IList Routes {get; set; } + + /// + /// Gets a collection of references to subnets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } + + /// + /// Gets or sets whether to disable the routes learned by BGP on that route + /// table. True means disable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableBgpRoutePropagation")] + public bool? DisableBgpRoutePropagation {get; set; } + + /// + /// Gets the provisioning state of the route table resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the resource GUID property of the route table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RoutingConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/RoutingConfiguration.cs index b951b36441f5..e3fe006e8545 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RoutingConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RoutingConfiguration.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Routing Configuration indicating the associated and propagated route - /// tables for this connection. + /// Routing Configuration indicating the associated and propagated route tables + /// for this connection. /// public partial class RoutingConfiguration { @@ -30,25 +24,32 @@ public RoutingConfiguration() /// /// Initializes a new instance of the RoutingConfiguration class. /// - /// The resource id RouteTable - /// associated with this RoutingConfiguration. - /// The list of RouteTables to - /// advertise the routes to. - /// List of routes that control routing from - /// VirtualHub into a virtual network connection. - /// The resource id of the RouteMap - /// associated with this RoutingConfiguration for inbound learned - /// routes. - /// The resource id of theRouteMap - /// associated with this RoutingConfiguration for outbound advertised - /// routes. + + /// The resource id RouteTable associated with this RoutingConfiguration. + /// + + /// The list of RouteTables to advertise the routes to. + /// + + /// List of routes that control routing from VirtualHub into a virtual network + /// connection. + /// + + /// The resource id of the RouteMap associated with this RoutingConfiguration + /// for inbound learned routes. + /// + + /// The resource id of theRouteMap associated with this RoutingConfiguration + /// for outbound advertised routes. + /// public RoutingConfiguration(SubResource associatedRouteTable = default(SubResource), PropagatedRouteTable propagatedRouteTables = default(PropagatedRouteTable), VnetRoute vnetRoutes = default(VnetRoute), SubResource inboundRouteMap = default(SubResource), SubResource outboundRouteMap = default(SubResource)) + { - AssociatedRouteTable = associatedRouteTable; - PropagatedRouteTables = propagatedRouteTables; - VnetRoutes = vnetRoutes; - InboundRouteMap = inboundRouteMap; - OutboundRouteMap = outboundRouteMap; + this.AssociatedRouteTable = associatedRouteTable; + this.PropagatedRouteTables = propagatedRouteTables; + this.VnetRoutes = vnetRoutes; + this.InboundRouteMap = inboundRouteMap; + this.OutboundRouteMap = outboundRouteMap; CustomInit(); } @@ -57,39 +58,39 @@ public RoutingConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the resource id RouteTable associated with this /// RoutingConfiguration. /// - [JsonProperty(PropertyName = "associatedRouteTable")] - public SubResource AssociatedRouteTable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedRouteTable")] + public SubResource AssociatedRouteTable {get; set; } /// /// Gets or sets the list of RouteTables to advertise the routes to. /// - [JsonProperty(PropertyName = "propagatedRouteTables")] - public PropagatedRouteTable PropagatedRouteTables { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "propagatedRouteTables")] + public PropagatedRouteTable PropagatedRouteTables {get; set; } /// - /// Gets or sets list of routes that control routing from VirtualHub - /// into a virtual network connection. + /// Gets or sets list of routes that control routing from VirtualHub into a + /// virtual network connection. /// - [JsonProperty(PropertyName = "vnetRoutes")] - public VnetRoute VnetRoutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vnetRoutes")] + public VnetRoute VnetRoutes {get; set; } /// /// Gets or sets the resource id of the RouteMap associated with this /// RoutingConfiguration for inbound learned routes. /// - [JsonProperty(PropertyName = "inboundRouteMap")] - public SubResource InboundRouteMap { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundRouteMap")] + public SubResource InboundRouteMap {get; set; } /// /// Gets or sets the resource id of theRouteMap associated with this /// RoutingConfiguration for outbound advertised routes. /// - [JsonProperty(PropertyName = "outboundRouteMap")] - public SubResource OutboundRouteMap { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "outboundRouteMap")] + public SubResource OutboundRouteMap {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntent.cs b/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntent.cs index d2fc20ccf3ac..d762cb1be363 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntent.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntent.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The routing intent child resource of a Virtual hub. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RoutingIntent : SubResource { /// @@ -34,25 +24,34 @@ public RoutingIntent() /// /// Initializes a new instance of the RoutingIntent class. /// - /// Resource ID. - /// List of routing policies. - /// The provisioning state of the - /// RoutingIntent resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public RoutingIntent(string id = default(string), IList routingPolicies = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the RoutingIntent resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of routing policies. + /// + public RoutingIntent(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), System.Collections.Generic.IList routingPolicies = default(System.Collections.Generic.IList)) + + : base(id) { - RoutingPolicies = routingPolicies; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.RoutingPolicies = routingPolicies; CustomInit(); } @@ -61,38 +60,37 @@ public RoutingIntent() /// partial void CustomInit(); + /// - /// Gets or sets list of routing policies. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.routingPolicies")] - public IList RoutingPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the RoutingIntent resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets resource type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets the provisioning state of the RoutingIntent resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets resource type. + /// Gets or sets list of routing policies. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingPolicies")] + public System.Collections.Generic.IList RoutingPolicies {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntentProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntentProperties.cs new file mode 100644 index 000000000000..d49c89782a6d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/RoutingIntentProperties.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// The properties of a RoutingIntent resource. + /// + public partial class RoutingIntentProperties + { + /// + /// Initializes a new instance of the RoutingIntentProperties class. + /// + public RoutingIntentProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoutingIntentProperties class. + /// + + /// List of routing policies. + /// + + /// The provisioning state of the RoutingIntent resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public RoutingIntentProperties(System.Collections.Generic.IList routingPolicies = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.RoutingPolicies = routingPolicies; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of routing policies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingPolicies")] + public System.Collections.Generic.IList RoutingPolicies {get; set; } + + /// + /// Gets the provisioning state of the RoutingIntent resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RoutingPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/RoutingPolicy.cs index e6842bd8f2ab..e94232c83912 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RoutingPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RoutingPolicy.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,17 +23,22 @@ public RoutingPolicy() /// /// Initializes a new instance of the RoutingPolicy class. /// - /// The unique name for the routing policy. - /// List of all destinations which this - /// routing policy is applicable to (for example: Internet, - /// PrivateTraffic). - /// The next hop resource id on which this - /// routing policy is applicable to. - public RoutingPolicy(string name, IList destinations, string nextHop) + + /// The unique name for the routing policy. + /// + + /// List of all destinations which this routing policy is applicable to (for + /// example: Internet, PrivateTraffic). + /// + + /// The next hop resource id on which this routing policy is applicable to. + /// + public RoutingPolicy(string name, System.Collections.Generic.IList destinations, string nextHop) + { - Name = name; - Destinations = destinations; - NextHop = nextHop; + this.Name = name; + this.Destinations = destinations; + this.NextHop = nextHop; CustomInit(); } @@ -51,46 +47,49 @@ public RoutingPolicy(string name, IList destinations, string nextHop) /// partial void CustomInit(); + /// /// Gets or sets the unique name for the routing policy. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets list of all destinations which this routing policy is /// applicable to (for example: Internet, PrivateTraffic). /// - [JsonProperty(PropertyName = "destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// - /// Gets or sets the next hop resource id on which this routing policy - /// is applicable to. + /// Gets or sets the next hop resource id on which this routing policy is + /// applicable to. /// - [JsonProperty(PropertyName = "nextHop")] - public string NextHop { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] + public string NextHop {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Destinations == null) + if (this.Destinations == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Destinations"); } - if (NextHop == null) + if (this.NextHop == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NextHop"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NextHop"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/RoutingState.cs b/src/Network/Network.Management.Sdk/Generated/Models/RoutingState.cs index 1f0f98182636..7df6993a7911 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/RoutingState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/RoutingState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for RoutingState. /// + + public static class RoutingState { public const string None = "None"; @@ -21,4 +18,4 @@ public static class RoutingState public const string Provisioning = "Provisioning"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnection.cs index 393f82ab2f7b..532dedadce70 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnection.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The Scope Connections resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ScopeConnection : ChildResource { /// @@ -32,28 +24,43 @@ public ScopeConnection() /// /// Initializes a new instance of the ScopeConnection class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Tenant ID. - /// Resource ID. - /// Connection State. Possible values - /// include: 'Connected', 'Pending', 'Conflict', 'Revoked', - /// 'Rejected' - /// A description of the scope - /// connection. - /// The system metadata related to this - /// resource. - public ScopeConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), string resourceId = default(string), string connectionState = default(string), string description = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// Tenant ID. + /// + + /// Resource ID. + /// + + /// Connection State + /// Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', + /// 'Rejected' + + /// A description of the scope connection. + /// + public ScopeConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string tenantId = default(string), string resourceId = default(string), string connectionState = default(string), string description = default(string)) + + : base(id, name, type, etag) { - TenantId = tenantId; - ResourceId = resourceId; - ConnectionState = connectionState; - Description = description; - SystemData = systemData; + this.SystemData = systemData; + this.TenantId = tenantId; + this.ResourceId = resourceId; + this.ConnectionState = connectionState; + this.Description = description; CustomInit(); } @@ -62,36 +69,35 @@ public ScopeConnection() /// partial void CustomInit(); + /// - /// Gets or sets tenant ID. + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets or sets resource ID. + /// Gets or sets tenant ID. /// - [JsonProperty(PropertyName = "properties.resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tenantId")] + public string TenantId {get; set; } /// - /// Gets or sets connection State. Possible values include: - /// 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' + /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "properties.connectionState")] - public string ConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets a description of the scope connection. + /// Gets connection State Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionState")] + public string ConnectionState {get; private set; } /// - /// Gets the system metadata related to this resource. + /// Gets or sets a description of the scope connection. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionProperties.cs new file mode 100644 index 000000000000..67d34278a752 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionProperties.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Scope connection. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ScopeConnectionProperties + { + /// + /// Initializes a new instance of the ScopeConnectionProperties class. + /// + public ScopeConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScopeConnectionProperties class. + /// + + /// Tenant ID. + /// + + /// Resource ID. + /// + + /// Connection State + /// Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', + /// 'Rejected' + + /// A description of the scope connection. + /// + public ScopeConnectionProperties(string tenantId = default(string), string resourceId = default(string), string connectionState = default(string), string description = default(string)) + + { + this.TenantId = tenantId; + this.ResourceId = resourceId; + this.ConnectionState = connectionState; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets tenant ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; set; } + + /// + /// Gets or sets resource ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets connection State Possible values include: 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionState")] + public string ConnectionState {get; private set; } + + /// + /// Gets or sets a description of the scope connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionState.cs index 38ef04fb959b..92d21798f73d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ScopeConnectionState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ScopeConnectionState. /// + + public static class ScopeConnectionState { public const string Connected = "Connected"; @@ -22,4 +19,4 @@ public static class ScopeConnectionState public const string Revoked = "Revoked"; public const string Rejected = "Rejected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchOperator.cs b/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchOperator.cs index 6ef893c9bb23..3a2c6702a8f5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchOperator.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchOperator.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ScrubbingRuleEntryMatchOperator. /// + + public static class ScrubbingRuleEntryMatchOperator { public const string Equals = "Equals"; public const string EqualsAny = "EqualsAny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchVariable.cs b/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchVariable.cs index 34fd926f5f4b..f3f287bb5cb3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchVariable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryMatchVariable.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,13 +9,15 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ScrubbingRuleEntryMatchVariable. /// + + public static class ScrubbingRuleEntryMatchVariable { public const string RequestHeaderNames = "RequestHeaderNames"; public const string RequestCookieNames = "RequestCookieNames"; public const string RequestArgNames = "RequestArgNames"; public const string RequestPostArgNames = "RequestPostArgNames"; - public const string RequestJSONArgNames = "RequestJSONArgNames"; + public const string RequestJsonArgNames = "RequestJSONArgNames"; public const string RequestIPAddress = "RequestIPAddress"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryState.cs index 339ab4af2c09..4114e9d4179c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ScrubbingRuleEntryState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ScrubbingRuleEntryState. /// + + public static class ScrubbingRuleEntryState { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfiguration.cs index 51eb29d558d8..1ce4a312b295 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfiguration.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Defines the security admin configuration /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SecurityAdminConfiguration : ChildResource { /// @@ -34,30 +24,42 @@ public SecurityAdminConfiguration() /// /// Initializes a new instance of the SecurityAdminConfiguration class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A description of the security - /// configuration. - /// Enum list of - /// network intent policy based services. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Unique identifier for this - /// resource. - /// The system metadata related to this - /// resource. - public SecurityAdminConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), IList applyOnNetworkIntentPolicyBasedServices = default(IList), string provisioningState = default(string), string resourceGuid = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description of the security configuration. + /// + + /// Enum list of network intent policy based services. + /// + + /// Unique identifier for this resource. + /// + public SecurityAdminConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), System.Collections.Generic.IList applyOnNetworkIntentPolicyBasedServices = default(System.Collections.Generic.IList), string resourceGuid = default(string)) + + : base(id, name, type, etag) { - Description = description; - ApplyOnNetworkIntentPolicyBasedServices = applyOnNetworkIntentPolicyBasedServices; - ProvisioningState = provisioningState; - ResourceGuid = resourceGuid; - SystemData = systemData; + this.SystemData = systemData; + this.ProvisioningState = provisioningState; + this.Description = description; + this.ApplyOnNetworkIntentPolicyBasedServices = applyOnNetworkIntentPolicyBasedServices; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -66,36 +68,35 @@ public SecurityAdminConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets a description of the security configuration. + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets or sets enum list of network intent policy based services. + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.applyOnNetworkIntentPolicyBasedServices")] - public IList ApplyOnNetworkIntentPolicyBasedServices { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets a description of the security configuration. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets unique identifier for this resource. + /// Gets or sets enum list of network intent policy based services. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applyOnNetworkIntentPolicyBasedServices")] + public System.Collections.Generic.IList ApplyOnNetworkIntentPolicyBasedServices {get; set; } /// - /// Gets the system metadata related to this resource. + /// Gets unique identifier for this resource. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..206fc869c6ed --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationPropertiesFormat.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Defines the security admin configuration properties. + /// + public partial class SecurityAdminConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the SecurityAdminConfigurationPropertiesFormat class. + /// + public SecurityAdminConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityAdminConfigurationPropertiesFormat class. + /// + + /// A description of the security configuration. + /// + + /// Enum list of network intent policy based services. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Unique identifier for this resource. + /// + public SecurityAdminConfigurationPropertiesFormat(string description = default(string), System.Collections.Generic.IList applyOnNetworkIntentPolicyBasedServices = default(System.Collections.Generic.IList), string provisioningState = default(string), string resourceGuid = default(string)) + + { + this.Description = description; + this.ApplyOnNetworkIntentPolicyBasedServices = applyOnNetworkIntentPolicyBasedServices; + this.ProvisioningState = provisioningState; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description of the security configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets enum list of network intent policy based services. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applyOnNetworkIntentPolicyBasedServices")] + public System.Collections.Generic.IList ApplyOnNetworkIntentPolicyBasedServices {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets unique identifier for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationsDeleteHeaders.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationsDeleteHeaders.cs index 4af57258105d..1d22be8a8446 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationsDeleteHeaders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityAdminConfigurationsDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class SecurityAdminConfigurationsDeleteHeaders { /// - /// Initializes a new instance of the - /// SecurityAdminConfigurationsDeleteHeaders class. + /// Initializes a new instance of the SecurityAdminConfigurationsDeleteHeaders class. /// public SecurityAdminConfigurationsDeleteHeaders() { @@ -28,14 +18,15 @@ public SecurityAdminConfigurationsDeleteHeaders() } /// - /// Initializes a new instance of the - /// SecurityAdminConfigurationsDeleteHeaders class. + /// Initializes a new instance of the SecurityAdminConfigurationsDeleteHeaders class. /// - /// The URL of the resource used to check the - /// status of the asynchronous operation. + + /// + /// public SecurityAdminConfigurationsDeleteHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -44,12 +35,11 @@ public SecurityAdminConfigurationsDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the URL of the resource used to check the status of - /// the asynchronous operation. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleAccess.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleAccess.cs index 8fa24ddae16e..9db306c7075d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleAccess.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleAccess.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityConfigurationRuleAccess. /// + + public static class SecurityConfigurationRuleAccess { public const string Allow = "Allow"; public const string Deny = "Deny"; public const string AlwaysAllow = "AlwaysAllow"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleDirection.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleDirection.cs index 266a50b5281a..1898d76251ce 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleDirection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleDirection.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityConfigurationRuleDirection. /// + + public static class SecurityConfigurationRuleDirection { public const string Inbound = "Inbound"; public const string Outbound = "Outbound"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleProtocol.cs index d4ca62c2e1b8..3c8fb7f42761 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityConfigurationRuleProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityConfigurationRuleProtocol. /// + + public static class SecurityConfigurationRuleProtocol { public const string Tcp = "Tcp"; @@ -23,4 +20,4 @@ public static class SecurityConfigurationRuleProtocol public const string Any = "Any"; public const string Ah = "Ah"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupNetworkInterface.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupNetworkInterface.cs index 630ff7635a94..bf09104e96fb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupNetworkInterface.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupNetworkInterface.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class SecurityGroupNetworkInterface { /// - /// Initializes a new instance of the SecurityGroupNetworkInterface - /// class. + /// Initializes a new instance of the SecurityGroupNetworkInterface class. /// public SecurityGroupNetworkInterface() { @@ -28,16 +21,19 @@ public SecurityGroupNetworkInterface() } /// - /// Initializes a new instance of the SecurityGroupNetworkInterface - /// class. + /// Initializes a new instance of the SecurityGroupNetworkInterface class. /// - /// ID of the network interface. - /// All security rules - /// associated with the network interface. + + /// ID of the network interface. + /// + + /// All security rules associated with the network interface. + /// public SecurityGroupNetworkInterface(string id = default(string), SecurityRuleAssociations securityRuleAssociations = default(SecurityRuleAssociations)) + { - Id = id; - SecurityRuleAssociations = securityRuleAssociations; + this.Id = id; + this.SecurityRuleAssociations = securityRuleAssociations; CustomInit(); } @@ -46,18 +42,17 @@ public SecurityGroupNetworkInterface() /// partial void CustomInit(); + /// - /// Gets or sets ID of the network interface. + /// Gets or sets iD of the network interface. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets all security rules associated with the network - /// interface. + /// Gets or sets all security rules associated with the network interface. /// - [JsonProperty(PropertyName = "securityRuleAssociations")] - public SecurityRuleAssociations SecurityRuleAssociations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityRuleAssociations")] + public SecurityRuleAssociations SecurityRuleAssociations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewParameters.cs index 9ded594ebfa7..650c6d9c4a4a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class SecurityGroupViewParameters { /// - /// Initializes a new instance of the SecurityGroupViewParameters - /// class. + /// Initializes a new instance of the SecurityGroupViewParameters class. /// public SecurityGroupViewParameters() { @@ -29,13 +21,15 @@ public SecurityGroupViewParameters() } /// - /// Initializes a new instance of the SecurityGroupViewParameters - /// class. + /// Initializes a new instance of the SecurityGroupViewParameters class. /// - /// ID of the target VM. + + /// ID of the target VM. + /// public SecurityGroupViewParameters(string targetResourceId) + { - TargetResourceId = targetResourceId; + this.TargetResourceId = targetResourceId; CustomInit(); } @@ -44,24 +38,25 @@ public SecurityGroupViewParameters(string targetResourceId) /// partial void CustomInit(); + /// - /// Gets or sets ID of the target VM. + /// Gets or sets iD of the target VM. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewResult.cs index 10578f98a23e..aca4ae263633 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityGroupViewResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,13 @@ public SecurityGroupViewResult() /// /// Initializes a new instance of the SecurityGroupViewResult class. /// - /// List of network interfaces on the - /// specified VM. - public SecurityGroupViewResult(IList networkInterfaces = default(IList)) + + /// List of network interfaces on the specified VM. + /// + public SecurityGroupViewResult(System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList)) + { - NetworkInterfaces = networkInterfaces; + this.NetworkInterfaces = networkInterfaces; CustomInit(); } @@ -44,11 +38,11 @@ public SecurityGroupViewResult() /// partial void CustomInit(); + /// /// Gets or sets list of network interfaces on the specified VM. /// - [JsonProperty(PropertyName = "networkInterfaces")] - public IList NetworkInterfaces { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProvider.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProvider.cs index 799dec8a16ff..892833d3d927 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProvider.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProvider.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Security Partner Provider resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SecurityPartnerProvider : Resource { /// @@ -34,31 +24,46 @@ public SecurityPartnerProvider() /// /// Initializes a new instance of the SecurityPartnerProvider class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The provisioning state of the - /// Security Partner Provider resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the Security Partner Provider resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// The security provider name. - /// Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' - /// The connection status with the - /// Security Partner Provider. Possible values include: 'Unknown', - /// 'PartiallyConnected', 'Connected', 'NotConnected' - /// The virtualHub to which the Security - /// Partner Provider belongs. - /// A unique read-only string that changes whenever - /// the resource is updated. - public SecurityPartnerProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string securityProviderName = default(string), string connectionStatus = default(string), SubResource virtualHub = default(SubResource), string etag = default(string)) - : base(id, name, type, location, tags) + /// Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' + + /// The connection status with the Security Partner Provider. + /// Possible values include: 'Unknown', 'PartiallyConnected', 'Connected', + /// 'NotConnected' + + /// The virtualHub to which the Security Partner Provider belongs. + /// + public SecurityPartnerProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string securityProviderName = default(string), string connectionStatus = default(string), SubResource virtualHub = default(SubResource)) + + : base(id, name, type, location, tags) { - ProvisioningState = provisioningState; - SecurityProviderName = securityProviderName; - ConnectionStatus = connectionStatus; - VirtualHub = virtualHub; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.SecurityProviderName = securityProviderName; + this.ConnectionStatus = connectionStatus; + this.VirtualHub = virtualHub; CustomInit(); } @@ -67,42 +72,36 @@ public SecurityPartnerProvider() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the Security Partner Provider - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the security provider name. Possible values include: - /// 'ZScaler', 'IBoss', 'Checkpoint' + /// Gets the provisioning state of the Security Partner Provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.securityProviderName")] - public string SecurityProviderName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the connection status with the Security Partner Provider. - /// Possible values include: 'Unknown', 'PartiallyConnected', - /// 'Connected', 'NotConnected' + /// Gets or sets the security provider name. Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' /// - [JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProviderName")] + public string SecurityProviderName {get; set; } /// - /// Gets or sets the virtualHub to which the Security Partner Provider - /// belongs. + /// Gets the connection status with the Security Partner Provider. Possible values include: 'Unknown', 'PartiallyConnected', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "properties.virtualHub")] - public SubResource VirtualHub { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] + public string ConnectionStatus {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the virtualHub to which the Security Partner Provider belongs. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHub")] + public SubResource VirtualHub {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderConnectionStatus.cs index 4f6ab4c0dd55..8018407c3048 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityPartnerProviderConnectionStatus. /// + + public static class SecurityPartnerProviderConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class SecurityPartnerProviderConnectionStatus public const string Connected = "Connected"; public const string NotConnected = "NotConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderPropertiesFormat.cs new file mode 100644 index 000000000000..e9740d7cdeb6 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityPartnerProviderPropertiesFormat.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the Security Partner Provider. + /// + public partial class SecurityPartnerProviderPropertiesFormat + { + /// + /// Initializes a new instance of the SecurityPartnerProviderPropertiesFormat class. + /// + public SecurityPartnerProviderPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityPartnerProviderPropertiesFormat class. + /// + + /// The provisioning state of the Security Partner Provider resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The security provider name. + /// Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' + + /// The connection status with the Security Partner Provider. + /// Possible values include: 'Unknown', 'PartiallyConnected', 'Connected', + /// 'NotConnected' + + /// The virtualHub to which the Security Partner Provider belongs. + /// + public SecurityPartnerProviderPropertiesFormat(string provisioningState = default(string), string securityProviderName = default(string), string connectionStatus = default(string), SubResource virtualHub = default(SubResource)) + + { + this.ProvisioningState = provisioningState; + this.SecurityProviderName = securityProviderName; + this.ConnectionStatus = connectionStatus; + this.VirtualHub = virtualHub; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the Security Partner Provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the security provider name. Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProviderName")] + public string SecurityProviderName {get; set; } + + /// + /// Gets the connection status with the Security Partner Provider. Possible values include: 'Unknown', 'PartiallyConnected', 'Connected', 'NotConnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } + + /// + /// Gets or sets the virtualHub to which the Security Partner Provider belongs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHub")] + public SubResource VirtualHub {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityProviderName.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityProviderName.cs index 974fa97cd0ec..1540510d4972 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityProviderName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityProviderName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityProviderName. /// + + public static class SecurityProviderName { public const string ZScaler = "ZScaler"; public const string IBoss = "IBoss"; public const string Checkpoint = "Checkpoint"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRule.cs index 670bd59cb479..572fc28a3773 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Network security rule. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SecurityRule : SubResource { /// @@ -34,78 +24,100 @@ public SecurityRule() /// /// Initializes a new instance of the SecurityRule class. /// + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The type of the resource. + /// + + /// The provisioning state of the security rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*', - /// 'Ah' + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*', 'Ah' + + /// The source port or range. Integer or range between 0 and 65535. Asterisk + /// '*' can also be used to match all ports. + /// + + /// The destination port or range. Integer or range between 0 and 65535. + /// Asterisk '*' can also be used to match all ports. + /// + + /// The CIDR or source IP range. Asterisk '*' 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. + /// + + /// The CIDR or source IP ranges. + /// + + /// The application security group specified as source. + /// + + /// The destination address prefix. CIDR or destination IP range. Asterisk '*' + /// can also be used to match all source IPs. Default tags such as + /// 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The application security group specified as destination. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + /// The network traffic is allowed or denied. - /// Possible values include: 'Allow', 'Deny' - /// 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. - /// The direction of the rule. The direction - /// specifies if rule will be evaluated on incoming or outgoing - /// traffic. Possible values include: 'Inbound', 'Outbound' - /// Resource ID. - /// A description for this rule. Restricted - /// to 140 chars. - /// The source port or range. Integer or - /// range between 0 and 65535. Asterisk '*' can also be used to match - /// all ports. - /// The destination port or range. - /// Integer or range between 0 and 65535. Asterisk '*' can also be used - /// to match all ports. - /// The CIDR or source IP range. - /// Asterisk '*' 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. - /// The CIDR or source IP - /// ranges. - /// The application - /// security group specified as source. - /// The destination address - /// prefix. CIDR or destination IP range. Asterisk '*' can also be used - /// to match all source IPs. Default tags such as 'VirtualNetwork', - /// 'AzureLoadBalancer' and 'Internet' can also be used. - /// The destination address - /// prefixes. CIDR or destination IP ranges. - /// The application - /// security group specified as destination. - /// The source port ranges. - /// The destination port - /// ranges. - /// The provisioning state of the - /// security rule resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The type of the resource. - public SecurityRule(string protocol, string access, int priority, string direction, string id = default(string), string description = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), IList sourceAddressPrefixes = default(IList), IList sourceApplicationSecurityGroups = default(IList), string destinationAddressPrefix = default(string), IList destinationAddressPrefixes = default(IList), IList destinationApplicationSecurityGroups = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Possible values include: 'Allow', 'Deny' + + /// 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. + /// + + /// The direction of the rule. The direction specifies if rule will be + /// evaluated on incoming or outgoing traffic. + /// Possible values include: 'Inbound', 'Outbound' + public SecurityRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string description = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), System.Collections.Generic.IList sourceAddressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceApplicationSecurityGroups = default(System.Collections.Generic.IList), string destinationAddressPrefix = default(string), System.Collections.Generic.IList destinationAddressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationApplicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string)) + + : base(id) { - Description = description; - Protocol = protocol; - SourcePortRange = sourcePortRange; - DestinationPortRange = destinationPortRange; - SourceAddressPrefix = sourceAddressPrefix; - SourceAddressPrefixes = sourceAddressPrefixes; - SourceApplicationSecurityGroups = sourceApplicationSecurityGroups; - DestinationAddressPrefix = destinationAddressPrefix; - DestinationAddressPrefixes = destinationAddressPrefixes; - DestinationApplicationSecurityGroups = destinationApplicationSecurityGroups; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Protocol = protocol; + this.SourcePortRange = sourcePortRange; + this.DestinationPortRange = destinationPortRange; + this.SourceAddressPrefix = sourceAddressPrefix; + this.SourceAddressPrefixes = sourceAddressPrefixes; + this.SourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + this.DestinationAddressPrefix = destinationAddressPrefix; + this.DestinationAddressPrefixes = destinationAddressPrefixes; + this.DestinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; CustomInit(); } @@ -114,162 +126,132 @@ public SecurityRule() /// partial void CustomInit(); - /// - /// Gets or sets a description for this rule. Restricted to 140 chars. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } /// - /// Gets or sets network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*', 'Ah' + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the source port or range. Integer or range between 0 - /// and 65535. Asterisk '*' can also be used to match all ports. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.sourcePortRange")] - public string SourcePortRange { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the destination port or range. Integer or range - /// between 0 and 65535. Asterisk '*' can also be used to match all - /// ports. + /// Gets or sets the type of the resource. /// - [JsonProperty(PropertyName = "properties.destinationPortRange")] - public string DestinationPortRange { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets the CIDR or source IP range. Asterisk '*' 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. + /// Gets the provisioning state of the security rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.sourceAddressPrefix")] - public string SourceAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the CIDR or source IP ranges. + /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.sourceAddressPrefixes")] - public IList SourceAddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the application security group specified as source. + /// Gets or sets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*', 'Ah' /// - [JsonProperty(PropertyName = "properties.sourceApplicationSecurityGroups")] - public IList SourceApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + public string Protocol {get; set; } /// - /// Gets or sets the destination address prefix. CIDR or destination IP - /// range. Asterisk '*' can also be used to match all source IPs. - /// Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and - /// 'Internet' can also be used. + /// Gets or sets the source port or range. Integer or range between 0 and + /// 65535. Asterisk '*' can also be used to match all ports. /// - [JsonProperty(PropertyName = "properties.destinationAddressPrefix")] - public string DestinationAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRange")] + public string SourcePortRange {get; set; } /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. + /// Gets or sets the destination port or range. Integer or range between 0 and + /// 65535. Asterisk '*' can also be used to match all ports. /// - [JsonProperty(PropertyName = "properties.destinationAddressPrefixes")] - public IList DestinationAddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRange")] + public string DestinationPortRange {get; set; } /// - /// Gets or sets the application security group specified as - /// destination. + /// Gets or sets the CIDR or source IP range. Asterisk '*' 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. /// - [JsonProperty(PropertyName = "properties.destinationApplicationSecurityGroups")] - public IList DestinationApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceAddressPrefix")] + public string SourceAddressPrefix {get; set; } /// - /// Gets or sets the source port ranges. + /// Gets or sets the CIDR or source IP ranges. /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceAddressPrefixes")] + public System.Collections.Generic.IList SourceAddressPrefixes {get; set; } /// - /// Gets or sets the destination port ranges. + /// Gets or sets the application security group specified as source. /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceApplicationSecurityGroups")] + public System.Collections.Generic.IList SourceApplicationSecurityGroups {get; set; } /// - /// Gets or sets the network traffic is allowed or denied. Possible - /// values include: 'Allow', 'Deny' + /// Gets or sets the destination address prefix. CIDR or destination IP range. + /// Asterisk '*' can also be used to match all source IPs. Default tags such as + /// 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. /// - [JsonProperty(PropertyName = "properties.access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationAddressPrefix")] + public string DestinationAddressPrefix {get; set; } /// - /// Gets or sets 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. + /// Gets or sets the destination address prefixes. CIDR or destination IP + /// ranges. /// - [JsonProperty(PropertyName = "properties.priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationAddressPrefixes")] + public System.Collections.Generic.IList DestinationAddressPrefixes {get; set; } /// - /// Gets or sets the direction of the rule. The direction specifies if - /// rule will be evaluated on incoming or outgoing traffic. Possible - /// values include: 'Inbound', 'Outbound' + /// Gets or sets the application security group specified as destination. /// - [JsonProperty(PropertyName = "properties.direction")] - public string Direction { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationApplicationSecurityGroups")] + public System.Collections.Generic.IList DestinationApplicationSecurityGroups {get; set; } /// - /// Gets the provisioning state of the security rule resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the source port ranges. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the destination port ranges. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + public string Access {get; set; } /// - /// Gets or sets the type of the resource. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Validate the object. + /// Gets or sets the direction of the rule. The direction specifies if rule + /// will be evaluated on incoming or outgoing traffic. Possible values include: 'Inbound', 'Outbound' /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - if (Access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); - } - if (Direction == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + public string Direction {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAccess.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAccess.cs index fd6178cc3b80..3d6c0bf035e6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAccess.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAccess.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityRuleAccess. /// + + public static class SecurityRuleAccess { public const string Allow = "Allow"; public const string Deny = "Deny"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAssociations.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAssociations.cs index 4c1cdf2b4669..a6caff74b249 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAssociations.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleAssociations.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,20 +23,25 @@ public SecurityRuleAssociations() /// /// Initializes a new instance of the SecurityRuleAssociations class. /// - /// Network interface and - /// it's custom security rules. - /// Subnet and it's custom security - /// rules. - /// Collection of default security - /// rules of the network security group. - /// Collection of effective - /// security rules. - public SecurityRuleAssociations(NetworkInterfaceAssociation networkInterfaceAssociation = default(NetworkInterfaceAssociation), SubnetAssociation subnetAssociation = default(SubnetAssociation), IList defaultSecurityRules = default(IList), IList effectiveSecurityRules = default(IList)) + + /// Network interface and it's custom security rules. + /// + + /// Subnet and it's custom security rules. + /// + + /// Collection of default security rules of the network security group. + /// + + /// Collection of effective security rules. + /// + public SecurityRuleAssociations(NetworkInterfaceAssociation networkInterfaceAssociation = default(NetworkInterfaceAssociation), SubnetAssociation subnetAssociation = default(SubnetAssociation), System.Collections.Generic.IList defaultSecurityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList effectiveSecurityRules = default(System.Collections.Generic.IList)) + { - NetworkInterfaceAssociation = networkInterfaceAssociation; - SubnetAssociation = subnetAssociation; - DefaultSecurityRules = defaultSecurityRules; - EffectiveSecurityRules = effectiveSecurityRules; + this.NetworkInterfaceAssociation = networkInterfaceAssociation; + this.SubnetAssociation = subnetAssociation; + this.DefaultSecurityRules = defaultSecurityRules; + this.EffectiveSecurityRules = effectiveSecurityRules; CustomInit(); } @@ -53,30 +50,30 @@ public SecurityRuleAssociations() /// partial void CustomInit(); + /// - /// Gets or sets network interface and it's custom security rules. + /// Gets or sets network interface and it's custom security rules. /// - [JsonProperty(PropertyName = "networkInterfaceAssociation")] - public NetworkInterfaceAssociation NetworkInterfaceAssociation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceAssociation")] + public NetworkInterfaceAssociation NetworkInterfaceAssociation {get; set; } /// - /// Gets or sets subnet and it's custom security rules. + /// Gets or sets subnet and it's custom security rules. /// - [JsonProperty(PropertyName = "subnetAssociation")] - public SubnetAssociation SubnetAssociation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetAssociation")] + public SubnetAssociation SubnetAssociation {get; set; } /// - /// Gets or sets collection of default security rules of the network - /// security group. + /// Gets or sets collection of default security rules of the network security + /// group. /// - [JsonProperty(PropertyName = "defaultSecurityRules")] - public IList DefaultSecurityRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultSecurityRules")] + public System.Collections.Generic.IList DefaultSecurityRules {get; set; } /// /// Gets or sets collection of effective security rules. /// - [JsonProperty(PropertyName = "effectiveSecurityRules")] - public IList EffectiveSecurityRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "effectiveSecurityRules")] + public System.Collections.Generic.IList EffectiveSecurityRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleDirection.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleDirection.cs index 3f96b8c6de2e..6c2c3f3269bf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleDirection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleDirection.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityRuleDirection. /// + + public static class SecurityRuleDirection { public const string Inbound = "Inbound"; public const string Outbound = "Outbound"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRulePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRulePropertiesFormat.cs new file mode 100644 index 000000000000..b2c8986f7093 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRulePropertiesFormat.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Security rule resource. + /// + public partial class SecurityRulePropertiesFormat + { + /// + /// Initializes a new instance of the SecurityRulePropertiesFormat class. + /// + public SecurityRulePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityRulePropertiesFormat class. + /// + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*', 'Ah' + + /// The source port or range. Integer or range between 0 and 65535. Asterisk + /// '*' can also be used to match all ports. + /// + + /// The destination port or range. Integer or range between 0 and 65535. + /// Asterisk '*' can also be used to match all ports. + /// + + /// The CIDR or source IP range. Asterisk '*' 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. + /// + + /// The CIDR or source IP ranges. + /// + + /// The application security group specified as source. + /// + + /// The destination address prefix. CIDR or destination IP range. Asterisk '*' + /// can also be used to match all source IPs. Default tags such as + /// 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + /// + + /// The destination address prefixes. CIDR or destination IP ranges. + /// + + /// The application security group specified as destination. + /// + + /// The source port ranges. + /// + + /// The destination port ranges. + /// + + /// The network traffic is allowed or denied. + /// Possible values include: 'Allow', 'Deny' + + /// 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. + /// + + /// The direction of the rule. The direction specifies if rule will be + /// evaluated on incoming or outgoing traffic. + /// Possible values include: 'Inbound', 'Outbound' + + /// The provisioning state of the security rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public SecurityRulePropertiesFormat(string protocol, string access, int priority, string direction, string description = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), System.Collections.Generic.IList sourceAddressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourceApplicationSecurityGroups = default(System.Collections.Generic.IList), string destinationAddressPrefix = default(string), System.Collections.Generic.IList destinationAddressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationApplicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList sourcePortRanges = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPortRanges = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Description = description; + this.Protocol = protocol; + this.SourcePortRange = sourcePortRange; + this.DestinationPortRange = destinationPortRange; + this.SourceAddressPrefix = sourceAddressPrefix; + this.SourceAddressPrefixes = sourceAddressPrefixes; + this.SourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + this.DestinationAddressPrefix = destinationAddressPrefix; + this.DestinationAddressPrefixes = destinationAddressPrefixes; + this.DestinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + this.SourcePortRanges = sourcePortRanges; + this.DestinationPortRanges = destinationPortRanges; + this.Access = access; + this.Priority = priority; + this.Direction = direction; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*', 'Ah' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } + + /// + /// Gets or sets the source port or range. Integer or range between 0 and + /// 65535. Asterisk '*' can also be used to match all ports. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRange")] + public string SourcePortRange {get; set; } + + /// + /// Gets or sets the destination port or range. Integer or range between 0 and + /// 65535. Asterisk '*' can also be used to match all ports. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRange")] + public string DestinationPortRange {get; set; } + + /// + /// Gets or sets the CIDR or source IP range. Asterisk '*' 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefix")] + public string SourceAddressPrefix {get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefixes")] + public System.Collections.Generic.IList SourceAddressPrefixes {get; set; } + + /// + /// Gets or sets the application security group specified as source. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceApplicationSecurityGroups")] + public System.Collections.Generic.IList SourceApplicationSecurityGroups {get; set; } + + /// + /// Gets or sets the destination address prefix. CIDR or destination IP range. + /// Asterisk '*' can also be used to match all source IPs. Default tags such as + /// 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddressPrefix")] + public string DestinationAddressPrefix {get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddressPrefixes")] + public System.Collections.Generic.IList DestinationAddressPrefixes {get; set; } + + /// + /// Gets or sets the application security group specified as destination. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationApplicationSecurityGroups")] + public System.Collections.Generic.IList DestinationApplicationSecurityGroups {get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRanges")] + public System.Collections.Generic.IList SourcePortRanges {get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRanges")] + public System.Collections.Generic.IList DestinationPortRanges {get; set; } + + /// + /// Gets or sets the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int Priority {get; set; } + + /// + /// Gets or sets the direction of the rule. The direction specifies if rule + /// will be evaluated on incoming or outgoing traffic. Possible values include: 'Inbound', 'Outbound' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public string Direction {get; set; } + + /// + /// Gets the provisioning state of the security rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Protocol == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + } + if (this.Access == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Access"); + } + if (this.Direction == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Direction"); + } + + + + + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleProtocol.cs index 5a007b97e9f2..4398ff5ee4ea 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SecurityRuleProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SecurityRuleProtocol. /// + + public static class SecurityRuleProtocol { public const string Tcp = "Tcp"; @@ -23,4 +20,4 @@ public static class SecurityRuleProtocol public const string Asterisk = "*"; public const string Ah = "Ah"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLink.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLink.cs index 336ce9e5571c..075d8dc3c37c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLink.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLink.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// ServiceAssociationLink resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ServiceAssociationLink : SubResource { /// @@ -34,33 +24,46 @@ public ServiceAssociationLink() /// /// Initializes a new instance of the ServiceAssociationLink class. /// - /// Resource ID. - /// Resource type of the linked - /// resource. - /// Link to the external resource. - /// The provisioning state of the - /// service association link resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// If true, the resource can be - /// deleted. - /// A list of locations. - /// Name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public ServiceAssociationLink(string id = default(string), string linkedResourceType = default(string), string link = default(string), string provisioningState = default(string), bool? allowDelete = default(bool?), IList locations = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the resource that is unique within a resource group. This name can + /// be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the service association link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Resource type of the linked resource. + /// + + /// Link to the external resource. + /// + + /// If true, the resource can be deleted. + /// + + /// A list of locations. + /// + public ServiceAssociationLink(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string linkedResourceType = default(string), string link = default(string), bool? allowDelete = default(bool?), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList)) + + : base(id) { - LinkedResourceType = linkedResourceType; - Link = link; - ProvisioningState = provisioningState; - AllowDelete = allowDelete; - Locations = locations; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.LinkedResourceType = linkedResourceType; + this.Link = link; + this.AllowDelete = allowDelete; + this.Locations = locations; CustomInit(); } @@ -69,57 +72,55 @@ public ServiceAssociationLink() /// partial void CustomInit(); + /// - /// Gets or sets resource type of the linked resource. + /// Gets or sets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.linkedResourceType")] - public string LinkedResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets link to the external resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.link")] - public string Link { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the service association link - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets if true, the resource can be deleted. + /// Gets the provisioning state of the service association link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.allowDelete")] - public bool? AllowDelete { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets a list of locations. + /// Gets or sets resource type of the linked resource. /// - [JsonProperty(PropertyName = "properties.locations")] - public IList Locations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkedResourceType")] + public string LinkedResourceType {get; set; } /// - /// Gets or sets name of the resource that is unique within a resource - /// group. This name can be used to access the resource. + /// Gets or sets link to the external resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.link")] + public string Link {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets if true, the resource can be deleted. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowDelete")] + public bool? AllowDelete {get; set; } /// - /// Gets resource type. + /// Gets or sets a list of locations. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] + public System.Collections.Generic.IList Locations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinkPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinkPropertiesFormat.cs new file mode 100644 index 000000000000..e11f71dfa85e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinkPropertiesFormat.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of ServiceAssociationLink. + /// + public partial class ServiceAssociationLinkPropertiesFormat + { + /// + /// Initializes a new instance of the ServiceAssociationLinkPropertiesFormat class. + /// + public ServiceAssociationLinkPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceAssociationLinkPropertiesFormat class. + /// + + /// Resource type of the linked resource. + /// + + /// Link to the external resource. + /// + + /// The provisioning state of the service association link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// If true, the resource can be deleted. + /// + + /// A list of locations. + /// + public ServiceAssociationLinkPropertiesFormat(string linkedResourceType = default(string), string link = default(string), string provisioningState = default(string), bool? allowDelete = default(bool?), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList)) + + { + this.LinkedResourceType = linkedResourceType; + this.Link = link; + this.ProvisioningState = provisioningState; + this.AllowDelete = allowDelete; + this.Locations = locations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets resource type of the linked resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkedResourceType")] + public string LinkedResourceType {get; set; } + + /// + /// Gets or sets link to the external resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "link")] + public string Link {get; set; } + + /// + /// Gets the provisioning state of the service association link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets if true, the resource can be deleted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowDelete")] + public bool? AllowDelete {get; set; } + + /// + /// Gets or sets a list of locations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] + public System.Collections.Generic.IList Locations {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinksListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinksListResult.cs index 53b25cbee08c..3583183aa220 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinksListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceAssociationLinksListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ServiceAssociationLinksListResult { /// - /// Initializes a new instance of the ServiceAssociationLinksListResult - /// class. + /// Initializes a new instance of the ServiceAssociationLinksListResult class. /// public ServiceAssociationLinksListResult() { @@ -30,17 +21,19 @@ public ServiceAssociationLinksListResult() } /// - /// Initializes a new instance of the ServiceAssociationLinksListResult - /// class. + /// Initializes a new instance of the ServiceAssociationLinksListResult class. /// - /// The service association links in a - /// subnet. - /// The URL to get the next set of - /// results. - public ServiceAssociationLinksListResult(IList value = default(IList), string nextLink = default(string)) + + /// The service association links in a subnet. + /// + + /// The URL to get the next set of results. + /// + public ServiceAssociationLinksListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,17 +42,17 @@ public ServiceAssociationLinksListResult() /// partial void CustomInit(); + /// /// Gets or sets the service association links in a subnet. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// /// Gets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceDelegationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceDelegationPropertiesFormat.cs new file mode 100644 index 000000000000..e41444cf74d1 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceDelegationPropertiesFormat.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of a service delegation. + /// + public partial class ServiceDelegationPropertiesFormat + { + /// + /// Initializes a new instance of the ServiceDelegationPropertiesFormat class. + /// + public ServiceDelegationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceDelegationPropertiesFormat class. + /// + + /// The name of the service to whom the subnet should be delegated (e.g. + /// Microsoft.Sql/servers). + /// + + /// The actions permitted to the service upon delegation. + /// + + /// The provisioning state of the service delegation resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ServiceDelegationPropertiesFormat(string serviceName = default(string), System.Collections.Generic.IList actions = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.ServiceName = serviceName; + this.Actions = actions; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the service to whom the subnet should be delegated + /// (e.g. Microsoft.Sql/servers). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } + + /// + /// Gets the actions permitted to the service upon delegation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "actions")] + public System.Collections.Generic.IList Actions {get; private set; } + + /// + /// Gets the provisioning state of the service delegation resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicy.cs index e3d82550d22b..cf91a607a860 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicy.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Service End point policy resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ServiceEndpointPolicy : Resource { /// @@ -34,40 +24,59 @@ public ServiceEndpointPolicy() /// /// Initializes a new instance of the ServiceEndpointPolicy class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A collection of - /// service endpoint policy definitions of the service endpoint - /// policy. - /// A collection of references to - /// subnets. - /// The resource GUID property of the - /// service endpoint policy resource. - /// The provisioning state of the - /// service endpoint policy resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The alias indicating if the policy - /// belongs to a service - /// A collection of - /// contextual service endpoint policy. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Kind of service endpoint policy. This is - /// metadata used for the Azure portal experience. - public ServiceEndpointPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList serviceEndpointPolicyDefinitions = default(IList), IList subnets = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string serviceAlias = default(string), IList contextualServiceEndpointPolicies = default(IList), string etag = default(string), string kind = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Kind of service endpoint policy. This is metadata used for the Azure portal + /// experience. + /// + + /// The provisioning state of the service endpoint policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A collection of service endpoint policy definitions of the service endpoint + /// policy. + /// + + /// A collection of references to subnets. + /// + + /// The resource GUID property of the service endpoint policy resource. + /// + + /// The alias indicating if the policy belongs to a service + /// + + /// A collection of contextual service endpoint policy. + /// + public ServiceEndpointPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string kind = default(string), string provisioningState = default(string), System.Collections.Generic.IList serviceEndpointPolicyDefinitions = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string resourceGuid = default(string), string serviceAlias = default(string), System.Collections.Generic.IList contextualServiceEndpointPolicies = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - ServiceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; - Subnets = subnets; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - ServiceAlias = serviceAlias; - ContextualServiceEndpointPolicies = contextualServiceEndpointPolicies; - Etag = etag; - Kind = kind; + this.Etag = etag; + this.Kind = kind; + this.ProvisioningState = provisioningState; + this.ServiceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + this.Subnets = subnets; + this.ResourceGuid = resourceGuid; + this.ServiceAlias = serviceAlias; + this.ContextualServiceEndpointPolicies = contextualServiceEndpointPolicies; CustomInit(); } @@ -76,60 +85,56 @@ public ServiceEndpointPolicy() /// partial void CustomInit(); + /// - /// Gets or sets a collection of service endpoint policy definitions of - /// the service endpoint policy. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.serviceEndpointPolicyDefinitions")] - public IList ServiceEndpointPolicyDefinitions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets a collection of references to subnets. + /// Gets kind of service endpoint policy. This is metadata used for the Azure + /// portal experience. /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; private set; } /// - /// Gets the resource GUID property of the service endpoint policy - /// resource. + /// Gets the provisioning state of the service endpoint policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the service endpoint policy - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets a collection of service endpoint policy definitions of the + /// service endpoint policy. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceEndpointPolicyDefinitions")] + public System.Collections.Generic.IList ServiceEndpointPolicyDefinitions {get; set; } /// - /// Gets or sets the alias indicating if the policy belongs to a - /// service + /// Gets a collection of references to subnets. /// - [JsonProperty(PropertyName = "properties.serviceAlias")] - public string ServiceAlias { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } /// - /// Gets or sets a collection of contextual service endpoint policy. + /// Gets the resource GUID property of the service endpoint policy resource. /// - [JsonProperty(PropertyName = "properties.contextualServiceEndpointPolicies")] - public IList ContextualServiceEndpointPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the alias indicating if the policy belongs to a service /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceAlias")] + public string ServiceAlias {get; set; } /// - /// Gets kind of service endpoint policy. This is metadata used for the - /// Azure portal experience. + /// Gets or sets a collection of contextual service endpoint policy. /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.contextualServiceEndpointPolicies")] + public System.Collections.Generic.IList ContextualServiceEndpointPolicies {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinition.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinition.cs index 5a61927972e8..0fb88c0cc95c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinition.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinition.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Service Endpoint policy definitions. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ServiceEndpointPolicyDefinition : SubResource { /// - /// Initializes a new instance of the ServiceEndpointPolicyDefinition - /// class. + /// Initializes a new instance of the ServiceEndpointPolicyDefinition class. /// public ServiceEndpointPolicyDefinition() { @@ -33,33 +22,44 @@ public ServiceEndpointPolicyDefinition() } /// - /// Initializes a new instance of the ServiceEndpointPolicyDefinition - /// class. + /// Initializes a new instance of the ServiceEndpointPolicyDefinition class. /// - /// Resource ID. - /// A description for this rule. Restricted - /// to 140 chars. - /// Service endpoint name. - /// A list of service resources. - /// The provisioning state of the - /// service endpoint policy definition resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The type of the resource. - public ServiceEndpointPolicyDefinition(string id = default(string), string description = default(string), string service = default(string), IList serviceResources = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The type of the resource. + /// + + /// The provisioning state of the service endpoint policy definition resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Service endpoint name. + /// + + /// A list of service resources. + /// + public ServiceEndpointPolicyDefinition(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string description = default(string), string service = default(string), System.Collections.Generic.IList serviceResources = default(System.Collections.Generic.IList)) + + : base(id) { - Description = description; - Service = service; - ServiceResources = serviceResources; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.Description = description; + this.Service = service; + this.ServiceResources = serviceResources; CustomInit(); } @@ -68,51 +68,50 @@ public ServiceEndpointPolicyDefinition() /// partial void CustomInit(); + /// - /// Gets or sets a description for this rule. Restricted to 140 chars. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets service endpoint name. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.service")] - public string Service { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets a list of service resources. + /// Gets or sets the type of the resource. /// - [JsonProperty(PropertyName = "properties.serviceResources")] - public IList ServiceResources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets the provisioning state of the service endpoint policy - /// definition resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the service endpoint policy definition + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets service endpoint name. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.service")] + public string Service {get; set; } /// - /// Gets or sets the type of the resource. + /// Gets or sets a list of service resources. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceResources")] + public System.Collections.Generic.IList ServiceResources {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinitionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinitionPropertiesFormat.cs new file mode 100644 index 000000000000..f8af5db2fcd3 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyDefinitionPropertiesFormat.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Service Endpoint policy definition resource. + /// + public partial class ServiceEndpointPolicyDefinitionPropertiesFormat + { + /// + /// Initializes a new instance of the ServiceEndpointPolicyDefinitionPropertiesFormat class. + /// + public ServiceEndpointPolicyDefinitionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceEndpointPolicyDefinitionPropertiesFormat class. + /// + + /// A description for this rule. Restricted to 140 chars. + /// + + /// Service endpoint name. + /// + + /// A list of service resources. + /// + + /// The provisioning state of the service endpoint policy definition resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ServiceEndpointPolicyDefinitionPropertiesFormat(string description = default(string), string service = default(string), System.Collections.Generic.IList serviceResources = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Description = description; + this.Service = service; + this.ServiceResources = serviceResources; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets service endpoint name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "service")] + public string Service {get; set; } + + /// + /// Gets or sets a list of service resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceResources")] + public System.Collections.Generic.IList ServiceResources {get; set; } + + /// + /// Gets the provisioning state of the service endpoint policy definition + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyPropertiesFormat.cs new file mode 100644 index 000000000000..c48a55e2e99f --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPolicyPropertiesFormat.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Service Endpoint Policy resource. + /// + public partial class ServiceEndpointPolicyPropertiesFormat + { + /// + /// Initializes a new instance of the ServiceEndpointPolicyPropertiesFormat class. + /// + public ServiceEndpointPolicyPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceEndpointPolicyPropertiesFormat class. + /// + + /// A collection of service endpoint policy definitions of the service endpoint + /// policy. + /// + + /// A collection of references to subnets. + /// + + /// The resource GUID property of the service endpoint policy resource. + /// + + /// The provisioning state of the service endpoint policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The alias indicating if the policy belongs to a service + /// + + /// A collection of contextual service endpoint policy. + /// + public ServiceEndpointPolicyPropertiesFormat(System.Collections.Generic.IList serviceEndpointPolicyDefinitions = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), string serviceAlias = default(string), System.Collections.Generic.IList contextualServiceEndpointPolicies = default(System.Collections.Generic.IList)) + + { + this.ServiceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + this.Subnets = subnets; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.ServiceAlias = serviceAlias; + this.ContextualServiceEndpointPolicies = contextualServiceEndpointPolicies; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a collection of service endpoint policy definitions of the + /// service endpoint policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceEndpointPolicyDefinitions")] + public System.Collections.Generic.IList ServiceEndpointPolicyDefinitions {get; set; } + + /// + /// Gets a collection of references to subnets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnets")] + public System.Collections.Generic.IList Subnets {get; private set; } + + /// + /// Gets the resource GUID property of the service endpoint policy resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the service endpoint policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the alias indicating if the policy belongs to a service + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceAlias")] + public string ServiceAlias {get; set; } + + /// + /// Gets or sets a collection of contextual service endpoint policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "contextualServiceEndpointPolicies")] + public System.Collections.Generic.IList ContextualServiceEndpointPolicies {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPropertiesFormat.cs index 8ff2d54d983f..b493e5354f7a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPropertiesFormat.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceEndpointPropertiesFormat.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ServiceEndpointPropertiesFormat { /// - /// Initializes a new instance of the ServiceEndpointPropertiesFormat - /// class. + /// Initializes a new instance of the ServiceEndpointPropertiesFormat class. /// public ServiceEndpointPropertiesFormat() { @@ -30,19 +21,23 @@ public ServiceEndpointPropertiesFormat() } /// - /// Initializes a new instance of the ServiceEndpointPropertiesFormat - /// class. + /// Initializes a new instance of the ServiceEndpointPropertiesFormat class. /// - /// The type of the endpoint service. - /// A list of locations. - /// The provisioning state of the - /// service endpoint resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - public ServiceEndpointPropertiesFormat(string service = default(string), IList locations = default(IList), string provisioningState = default(string)) + + /// The type of the endpoint service. + /// + + /// A list of locations. + /// + + /// The provisioning state of the service endpoint resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ServiceEndpointPropertiesFormat(string service = default(string), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), string provisioningState = default(string)) + { - Service = service; - Locations = locations; - ProvisioningState = provisioningState; + this.Service = service; + this.Locations = locations; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -51,25 +46,23 @@ public ServiceEndpointPropertiesFormat() /// partial void CustomInit(); + /// /// Gets or sets the type of the endpoint service. /// - [JsonProperty(PropertyName = "service")] - public string Service { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "service")] + public string Service {get; set; } /// /// Gets or sets a list of locations. /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] + public System.Collections.Generic.IList Locations {get; set; } /// - /// Gets the provisioning state of the service endpoint resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the service endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceProviderProvisioningState.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceProviderProvisioningState.cs index 4e5e1c65c5aa..c2b9ae51288a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceProviderProvisioningState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceProviderProvisioningState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for ServiceProviderProvisioningState. /// + + public static class ServiceProviderProvisioningState { public const string NotProvisioned = "NotProvisioned"; @@ -21,4 +18,4 @@ public static class ServiceProviderProvisioningState public const string Provisioned = "Provisioned"; public const string Deprovisioning = "Deprovisioning"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformation.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformation.cs index 7043aa989779..f053d7338895 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public ServiceTagInformation() /// /// Initializes a new instance of the ServiceTagInformation class. /// - /// Properties of the service tag - /// information. - /// The name of service tag. - /// The ID of service tag. - /// The iteration number of - /// service tag object for region. + + /// Properties of the service tag information. + /// + + /// The name of service tag. + /// + + /// The ID of service tag. + /// + + /// The iteration number of service tag object for region. + /// public ServiceTagInformation(ServiceTagInformationPropertiesFormat properties = default(ServiceTagInformationPropertiesFormat), string name = default(string), string id = default(string), string serviceTagChangeNumber = default(string)) + { - Properties = properties; - Name = name; - Id = id; - ServiceTagChangeNumber = serviceTagChangeNumber; + this.Properties = properties; + this.Name = name; + this.Id = id; + this.ServiceTagChangeNumber = serviceTagChangeNumber; CustomInit(); } @@ -49,29 +50,29 @@ public ServiceTagInformation() /// partial void CustomInit(); + /// /// Gets properties of the service tag information. /// - [JsonProperty(PropertyName = "properties")] - public ServiceTagInformationPropertiesFormat Properties { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public ServiceTagInformationPropertiesFormat Properties {get; private set; } /// /// Gets the name of service tag. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the ID of service tag. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the iteration number of service tag object for region. /// - [JsonProperty(PropertyName = "serviceTagChangeNumber")] - public string ServiceTagChangeNumber { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceTagChangeNumber")] + public string ServiceTagChangeNumber {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformationPropertiesFormat.cs index 8a93d844d105..8d4bc8a4959d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformationPropertiesFormat.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagInformationPropertiesFormat.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class ServiceTagInformationPropertiesFormat { /// - /// Initializes a new instance of the - /// ServiceTagInformationPropertiesFormat class. + /// Initializes a new instance of the ServiceTagInformationPropertiesFormat class. /// public ServiceTagInformationPropertiesFormat() { @@ -30,23 +21,31 @@ public ServiceTagInformationPropertiesFormat() } /// - /// Initializes a new instance of the - /// ServiceTagInformationPropertiesFormat class. + /// Initializes a new instance of the ServiceTagInformationPropertiesFormat class. /// - /// The iteration number of service - /// tag. - /// The region of service tag. - /// The name of system service. - /// The list of IP address - /// prefixes. - /// The state of the service tag. - public ServiceTagInformationPropertiesFormat(string changeNumber = default(string), string region = default(string), string systemService = default(string), IList addressPrefixes = default(IList), string state = default(string)) + + /// The iteration number of service tag. + /// + + /// The region of service tag. + /// + + /// The name of system service. + /// + + /// The list of IP address prefixes. + /// + + /// The state of the service tag. + /// + public ServiceTagInformationPropertiesFormat(string changeNumber = default(string), string region = default(string), string systemService = default(string), System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList), string state = default(string)) + { - ChangeNumber = changeNumber; - Region = region; - SystemService = systemService; - AddressPrefixes = addressPrefixes; - State = state; + this.ChangeNumber = changeNumber; + this.Region = region; + this.SystemService = systemService; + this.AddressPrefixes = addressPrefixes; + this.State = state; CustomInit(); } @@ -55,35 +54,35 @@ public ServiceTagInformationPropertiesFormat() /// partial void CustomInit(); + /// /// Gets the iteration number of service tag. /// - [JsonProperty(PropertyName = "changeNumber")] - public string ChangeNumber { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "changeNumber")] + public string ChangeNumber {get; private set; } /// /// Gets the region of service tag. /// - [JsonProperty(PropertyName = "region")] - public string Region { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; private set; } /// /// Gets the name of system service. /// - [JsonProperty(PropertyName = "systemService")] - public string SystemService { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemService")] + public string SystemService {get; private set; } /// /// Gets the list of IP address prefixes. /// - [JsonProperty(PropertyName = "addressPrefixes")] - public IList AddressPrefixes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; private set; } /// /// Gets the state of the service tag. /// - [JsonProperty(PropertyName = "state")] - public string State { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagsListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagsListResult.cs index ef95688014da..a103a78ab8e5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagsListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/ServiceTagsListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,24 +23,37 @@ public ServiceTagsListResult() /// /// Initializes a new instance of the ServiceTagsListResult class. /// - /// The name of the cloud. - /// The ID of the cloud. - /// The azure resource type. - /// The iteration number. - /// The name of the cloud. - /// The list of service tag information - /// resources. - /// The URL to get next page of service tag - /// information resources. - public ServiceTagsListResult(string name = default(string), string id = default(string), string type = default(string), string changeNumber = default(string), string cloud = default(string), IList values = default(IList), string nextLink = default(string)) + + /// The name of the cloud. + /// + + /// The ID of the cloud. + /// + + /// The azure resource type. + /// + + /// The iteration number. + /// + + /// The name of the cloud. + /// + + /// The list of service tag information resources. + /// + + /// The URL to get next page of service tag information resources. + /// + public ServiceTagsListResult(string name = default(string), string id = default(string), string type = default(string), string changeNumber = default(string), string cloud = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Name = name; - Id = id; - Type = type; - ChangeNumber = changeNumber; - Cloud = cloud; - Values = values; - NextLink = nextLink; + this.Name = name; + this.Id = id; + this.Type = type; + this.ChangeNumber = changeNumber; + this.Cloud = cloud; + this.Values = values; + this.NextLink = nextLink; CustomInit(); } @@ -57,47 +62,47 @@ public ServiceTagsListResult() /// partial void CustomInit(); + /// /// Gets the name of the cloud. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the ID of the cloud. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the azure resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the iteration number. /// - [JsonProperty(PropertyName = "changeNumber")] - public string ChangeNumber { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "changeNumber")] + public string ChangeNumber {get; private set; } /// /// Gets the name of the cloud. /// - [JsonProperty(PropertyName = "cloud")] - public string Cloud { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cloud")] + public string Cloud {get; private set; } /// /// Gets the list of service tag information resources. /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; private set; } /// /// Gets the URL to get next page of service tag information resources. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SessionIds.cs b/src/Network/Network.Management.Sdk/Generated/Models/SessionIds.cs index fc32bf9e9f17..8509667a94f4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SessionIds.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SessionIds.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public SessionIds() /// /// Initializes a new instance of the SessionIds class. /// - /// List of session IDs. - public SessionIds(IList sessionIdsProperty = default(IList)) + + /// List of session IDs. + /// + public SessionIds(System.Collections.Generic.IList sessionIdsProperty = default(System.Collections.Generic.IList)) + { - SessionIdsProperty = sessionIdsProperty; + this.SessionIdsProperty = sessionIdsProperty; CustomInit(); } @@ -43,11 +38,11 @@ public SessionIds() /// partial void CustomInit(); + /// /// Gets or sets list of session IDs. /// - [JsonProperty(PropertyName = "sessionIds")] - public IList SessionIdsProperty { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sessionIds")] + public System.Collections.Generic.IList SessionIdsProperty {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Severity.cs b/src/Network/Network.Management.Sdk/Generated/Models/Severity.cs index 0db307e58599..126f11c46063 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Severity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Severity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for Severity. /// + + public static class Severity { public const string Error = "Error"; public const string Warning = "Warning"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesQuery.cs b/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesQuery.cs index 54c3cead7024..40963467567b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesQuery.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesQuery.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class SignatureOverridesFilterValuesQuery { /// - /// Initializes a new instance of the - /// SignatureOverridesFilterValuesQuery class. + /// Initializes a new instance of the SignatureOverridesFilterValuesQuery class. /// public SignatureOverridesFilterValuesQuery() { @@ -28,14 +21,15 @@ public SignatureOverridesFilterValuesQuery() } /// - /// Initializes a new instance of the - /// SignatureOverridesFilterValuesQuery class. + /// Initializes a new instance of the SignatureOverridesFilterValuesQuery class. /// - /// Describes the name of the column which - /// values will be returned + + /// Describes the name of the column which values will be returned + /// public SignatureOverridesFilterValuesQuery(string filterName = default(string)) + { - FilterName = filterName; + this.FilterName = filterName; CustomInit(); } @@ -44,12 +38,11 @@ public SignatureOverridesFilterValuesQuery() /// partial void CustomInit(); + /// - /// Gets or sets describes the name of the column which values will be - /// returned + /// Gets or sets describes the name of the column which values will be returned /// - [JsonProperty(PropertyName = "filterName")] - public string FilterName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filterName")] + public string FilterName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesResponse.cs b/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesResponse.cs index 9cfcddb39b09..3c3805b0d8f2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesResponse.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SignatureOverridesFilterValuesResponse.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class SignatureOverridesFilterValuesResponse { /// - /// Initializes a new instance of the - /// SignatureOverridesFilterValuesResponse class. + /// Initializes a new instance of the SignatureOverridesFilterValuesResponse class. /// public SignatureOverridesFilterValuesResponse() { @@ -30,13 +21,15 @@ public SignatureOverridesFilterValuesResponse() } /// - /// Initializes a new instance of the - /// SignatureOverridesFilterValuesResponse class. + /// Initializes a new instance of the SignatureOverridesFilterValuesResponse class. /// - /// Describes the possible values - public SignatureOverridesFilterValuesResponse(IList filterValues = default(IList)) + + /// Describes the possible values + /// + public SignatureOverridesFilterValuesResponse(System.Collections.Generic.IList filterValues = default(System.Collections.Generic.IList)) + { - FilterValues = filterValues; + this.FilterValues = filterValues; CustomInit(); } @@ -45,11 +38,11 @@ public SignatureOverridesFilterValuesResponse() /// partial void CustomInit(); + /// /// Gets or sets describes the possible values /// - [JsonProperty(PropertyName = "filterValues")] - public IList FilterValues { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filterValues")] + public System.Collections.Generic.IList FilterValues {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverrides.cs b/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverrides.cs index 6cb29e57bf08..e9ffb4c6f0bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverrides.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverrides.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Contains all specific policy signatures overrides for the IDPS /// - public partial class SignaturesOverrides : IResource + public partial class SignaturesOverrides : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the SignaturesOverrides class. @@ -31,20 +23,27 @@ public SignaturesOverrides() /// /// Initializes a new instance of the SignaturesOverrides class. /// - /// Contains the name of the resource - /// (default) - /// Will contain the resource id of the signature - /// override resource + + /// Contains the name of the resource (default) + /// + + /// Will contain the resource id of the signature override resource + /// + /// Will contain the type of the resource: - /// Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides - /// Will contain the properties of the - /// resource (the actual signature overrides) + /// Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + /// + + /// Will contain the properties of the resource (the actual signature + /// overrides) + /// public SignaturesOverrides(string name = default(string), string id = default(string), string type = default(string), SignaturesOverridesProperties properties = default(SignaturesOverridesProperties)) + { - Name = name; - Id = id; - Type = type; - Properties = properties; + this.Name = name; + this.Id = id; + this.Type = type; + this.Properties = properties; CustomInit(); } @@ -53,32 +52,32 @@ public SignaturesOverrides() /// partial void CustomInit(); + /// /// Gets or sets contains the name of the resource (default) /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets will contain the resource id of the signature override /// resource /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets will contain the type of the resource: /// Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets will contain the properties of the resource (the - /// actual signature overrides) + /// Gets or sets will contain the properties of the resource (the actual + /// signature overrides) /// - [JsonProperty(PropertyName = "properties")] - public SignaturesOverridesProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SignaturesOverridesProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesList.cs b/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesList.cs index 25fd36589800..f5df0009a3d5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,14 @@ public SignaturesOverridesList() /// /// Initializes a new instance of the SignaturesOverridesList class. /// - /// Describes a list consisting exactly one item - /// describing the policy's signature override status - public SignaturesOverridesList(IList value = default(IList)) + + /// Describes a list consisting exactly one item describing the policy's + /// signature override status + /// + public SignaturesOverridesList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -44,12 +39,12 @@ public SignaturesOverridesList() /// partial void CustomInit(); + /// - /// Gets or sets describes a list consisting exactly one item - /// describing the policy's signature override status + /// Gets or sets describes a list consisting exactly one item describing the + /// policy's signature override status /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesProperties.cs index 73a8154572dd..754e5485ab6a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SignaturesOverridesProperties.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class SignaturesOverridesProperties { /// - /// Initializes a new instance of the SignaturesOverridesProperties - /// class. + /// Initializes a new instance of the SignaturesOverridesProperties class. /// public SignaturesOverridesProperties() { @@ -31,12 +22,15 @@ public SignaturesOverridesProperties() } /// - /// Initializes a new instance of the SignaturesOverridesProperties - /// class. + /// Initializes a new instance of the SignaturesOverridesProperties class. /// - public SignaturesOverridesProperties(IDictionary signatures = default(IDictionary)) + + /// Dictionary of <string> + /// + public SignaturesOverridesProperties(System.Collections.Generic.IDictionary signatures = default(System.Collections.Generic.IDictionary)) + { - Signatures = signatures; + this.Signatures = signatures; CustomInit(); } @@ -45,10 +39,11 @@ public SignaturesOverridesProperties() /// partial void CustomInit(); + /// + /// Gets or sets dictionary of <string> /// - [JsonProperty(PropertyName = "signatures")] - public IDictionary Signatures { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "signatures")] + public System.Collections.Generic.IDictionary Signatures {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SingleQueryResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/SingleQueryResult.cs index d60ffa105c74..54fee7943911 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SingleQueryResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SingleQueryResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class SingleQueryResult @@ -28,41 +20,55 @@ public SingleQueryResult() /// /// Initializes a new instance of the SingleQueryResult class. /// - /// The ID of the signature - /// The current mode enforced, 0 - Disabled, 1 - - /// Alert, 2 -Deny - /// Describes the severity of signature: 1 - - /// High, 2 - Medium, 3 - Low - /// Describes in which direction signature is - /// being enforced: 0 - OutBound, 1 - InBound, 2 - Any, 3 - Internal, 4 - /// - InternalOutbound - /// Describes the groups the signature belongs - /// to - /// Describes what is the signature - /// enforces - /// Describes the protocol the signatures is - /// being enforced in - /// Describes the list of source ports - /// related to this signature - /// Describes the list of destination - /// ports related to this signature - /// Describes the last updated time of the - /// signature (provided from 3rd party vendor) - /// Describes if this override - /// is inherited from base policy or not - public SingleQueryResult(int? signatureId = default(int?), int? mode = default(int?), int? severity = default(int?), int? direction = default(int?), string group = default(string), string description = default(string), string protocol = default(string), IList sourcePorts = default(IList), IList destinationPorts = default(IList), string lastUpdated = default(string), bool? inheritedFromParentPolicy = default(bool?)) + + /// The ID of the signature + /// + + /// The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny + /// Possible values include: '0', '1', '2' + + /// Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low + /// Possible values include: '1', '2', '3' + + /// Describes in which direction signature is being enforced: 0 - OutBound, 1 - + /// InBound, 2 - Any, 3 - Internal, 4 - InternalOutbound + /// Possible values include: '0', '1', '2', '3', '4' + + /// Describes the groups the signature belongs to + /// + + /// Describes what is the signature enforces + /// + + /// Describes the protocol the signatures is being enforced in + /// + + /// Describes the list of source ports related to this signature + /// + + /// Describes the list of destination ports related to this signature + /// + + /// Describes the last updated time of the signature (provided from 3rd party + /// vendor) + /// + + /// Describes if this override is inherited from base policy or not + /// + public SingleQueryResult(int? signatureId = default(int?), int? mode = default(int?), int? severity = default(int?), int? direction = default(int?), string group = default(string), string description = default(string), string protocol = default(string), System.Collections.Generic.IList sourcePorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList destinationPorts = default(System.Collections.Generic.IList), string lastUpdated = default(string), bool? inheritedFromParentPolicy = default(bool?)) + { - SignatureId = signatureId; - Mode = mode; - Severity = severity; - Direction = direction; - Group = group; - Description = description; - Protocol = protocol; - SourcePorts = sourcePorts; - DestinationPorts = destinationPorts; - LastUpdated = lastUpdated; - InheritedFromParentPolicy = inheritedFromParentPolicy; + this.SignatureId = signatureId; + this.Mode = mode; + this.Severity = severity; + this.Direction = direction; + this.Group = group; + this.Description = description; + this.Protocol = protocol; + this.SourcePorts = sourcePorts; + this.DestinationPorts = destinationPorts; + this.LastUpdated = lastUpdated; + this.InheritedFromParentPolicy = inheritedFromParentPolicy; CustomInit(); } @@ -71,80 +77,76 @@ public SingleQueryResult() /// partial void CustomInit(); + /// /// Gets or sets the ID of the signature /// - [JsonProperty(PropertyName = "signatureId")] - public int? SignatureId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "signatureId")] + public int? SignatureId {get; set; } /// - /// Gets or sets the current mode enforced, 0 - Disabled, 1 - Alert, 2 - /// -Deny + /// Gets or sets the current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny Possible values include: '0', '1', '2' /// - [JsonProperty(PropertyName = "mode")] - public int? Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public int? Mode {get; set; } /// - /// Gets or sets describes the severity of signature: 1 - High, 2 - - /// Medium, 3 - Low + /// Gets or sets describes the severity of signature: 1 - High, 2 - Medium, 3 - + /// Low Possible values include: '1', '2', '3' /// - [JsonProperty(PropertyName = "severity")] - public int? Severity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "severity")] + public int? Severity {get; set; } /// - /// Gets or sets describes in which direction signature is being - /// enforced: 0 - OutBound, 1 - InBound, 2 - Any, 3 - Internal, 4 - - /// InternalOutbound + /// Gets or sets describes in which direction signature is being enforced: 0 - + /// OutBound, 1 - InBound, 2 - Any, 3 - Internal, 4 - InternalOutbound Possible values include: '0', '1', '2', '3', '4' /// - [JsonProperty(PropertyName = "direction")] - public int? Direction { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public int? Direction {get; set; } /// /// Gets or sets describes the groups the signature belongs to /// - [JsonProperty(PropertyName = "group")] - public string Group { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "group")] + public string Group {get; set; } /// /// Gets or sets describes what is the signature enforces /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets describes the protocol the signatures is being - /// enforced in + /// Gets or sets describes the protocol the signatures is being enforced in /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets describes the list of source ports related to this - /// signature + /// Gets or sets describes the list of source ports related to this signature /// - [JsonProperty(PropertyName = "sourcePorts")] - public IList SourcePorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePorts")] + public System.Collections.Generic.IList SourcePorts {get; set; } /// - /// Gets or sets describes the list of destination ports related to - /// this signature + /// Gets or sets describes the list of destination ports related to this + /// signature /// - [JsonProperty(PropertyName = "destinationPorts")] - public IList DestinationPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPorts")] + public System.Collections.Generic.IList DestinationPorts {get; set; } /// - /// Gets or sets describes the last updated time of the signature - /// (provided from 3rd party vendor) + /// Gets or sets describes the last updated time of the signature (provided + /// from 3rd party vendor) /// - [JsonProperty(PropertyName = "lastUpdated")] - public string LastUpdated { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdated")] + public string LastUpdated {get; set; } /// - /// Gets or sets describes if this override is inherited from base - /// policy or not + /// Gets or sets describes if this override is inherited from base policy or + /// not /// - [JsonProperty(PropertyName = "inheritedFromParentPolicy")] - public bool? InheritedFromParentPolicy { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "inheritedFromParentPolicy")] + public bool? InheritedFromParentPolicy {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SingletonResource.cs b/src/Network/Network.Management.Sdk/Generated/Models/SingletonResource.cs new file mode 100644 index 000000000000..47000c16c577 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/SingletonResource.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for SingletonResource. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum SingletonResource + { + [System.Runtime.Serialization.EnumMember(Value = "swap")] + Swap + } + internal static class SingletonResourceEnumExtension + { + internal static string ToSerializedValue(this SingletonResource? value) + { + return value == null ? null : ((SingletonResource)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this SingletonResource value) + { + switch( value ) + { + case SingletonResource.Swap: + return "swap"; + } + return null; + } + internal static SingletonResource? ParseSingletonResource(this string value) + { + switch( value ) + { + case "swap": + return SingletonResource.Swap; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Sku.cs b/src/Network/Network.Management.Sdk/Generated/Models/Sku.cs index f59b6890c00a..803cb1da4c82 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Sku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Sku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public Sku() /// /// Initializes a new instance of the Sku class. /// - /// The name of this Bastion Host. Possible values - /// include: 'Basic', 'Standard', 'Developer' + + /// The name of this Bastion Host. + /// Possible values include: 'Basic', 'Standard', 'Developer' public Sku(string name = default(string)) + { - Name = name; + this.Name = name; CustomInit(); } @@ -42,12 +38,11 @@ public Sku() /// partial void CustomInit(); + /// - /// Gets or sets the name of this Bastion Host. Possible values - /// include: 'Basic', 'Standard', 'Developer' + /// Gets or sets the name of this Bastion Host. Possible values include: 'Basic', 'Standard', 'Developer' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SlotType.cs b/src/Network/Network.Management.Sdk/Generated/Models/SlotType.cs index 361e403f5d71..c7ab8036e541 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SlotType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SlotType.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for SlotType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum SlotType { - [EnumMember(Value = "Production")] + [System.Runtime.Serialization.EnumMember(Value = "Production")] Production, - [EnumMember(Value = "Staging")] + [System.Runtime.Serialization.EnumMember(Value = "Staging")] Staging } internal static class SlotTypeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this SlotType? value) { return value == null ? null : ((SlotType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this SlotType value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this SlotType value) } return null; } - internal static SlotType? ParseSlotType(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this SlotType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/StaticMember.cs b/src/Network/Network.Management.Sdk/Generated/Models/StaticMember.cs index 503a4d6d3a89..46eeb894026f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/StaticMember.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/StaticMember.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// StaticMember Item. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class StaticMember : ChildResource { /// @@ -32,25 +24,38 @@ public StaticMember() /// /// Initializes a new instance of the StaticMember class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource Id. - /// Resource region. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The system metadata related to this - /// resource. - public StaticMember(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string resourceId = default(string), string region = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The system metadata related to this resource. + /// + + /// The provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Resource Id. + /// + + /// Resource region. + /// + public StaticMember(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string resourceId = default(string), string region = default(string)) + + : base(id, name, type, etag) { - ResourceId = resourceId; - Region = region; - ProvisioningState = provisioningState; - SystemData = systemData; + this.SystemData = systemData; + this.ProvisioningState = provisioningState; + this.ResourceId = resourceId; + this.Region = region; CustomInit(); } @@ -59,31 +64,29 @@ public StaticMember() /// partial void CustomInit(); + /// - /// Gets or sets resource Id. + /// Gets the system metadata related to this resource. /// - [JsonProperty(PropertyName = "properties.resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets resource region. + /// Gets the provisioning state of the scope assignment resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.region")] - public string Region { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the scope assignment resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets or sets resource Id. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId {get; set; } /// - /// Gets the system metadata related to this resource. + /// Gets resource region. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.region")] + public string Region {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/StaticMemberProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/StaticMemberProperties.cs new file mode 100644 index 000000000000..4ff7634d8ef0 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/StaticMemberProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of static member. + /// + public partial class StaticMemberProperties + { + /// + /// Initializes a new instance of the StaticMemberProperties class. + /// + public StaticMemberProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticMemberProperties class. + /// + + /// Resource Id. + /// + + /// Resource region. + /// + + /// The provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public StaticMemberProperties(string resourceId = default(string), string region = default(string), string provisioningState = default(string)) + + { + this.ResourceId = resourceId; + this.Region = region; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets resource Id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets resource region. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; private set; } + + /// + /// Gets the provisioning state of the scope assignment resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/StaticRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/StaticRoute.cs index d18f81f0a9b0..806e944e0851 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/StaticRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/StaticRoute.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,21 @@ public StaticRoute() /// /// Initializes a new instance of the StaticRoute class. /// - /// The name of the StaticRoute that is unique - /// within a VnetRoute. - /// List of all address prefixes. - /// The ip address of the next - /// hop. - public StaticRoute(string name = default(string), IList addressPrefixes = default(IList), string nextHopIpAddress = default(string)) + + /// The name of the StaticRoute that is unique within a VnetRoute. + /// + + /// List of all address prefixes. + /// + + /// The ip address of the next hop. + /// + public StaticRoute(string name = default(string), System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList), string nextHopIPAddress = default(string)) + { - Name = name; - AddressPrefixes = addressPrefixes; - NextHopIpAddress = nextHopIpAddress; + this.Name = name; + this.AddressPrefixes = addressPrefixes; + this.NextHopIPAddress = nextHopIPAddress; CustomInit(); } @@ -49,24 +46,23 @@ public StaticRoute() /// partial void CustomInit(); + /// - /// Gets or sets the name of the StaticRoute that is unique within a - /// VnetRoute. + /// Gets or sets the name of the StaticRoute that is unique within a VnetRoute. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets list of all address prefixes. /// - [JsonProperty(PropertyName = "addressPrefixes")] - public IList AddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; set; } /// /// Gets or sets the ip address of the next hop. /// - [JsonProperty(PropertyName = "nextHopIpAddress")] - public string NextHopIpAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] + public string NextHopIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/StaticRoutesConfig.cs b/src/Network/Network.Management.Sdk/Generated/Models/StaticRoutesConfig.cs index feb097fd70b3..fc65596eb8a5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/StaticRoutesConfig.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/StaticRoutesConfig.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Configuration for static routes on this HubVnetConnectionConfiguration - /// for static routes on this HubVnetConnection. + /// Configuration for static routes on this HubVnetConnectionConfiguration for + /// static routes on this HubVnetConnection. /// public partial class StaticRoutesConfig { @@ -30,16 +24,20 @@ public StaticRoutesConfig() /// /// Initializes a new instance of the StaticRoutesConfig class. /// - /// Boolean indicating whether - /// static routes on this connection are automatically propagate to - /// route tables which this connection propagates to. - /// Parameter determining - /// whether NVA in spoke vnet is bypassed for traffic with destination - /// in spoke. Possible values include: 'Contains', 'Equal' + + /// Boolean indicating whether static routes on this connection are + /// automatically propagate to route tables which this connection propagates + /// to. + /// + + /// Parameter determining whether NVA in spoke vnet is bypassed for traffic + /// with destination in spoke. + /// Possible values include: 'Contains', 'Equal' public StaticRoutesConfig(bool? propagateStaticRoutes = default(bool?), string vnetLocalRouteOverrideCriteria = default(string)) + { - PropagateStaticRoutes = propagateStaticRoutes; - VnetLocalRouteOverrideCriteria = vnetLocalRouteOverrideCriteria; + this.PropagateStaticRoutes = propagateStaticRoutes; + this.VnetLocalRouteOverrideCriteria = vnetLocalRouteOverrideCriteria; CustomInit(); } @@ -48,21 +46,20 @@ public StaticRoutesConfig() /// partial void CustomInit(); + /// - /// Gets boolean indicating whether static routes on this connection - /// are automatically propagate to route tables which this connection - /// propagates to. + /// Gets boolean indicating whether static routes on this connection are + /// automatically propagate to route tables which this connection propagates + /// to. /// - [JsonProperty(PropertyName = "propagateStaticRoutes")] - public bool? PropagateStaticRoutes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "propagateStaticRoutes")] + public bool? PropagateStaticRoutes {get; private set; } /// - /// Gets or sets parameter determining whether NVA in spoke vnet is - /// bypassed for traffic with destination in spoke. Possible values - /// include: 'Contains', 'Equal' + /// Gets or sets parameter determining whether NVA in spoke vnet is bypassed + /// for traffic with destination in spoke. Possible values include: 'Contains', 'Equal' /// - [JsonProperty(PropertyName = "vnetLocalRouteOverrideCriteria")] - public string VnetLocalRouteOverrideCriteria { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vnetLocalRouteOverrideCriteria")] + public string VnetLocalRouteOverrideCriteria {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SubResource.cs b/src/Network/Network.Management.Sdk/Generated/Models/SubResource.cs index 8535ab1c1edb..65255618744b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SubResource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SubResource.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// Reference to another subresource. /// - public partial class SubResource : IResource + public partial class SubResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the SubResource class. @@ -31,10 +23,13 @@ public SubResource() /// /// Initializes a new instance of the SubResource class. /// - /// Resource ID. + + /// Resource ID. + /// public SubResource(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -43,11 +38,11 @@ public SubResource() /// partial void CustomInit(); + /// /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Subnet.cs b/src/Network/Network.Management.Sdk/Generated/Models/Subnet.cs index f9d1dcff7abf..21282bc32722 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Subnet.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Subnet.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Subnet in a virtual network resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Subnet : SubResource { /// @@ -34,85 +24,112 @@ public Subnet() /// /// Initializes a new instance of the Subnet class. /// - /// Resource ID. - /// The address prefix for the - /// subnet. - /// List of address prefixes for the - /// subnet. - /// The reference to the - /// NetworkSecurityGroup resource. - /// The reference to the RouteTable - /// resource. - /// Nat gateway associated with this - /// subnet. - /// An array of service - /// endpoints. - /// An array of service endpoint - /// policies. - /// An array of references to private - /// endpoints. - /// An array of references to the - /// network interface IP configurations using subnet. - /// Array of IP configuration - /// profiles which reference this subnet. - /// Array of IpAllocation which reference - /// this subnet. - /// An array of references to the - /// external resources using subnet. - /// An array of references to - /// services injecting into this subnet. - /// An array of references to the delegations - /// on the subnet. - /// A read-only string identifying the intention - /// of use for this subnet based on delegations and other user-defined - /// properties. - /// The provisioning state of the - /// subnet resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Enable or Disable - /// apply network policies on private end point in the subnet. Possible - /// values include: 'Enabled', 'Disabled' - /// Enable or Disable - /// apply network policies on private link service in the subnet. - /// Possible values include: 'Enabled', 'Disabled' - /// Application - /// gateway IP configurations of virtual network resource. - /// Set this property to false to - /// disable default outbound connectivity for all VMs in the subnet. - /// This property can only be set at the time of subnet creation and - /// cannot be updated for an existing subnet. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public Subnet(string id = default(string), string addressPrefix = default(string), IList addressPrefixes = default(IList), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), SubResource natGateway = default(SubResource), IList serviceEndpoints = default(IList), IList serviceEndpointPolicies = default(IList), IList privateEndpoints = default(IList), IList ipConfigurations = default(IList), IList ipConfigurationProfiles = default(IList), IList ipAllocations = default(IList), IList resourceNavigationLinks = default(IList), IList serviceAssociationLinks = default(IList), IList delegations = default(IList), string purpose = default(string), string provisioningState = default(string), string privateEndpointNetworkPolicies = default(string), string privateLinkServiceNetworkPolicies = default(string), IList applicationGatewayIPConfigurations = default(IList), bool? defaultOutboundAccess = default(bool?), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The reference to the RouteTable resource. + /// + + /// The provisioning state of the subnet resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The address prefix for the subnet. + /// + + /// List of address prefixes for the subnet. + /// + + /// The reference to the NetworkSecurityGroup resource. + /// + + /// Nat gateway associated with this subnet. + /// + + /// An array of service endpoints. + /// + + /// An array of service endpoint policies. + /// + + /// An array of references to private endpoints. + /// + + /// An array of references to the network interface IP configurations using + /// subnet. + /// + + /// Array of IP configuration profiles which reference this subnet. + /// + + /// Array of IpAllocation which reference this subnet. + /// + + /// An array of references to the external resources using subnet. + /// + + /// An array of references to services injecting into this subnet. + /// + + /// An array of references to the delegations on the subnet. + /// + + /// A read-only string identifying the intention of use for this subnet based + /// on delegations and other user-defined properties. + /// + + /// Enable or Disable apply network policies on private end point in the + /// subnet. + /// Possible values include: 'Enabled', 'Disabled' + + /// Enable or Disable apply network policies on private link service in the + /// subnet. + /// Possible values include: 'Enabled', 'Disabled' + + /// Application gateway IP configurations of virtual network resource. + /// + + /// Set this property to false to disable default outbound connectivity for all + /// VMs in the subnet. This property can only be set at the time of subnet + /// creation and cannot be updated for an existing subnet. + /// + public Subnet(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), RouteTable routeTable = default(RouteTable), string provisioningState = default(string), string addressPrefix = default(string), System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), SubResource natGateway = default(SubResource), System.Collections.Generic.IList serviceEndpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList serviceEndpointPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurationProfiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipAllocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceNavigationLinks = default(System.Collections.Generic.IList), System.Collections.Generic.IList serviceAssociationLinks = default(System.Collections.Generic.IList), System.Collections.Generic.IList delegations = default(System.Collections.Generic.IList), string purpose = default(string), string privateEndpointNetworkPolicies = default(string), string privateLinkServiceNetworkPolicies = default(string), System.Collections.Generic.IList applicationGatewayIPConfigurations = default(System.Collections.Generic.IList), bool? defaultOutboundAccess = default(bool?)) + + : base(id) { - AddressPrefix = addressPrefix; - AddressPrefixes = addressPrefixes; - NetworkSecurityGroup = networkSecurityGroup; - RouteTable = routeTable; - NatGateway = natGateway; - ServiceEndpoints = serviceEndpoints; - ServiceEndpointPolicies = serviceEndpointPolicies; - PrivateEndpoints = privateEndpoints; - IpConfigurations = ipConfigurations; - IpConfigurationProfiles = ipConfigurationProfiles; - IpAllocations = ipAllocations; - ResourceNavigationLinks = resourceNavigationLinks; - ServiceAssociationLinks = serviceAssociationLinks; - Delegations = delegations; - Purpose = purpose; - ProvisioningState = provisioningState; - PrivateEndpointNetworkPolicies = privateEndpointNetworkPolicies; - PrivateLinkServiceNetworkPolicies = privateLinkServiceNetworkPolicies; - ApplicationGatewayIPConfigurations = applicationGatewayIPConfigurations; - DefaultOutboundAccess = defaultOutboundAccess; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.RouteTable = routeTable; + this.ProvisioningState = provisioningState; + this.AddressPrefix = addressPrefix; + this.AddressPrefixes = addressPrefixes; + this.NetworkSecurityGroup = networkSecurityGroup; + this.NatGateway = natGateway; + this.ServiceEndpoints = serviceEndpoints; + this.ServiceEndpointPolicies = serviceEndpointPolicies; + this.PrivateEndpoints = privateEndpoints; + this.IPConfigurations = ipConfigurations; + this.IPConfigurationProfiles = ipConfigurationProfiles; + this.IPAllocations = ipAllocations; + this.ResourceNavigationLinks = resourceNavigationLinks; + this.ServiceAssociationLinks = serviceAssociationLinks; + this.Delegations = delegations; + this.Purpose = purpose; + this.PrivateEndpointNetworkPolicies = privateEndpointNetworkPolicies; + this.PrivateLinkServiceNetworkPolicies = privateLinkServiceNetworkPolicies; + this.ApplicationGatewayIPConfigurations = applicationGatewayIPConfigurations; + this.DefaultOutboundAccess = defaultOutboundAccess; CustomInit(); } @@ -121,158 +138,152 @@ public Subnet() /// partial void CustomInit(); + /// - /// Gets or sets the address prefix for the subnet. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets list of address prefixes for the subnet. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.addressPrefixes")] - public IList AddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the NetworkSecurityGroup resource. + /// Gets or sets resource type. /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] - public NetworkSecurityGroup NetworkSecurityGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the reference to the RouteTable resource. /// - [JsonProperty(PropertyName = "properties.routeTable")] - public RouteTable RouteTable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeTable")] + public RouteTable RouteTable {get; set; } /// - /// Gets or sets nat gateway associated with this subnet. + /// Gets the provisioning state of the subnet resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.natGateway")] - public SubResource NatGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets an array of service endpoints. + /// Gets or sets the address prefix for the subnet. /// - [JsonProperty(PropertyName = "properties.serviceEndpoints")] - public IList ServiceEndpoints { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets or sets an array of service endpoint policies. + /// Gets or sets list of address prefixes for the subnet. /// - [JsonProperty(PropertyName = "properties.serviceEndpointPolicies")] - public IList ServiceEndpointPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; set; } /// - /// Gets an array of references to private endpoints. + /// Gets or sets the reference to the NetworkSecurityGroup resource. /// - [JsonProperty(PropertyName = "properties.privateEndpoints")] - public IList PrivateEndpoints { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + public NetworkSecurityGroup NetworkSecurityGroup {get; set; } /// - /// Gets an array of references to the network interface IP - /// configurations using subnet. + /// Gets or sets nat gateway associated with this subnet. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.natGateway")] + public SubResource NatGateway {get; set; } /// - /// Gets array of IP configuration profiles which reference this - /// subnet. + /// Gets or sets an array of service endpoints. /// - [JsonProperty(PropertyName = "properties.ipConfigurationProfiles")] - public IList IpConfigurationProfiles { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceEndpoints")] + public System.Collections.Generic.IList ServiceEndpoints {get; set; } /// - /// Gets or sets array of IpAllocation which reference this subnet. + /// Gets or sets an array of service endpoint policies. /// - [JsonProperty(PropertyName = "properties.ipAllocations")] - public IList IpAllocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceEndpointPolicies")] + public System.Collections.Generic.IList ServiceEndpointPolicies {get; set; } /// - /// Gets an array of references to the external resources using subnet. + /// Gets an array of references to private endpoints. /// - [JsonProperty(PropertyName = "properties.resourceNavigationLinks")] - public IList ResourceNavigationLinks { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpoints")] + public System.Collections.Generic.IList PrivateEndpoints {get; private set; } /// - /// Gets an array of references to services injecting into this subnet. + /// Gets an array of references to the network interface IP configurations + /// using subnet. /// - [JsonProperty(PropertyName = "properties.serviceAssociationLinks")] - public IList ServiceAssociationLinks { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } /// - /// Gets or sets an array of references to the delegations on the - /// subnet. + /// Gets array of IP configuration profiles which reference this subnet. /// - [JsonProperty(PropertyName = "properties.delegations")] - public IList Delegations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurationProfiles")] + public System.Collections.Generic.IList IPConfigurationProfiles {get; private set; } /// - /// Gets a read-only string identifying the intention of use for this - /// subnet based on delegations and other user-defined properties. + /// Gets or sets array of IpAllocation which reference this subnet. /// - [JsonProperty(PropertyName = "properties.purpose")] - public string Purpose { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAllocations")] + public System.Collections.Generic.IList IPAllocations {get; set; } /// - /// Gets the provisioning state of the subnet resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets an array of references to the external resources using subnet. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceNavigationLinks")] + public System.Collections.Generic.IList ResourceNavigationLinks {get; private set; } /// - /// Gets or sets enable or Disable apply network policies on private - /// end point in the subnet. Possible values include: 'Enabled', - /// 'Disabled' + /// Gets an array of references to services injecting into this subnet. /// - [JsonProperty(PropertyName = "properties.privateEndpointNetworkPolicies")] - public string PrivateEndpointNetworkPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceAssociationLinks")] + public System.Collections.Generic.IList ServiceAssociationLinks {get; private set; } /// - /// Gets or sets enable or Disable apply network policies on private - /// link service in the subnet. Possible values include: 'Enabled', - /// 'Disabled' + /// Gets or sets an array of references to the delegations on the subnet. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceNetworkPolicies")] - public string PrivateLinkServiceNetworkPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.delegations")] + public System.Collections.Generic.IList Delegations {get; set; } /// - /// Gets or sets application gateway IP configurations of virtual - /// network resource. + /// Gets a read-only string identifying the intention of use for this subnet + /// based on delegations and other user-defined properties. /// - [JsonProperty(PropertyName = "properties.applicationGatewayIPConfigurations")] - public IList ApplicationGatewayIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purpose")] + public string Purpose {get; private set; } /// - /// Gets or sets set this property to false to disable default outbound - /// connectivity for all VMs in the subnet. This property can only be - /// set at the time of subnet creation and cannot be updated for an - /// existing subnet. + /// Gets or sets enable or Disable apply network policies on private end point + /// in the subnet. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.defaultOutboundAccess")] - public bool? DefaultOutboundAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpointNetworkPolicies")] + public string PrivateEndpointNetworkPolicies {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets enable or Disable apply network policies on private link + /// service in the subnet. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceNetworkPolicies")] + public string PrivateLinkServiceNetworkPolicies {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets application gateway IP configurations of virtual network + /// resource. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayIPConfigurations")] + public System.Collections.Generic.IList ApplicationGatewayIPConfigurations {get; set; } /// - /// Gets or sets resource type. + /// Gets or sets set this property to false to disable default outbound + /// connectivity for all VMs in the subnet. This property can only be set at + /// the time of subnet creation and cannot be updated for an existing subnet. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultOutboundAccess")] + public bool? DefaultOutboundAccess {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SubnetAssociation.cs b/src/Network/Network.Management.Sdk/Generated/Models/SubnetAssociation.cs index 3d2d2a1da703..d69f1e0a6146 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SubnetAssociation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SubnetAssociation.cs @@ -1,22 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Subnet and it's custom security rules. + /// Subnet and it's custom security rules. /// public partial class SubnetAssociation { @@ -31,13 +23,17 @@ public SubnetAssociation() /// /// Initializes a new instance of the SubnetAssociation class. /// - /// Subnet ID. - /// Collection of custom security - /// rules. - public SubnetAssociation(string id = default(string), IList securityRules = default(IList)) + + /// Subnet ID. + /// + + /// Collection of custom security rules. + /// + public SubnetAssociation(string id = default(string), System.Collections.Generic.IList securityRules = default(System.Collections.Generic.IList)) + { - Id = id; - SecurityRules = securityRules; + this.Id = id; + this.SecurityRules = securityRules; CustomInit(); } @@ -46,17 +42,17 @@ public SubnetAssociation() /// partial void CustomInit(); + /// /// Gets subnet ID. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets collection of custom security rules. /// - [JsonProperty(PropertyName = "securityRules")] - public IList SecurityRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityRules")] + public System.Collections.Generic.IList SecurityRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SubnetPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/SubnetPropertiesFormat.cs new file mode 100644 index 000000000000..848c77e1a551 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/SubnetPropertiesFormat.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the subnet. + /// + public partial class SubnetPropertiesFormat + { + /// + /// Initializes a new instance of the SubnetPropertiesFormat class. + /// + public SubnetPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubnetPropertiesFormat class. + /// + + /// The address prefix for the subnet. + /// + + /// List of address prefixes for the subnet. + /// + + /// The reference to the NetworkSecurityGroup resource. + /// + + /// The reference to the RouteTable resource. + /// + + /// Nat gateway associated with this subnet. + /// + + /// An array of service endpoints. + /// + + /// An array of service endpoint policies. + /// + + /// An array of references to private endpoints. + /// + + /// An array of references to the network interface IP configurations using + /// subnet. + /// + + /// Array of IP configuration profiles which reference this subnet. + /// + + /// Array of IpAllocation which reference this subnet. + /// + + /// An array of references to the external resources using subnet. + /// + + /// An array of references to services injecting into this subnet. + /// + + /// An array of references to the delegations on the subnet. + /// + + /// A read-only string identifying the intention of use for this subnet based + /// on delegations and other user-defined properties. + /// + + /// The provisioning state of the subnet resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Enable or Disable apply network policies on private end point in the + /// subnet. + /// Possible values include: 'Enabled', 'Disabled' + + /// Enable or Disable apply network policies on private link service in the + /// subnet. + /// Possible values include: 'Enabled', 'Disabled' + + /// Application gateway IP configurations of virtual network resource. + /// + + /// Set this property to false to disable default outbound connectivity for all + /// VMs in the subnet. This property can only be set at the time of subnet + /// creation and cannot be updated for an existing subnet. + /// + public SubnetPropertiesFormat(string addressPrefix = default(string), System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), SubResource natGateway = default(SubResource), System.Collections.Generic.IList serviceEndpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList serviceEndpointPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurationProfiles = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipAllocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceNavigationLinks = default(System.Collections.Generic.IList), System.Collections.Generic.IList serviceAssociationLinks = default(System.Collections.Generic.IList), System.Collections.Generic.IList delegations = default(System.Collections.Generic.IList), string purpose = default(string), string provisioningState = default(string), string privateEndpointNetworkPolicies = default(string), string privateLinkServiceNetworkPolicies = default(string), System.Collections.Generic.IList applicationGatewayIPConfigurations = default(System.Collections.Generic.IList), bool? defaultOutboundAccess = default(bool?)) + + { + this.AddressPrefix = addressPrefix; + this.AddressPrefixes = addressPrefixes; + this.NetworkSecurityGroup = networkSecurityGroup; + this.RouteTable = routeTable; + this.NatGateway = natGateway; + this.ServiceEndpoints = serviceEndpoints; + this.ServiceEndpointPolicies = serviceEndpointPolicies; + this.PrivateEndpoints = privateEndpoints; + this.IPConfigurations = ipConfigurations; + this.IPConfigurationProfiles = ipConfigurationProfiles; + this.IPAllocations = ipAllocations; + this.ResourceNavigationLinks = resourceNavigationLinks; + this.ServiceAssociationLinks = serviceAssociationLinks; + this.Delegations = delegations; + this.Purpose = purpose; + this.ProvisioningState = provisioningState; + this.PrivateEndpointNetworkPolicies = privateEndpointNetworkPolicies; + this.PrivateLinkServiceNetworkPolicies = privateLinkServiceNetworkPolicies; + this.ApplicationGatewayIPConfigurations = applicationGatewayIPConfigurations; + this.DefaultOutboundAccess = defaultOutboundAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the address prefix for the subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } + + /// + /// Gets or sets list of address prefixes for the subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; set; } + + /// + /// Gets or sets the reference to the NetworkSecurityGroup resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + public NetworkSecurityGroup NetworkSecurityGroup {get; set; } + + /// + /// Gets or sets the reference to the RouteTable resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routeTable")] + public RouteTable RouteTable {get; set; } + + /// + /// Gets or sets nat gateway associated with this subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "natGateway")] + public SubResource NatGateway {get; set; } + + /// + /// Gets or sets an array of service endpoints. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceEndpoints")] + public System.Collections.Generic.IList ServiceEndpoints {get; set; } + + /// + /// Gets or sets an array of service endpoint policies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceEndpointPolicies")] + public System.Collections.Generic.IList ServiceEndpointPolicies {get; set; } + + /// + /// Gets an array of references to private endpoints. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpoints")] + public System.Collections.Generic.IList PrivateEndpoints {get; private set; } + + /// + /// Gets an array of references to the network interface IP configurations + /// using subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } + + /// + /// Gets array of IP configuration profiles which reference this subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurationProfiles")] + public System.Collections.Generic.IList IPConfigurationProfiles {get; private set; } + + /// + /// Gets or sets array of IpAllocation which reference this subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAllocations")] + public System.Collections.Generic.IList IPAllocations {get; set; } + + /// + /// Gets an array of references to the external resources using subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceNavigationLinks")] + public System.Collections.Generic.IList ResourceNavigationLinks {get; private set; } + + /// + /// Gets an array of references to services injecting into this subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceAssociationLinks")] + public System.Collections.Generic.IList ServiceAssociationLinks {get; private set; } + + /// + /// Gets or sets an array of references to the delegations on the subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "delegations")] + public System.Collections.Generic.IList Delegations {get; set; } + + /// + /// Gets a read-only string identifying the intention of use for this subnet + /// based on delegations and other user-defined properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purpose")] + public string Purpose {get; private set; } + + /// + /// Gets the provisioning state of the subnet resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets enable or Disable apply network policies on private end point + /// in the subnet. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointNetworkPolicies")] + public string PrivateEndpointNetworkPolicies {get; set; } + + /// + /// Gets or sets enable or Disable apply network policies on private link + /// service in the subnet. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceNetworkPolicies")] + public string PrivateLinkServiceNetworkPolicies {get; set; } + + /// + /// Gets or sets application gateway IP configurations of virtual network + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationGatewayIPConfigurations")] + public System.Collections.Generic.IList ApplicationGatewayIPConfigurations {get; set; } + + /// + /// Gets or sets set this property to false to disable default outbound + /// connectivity for all VMs in the subnet. This property can only be set at + /// the time of subnet creation and cannot be updated for an existing subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultOutboundAccess")] + public bool? DefaultOutboundAccess {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SwapResource.cs b/src/Network/Network.Management.Sdk/Generated/Models/SwapResource.cs index ec67309d8786..b97f9aac8be0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SwapResource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SwapResource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,25 @@ public SwapResource() /// /// Initializes a new instance of the SwapResource class. /// - /// Resource Id. - /// Resource name. - /// Resource type. + + /// Resource Id. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Swap resource properties + /// public SwapResource(string id = default(string), string name = default(string), string type = default(string), SwapResourceProperties properties = default(SwapResourceProperties)) + { - Id = id; - Name = name; - Type = type; - Properties = properties; + this.Id = id; + this.Name = name; + this.Type = type; + this.Properties = properties; CustomInit(); } @@ -46,28 +50,29 @@ public SwapResource() /// partial void CustomInit(); + /// /// Gets resource Id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// + /// Gets or sets swap resource properties /// - [JsonProperty(PropertyName = "properties")] - public SwapResourceProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SwapResourceProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceListResult.cs index 977aad1559fa..e344bf49b2dc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceListResult.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// SwapResource List with single entry to represent slot type on the - /// specified cloud service. + /// SwapResource List with single entry to represent slot type on the specified + /// cloud service. /// public partial class SwapResourceListResult { @@ -32,9 +24,13 @@ public SwapResourceListResult() /// /// Initializes a new instance of the SwapResourceListResult class. /// - public SwapResourceListResult(IList value = default(IList)) + + /// + /// + public SwapResourceListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,10 +39,11 @@ public SwapResourceListResult() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceProperties.cs index e53893db9b01..c7a6f3035b48 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SwapResourceProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public SwapResourceProperties() /// /// Initializes a new instance of the SwapResourceProperties class. /// - /// Specifies slot info on a cloud service. - /// Possible values include: 'Production', 'Staging' + + /// Specifies slot info on a cloud service + /// Possible values include: 'Production', 'Staging' public SwapResourceProperties(SlotType? slotType = default(SlotType?)) + { - SlotType = slotType; + this.SlotType = slotType; CustomInit(); } @@ -42,12 +38,11 @@ public SwapResourceProperties() /// partial void CustomInit(); + /// - /// Gets or sets specifies slot info on a cloud service. Possible - /// values include: 'Production', 'Staging' + /// Gets or sets specifies slot info on a cloud service Possible values include: 'Production', 'Staging' /// - [JsonProperty(PropertyName = "slotType")] - public SlotType? SlotType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "slotType")] + public SlotType? SlotType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SyncMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/SyncMode.cs index c2a9348bcc90..f9789a4170f5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SyncMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SyncMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SyncMode. /// + + public static class SyncMode { public const string Automatic = "Automatic"; public const string Manual = "Manual"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SyncRemoteAddressSpace.cs b/src/Network/Network.Management.Sdk/Generated/Models/SyncRemoteAddressSpace.cs index 80df58a83add..abe66f5752fc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SyncRemoteAddressSpace.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SyncRemoteAddressSpace.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for SyncRemoteAddressSpace. /// + + public static class SyncRemoteAddressSpace { public const string True = "true"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/SystemData.cs b/src/Network/Network.Management.Sdk/Generated/Models/SystemData.cs index c8f4a089574c..a85d3b9bb1ec 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/SystemData.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/SystemData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,33 @@ public SystemData() /// /// Initializes a new instance of the SystemData class. /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The type of identity that last - /// modified the resource. + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The type of identity that last modified the resource. + /// public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; CustomInit(); } @@ -59,45 +58,41 @@ public SystemData() /// partial void CustomInit(); + /// /// Gets or sets the identity that created the resource. /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } /// /// Gets or sets the timestamp of resource creation (UTC). /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } /// /// Gets or sets the identity that last modified the resource. /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } /// /// Gets or sets the type of identity that last modified the resource. /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TagsObject.cs b/src/Network/Network.Management.Sdk/Generated/Models/TagsObject.cs index 1e51a322492e..431b238e92da 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TagsObject.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TagsObject.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public TagsObject() /// /// Initializes a new instance of the TagsObject class. /// - /// Resource tags. - public TagsObject(IDictionary tags = default(IDictionary)) + + /// Resource tags. + /// + public TagsObject(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -43,11 +38,11 @@ public TagsObject() /// partial void CustomInit(); + /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Topology.cs b/src/Network/Network.Management.Sdk/Generated/Models/Topology.cs index 6b9ebcb33032..f896680b0429 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Topology.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Topology.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,26 @@ public Topology() /// /// Initializes a new instance of the Topology class. /// - /// GUID representing the operation id. - /// The datetime when the topology was - /// initially created for the resource group. - /// The datetime when the topology was last - /// modified. - /// A list of topology resources. - public Topology(string id = default(string), System.DateTime? createdDateTime = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), IList resources = default(IList)) + + /// GUID representing the operation id. + /// + + /// The datetime when the topology was initially created for the resource + /// group. + /// + + /// The datetime when the topology was last modified. + /// + + /// A list of topology resources. + /// + public Topology(string id = default(string), System.DateTime? createdDateTime = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList)) + { - Id = id; - CreatedDateTime = createdDateTime; - LastModified = lastModified; - Resources = resources; + this.Id = id; + this.CreatedDateTime = createdDateTime; + this.LastModified = lastModified; + this.Resources = resources; CustomInit(); } @@ -51,30 +51,30 @@ public Topology() /// partial void CustomInit(); + /// - /// Gets GUID representing the operation id. + /// Gets gUID representing the operation id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// - /// Gets the datetime when the topology was initially created for the - /// resource group. + /// Gets the datetime when the topology was initially created for the resource + /// group. /// - [JsonProperty(PropertyName = "createdDateTime")] - public System.DateTime? CreatedDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDateTime")] + public System.DateTime? CreatedDateTime {get; private set; } /// /// Gets the datetime when the topology was last modified. /// - [JsonProperty(PropertyName = "lastModified")] - public System.DateTime? LastModified { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModified")] + public System.DateTime? LastModified {get; private set; } /// /// Gets or sets a list of topology resources. /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TopologyAssociation.cs b/src/Network/Network.Management.Sdk/Generated/Models/TopologyAssociation.cs index 7b7834155c9e..d96a5068d17c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TopologyAssociation.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TopologyAssociation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,21 @@ public TopologyAssociation() /// /// Initializes a new instance of the TopologyAssociation class. /// - /// The name of the resource that is associated with - /// the parent resource. - /// The ID of the resource that is associated - /// with the parent resource. - /// The association type of the child - /// resource to the parent resource. Possible values include: - /// 'Associated', 'Contains' + + /// The name of the resource that is associated with the parent resource. + /// + + /// The ID of the resource that is associated with the parent resource. + /// + + /// The association type of the child resource to the parent resource. + /// Possible values include: 'Associated', 'Contains' public TopologyAssociation(string name = default(string), string resourceId = default(string), string associationType = default(string)) + { - Name = name; - ResourceId = resourceId; - AssociationType = associationType; + this.Name = name; + this.ResourceId = resourceId; + this.AssociationType = associationType; CustomInit(); } @@ -49,26 +46,26 @@ public TopologyAssociation() /// partial void CustomInit(); + /// - /// Gets or sets the name of the resource that is associated with the - /// parent resource. + /// Gets or sets the name of the resource that is associated with the parent + /// resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the ID of the resource that is associated with the - /// parent resource. + /// Gets or sets the ID of the resource that is associated with the parent + /// resource. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets the association type of the child resource to the - /// parent resource. Possible values include: 'Associated', 'Contains' + /// Gets or sets the association type of the child resource to the parent + /// resource. Possible values include: 'Associated', 'Contains' /// - [JsonProperty(PropertyName = "associationType")] - public string AssociationType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "associationType")] + public string AssociationType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TopologyParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/TopologyParameters.cs index e8e78851dbd1..2ed76e2531d7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TopologyParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TopologyParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public TopologyParameters() /// /// Initializes a new instance of the TopologyParameters class. /// - /// The name of the target - /// resource group to perform topology on. - /// The reference to the Virtual - /// Network resource. - /// The reference to the Subnet - /// resource. + + /// The name of the target resource group to perform topology on. + /// + + /// The reference to the Virtual Network resource. + /// + + /// The reference to the Subnet resource. + /// public TopologyParameters(string targetResourceGroupName = default(string), SubResource targetVirtualNetwork = default(SubResource), SubResource targetSubnet = default(SubResource)) + { - TargetResourceGroupName = targetResourceGroupName; - TargetVirtualNetwork = targetVirtualNetwork; - TargetSubnet = targetSubnet; + this.TargetResourceGroupName = targetResourceGroupName; + this.TargetVirtualNetwork = targetVirtualNetwork; + this.TargetSubnet = targetSubnet; CustomInit(); } @@ -48,24 +46,23 @@ public TopologyParameters() /// partial void CustomInit(); + /// - /// Gets or sets the name of the target resource group to perform - /// topology on. + /// Gets or sets the name of the target resource group to perform topology on. /// - [JsonProperty(PropertyName = "targetResourceGroupName")] - public string TargetResourceGroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGroupName")] + public string TargetResourceGroupName {get; set; } /// /// Gets or sets the reference to the Virtual Network resource. /// - [JsonProperty(PropertyName = "targetVirtualNetwork")] - public SubResource TargetVirtualNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetVirtualNetwork")] + public SubResource TargetVirtualNetwork {get; set; } /// /// Gets or sets the reference to the Subnet resource. /// - [JsonProperty(PropertyName = "targetSubnet")] - public SubResource TargetSubnet { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetSubnet")] + public SubResource TargetSubnet {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TopologyResource.cs b/src/Network/Network.Management.Sdk/Generated/Models/TopologyResource.cs index b5e5fb5c0bc9..2ce361c29b84 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TopologyResource.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TopologyResource.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,26 @@ public TopologyResource() /// /// Initializes a new instance of the TopologyResource class. /// - /// Name of the resource. - /// ID of the resource. - /// Resource location. - /// Holds the associations the resource has - /// with other resources in the resource group. - public TopologyResource(string name = default(string), string id = default(string), string location = default(string), IList associations = default(IList)) + + /// Name of the resource. + /// + + /// ID of the resource. + /// + + /// Resource location. + /// + + /// Holds the associations the resource has with other resources in the + /// resource group. + /// + public TopologyResource(string name = default(string), string id = default(string), string location = default(string), System.Collections.Generic.IList associations = default(System.Collections.Generic.IList)) + { - Name = name; - Id = id; - Location = location; - Associations = associations; + this.Name = name; + this.Id = id; + this.Location = location; + this.Associations = associations; CustomInit(); } @@ -50,30 +51,30 @@ public TopologyResource() /// partial void CustomInit(); + /// /// Gets or sets name of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets ID of the resource. + /// Gets or sets iD of the resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets resource location. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets or sets holds the associations the resource has with other - /// resources in the resource group. + /// Gets or sets holds the associations the resource has with other resources + /// in the resource group. /// - [JsonProperty(PropertyName = "associations")] - public IList Associations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "associations")] + public System.Collections.Generic.IList Associations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsConfigurationProperties.cs index 637d3584cad7..e24162ff850a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsConfigurationProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsConfigurationProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class TrafficAnalyticsConfigurationProperties { /// - /// Initializes a new instance of the - /// TrafficAnalyticsConfigurationProperties class. + /// Initializes a new instance of the TrafficAnalyticsConfigurationProperties class. /// public TrafficAnalyticsConfigurationProperties() { @@ -28,27 +21,32 @@ public TrafficAnalyticsConfigurationProperties() } /// - /// Initializes a new instance of the - /// TrafficAnalyticsConfigurationProperties class. + /// Initializes a new instance of the TrafficAnalyticsConfigurationProperties class. /// - /// Flag to enable/disable traffic - /// analytics. - /// The resource guid of the attached - /// workspace. - /// The location of the attached - /// workspace. - /// Resource Id of the attached - /// workspace. - /// The interval in minutes - /// which would decide how frequently TA service should do flow - /// analytics. + + /// Flag to enable/disable traffic analytics. + /// + + /// The resource guid of the attached workspace. + /// + + /// The location of the attached workspace. + /// + + /// Resource Id of the attached workspace. + /// + + /// The interval in minutes which would decide how frequently TA service should + /// do flow analytics. + /// public TrafficAnalyticsConfigurationProperties(bool? enabled = default(bool?), string workspaceId = default(string), string workspaceRegion = default(string), string workspaceResourceId = default(string), int? trafficAnalyticsInterval = default(int?)) + { - Enabled = enabled; - WorkspaceId = workspaceId; - WorkspaceRegion = workspaceRegion; - WorkspaceResourceId = workspaceResourceId; - TrafficAnalyticsInterval = trafficAnalyticsInterval; + this.Enabled = enabled; + this.WorkspaceId = workspaceId; + this.WorkspaceRegion = workspaceRegion; + this.WorkspaceResourceId = workspaceResourceId; + this.TrafficAnalyticsInterval = trafficAnalyticsInterval; CustomInit(); } @@ -57,36 +55,36 @@ public TrafficAnalyticsConfigurationProperties() /// partial void CustomInit(); + /// /// Gets or sets flag to enable/disable traffic analytics. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// /// Gets or sets the resource guid of the attached workspace. /// - [JsonProperty(PropertyName = "workspaceId")] - public string WorkspaceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId {get; set; } /// /// Gets or sets the location of the attached workspace. /// - [JsonProperty(PropertyName = "workspaceRegion")] - public string WorkspaceRegion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceRegion")] + public string WorkspaceRegion {get; set; } /// /// Gets or sets resource Id of the attached workspace. /// - [JsonProperty(PropertyName = "workspaceResourceId")] - public string WorkspaceResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceResourceId")] + public string WorkspaceResourceId {get; set; } /// - /// Gets or sets the interval in minutes which would decide how - /// frequently TA service should do flow analytics. + /// Gets or sets the interval in minutes which would decide how frequently TA + /// service should do flow analytics. /// - [JsonProperty(PropertyName = "trafficAnalyticsInterval")] - public int? TrafficAnalyticsInterval { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "trafficAnalyticsInterval")] + public int? TrafficAnalyticsInterval {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsProperties.cs index e011c900c826..08f24eab24a1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TrafficAnalyticsProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public TrafficAnalyticsProperties() /// /// Initializes a new instance of the TrafficAnalyticsProperties class. /// - /// Parameters - /// that define the configuration of traffic analytics. + + /// Parameters that define the configuration of traffic analytics. + /// public TrafficAnalyticsProperties(TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration = default(TrafficAnalyticsConfigurationProperties)) + { - NetworkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; + this.NetworkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; CustomInit(); } @@ -42,12 +38,11 @@ public TrafficAnalyticsProperties() /// partial void CustomInit(); + /// - /// Gets or sets parameters that define the configuration of traffic - /// analytics. + /// Gets or sets parameters that define the configuration of traffic analytics. /// - [JsonProperty(PropertyName = "networkWatcherFlowAnalyticsConfiguration")] - public TrafficAnalyticsConfigurationProperties NetworkWatcherFlowAnalyticsConfiguration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkWatcherFlowAnalyticsConfiguration")] + public TrafficAnalyticsConfigurationProperties NetworkWatcherFlowAnalyticsConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TrafficSelectorPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/TrafficSelectorPolicy.cs index e100b5ec3e96..ded76a1f4571 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TrafficSelectorPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TrafficSelectorPolicy.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,14 +23,17 @@ public TrafficSelectorPolicy() /// /// Initializes a new instance of the TrafficSelectorPolicy class. /// - /// A collection of local address - /// spaces in CIDR format. - /// A collection of remote address - /// spaces in CIDR format. - public TrafficSelectorPolicy(IList localAddressRanges, IList remoteAddressRanges) + + /// A collection of local address spaces in CIDR format. + /// + + /// A collection of remote address spaces in CIDR format. + /// + public TrafficSelectorPolicy(System.Collections.Generic.IList localAddressRanges, System.Collections.Generic.IList remoteAddressRanges) + { - LocalAddressRanges = localAddressRanges; - RemoteAddressRanges = remoteAddressRanges; + this.LocalAddressRanges = localAddressRanges; + this.RemoteAddressRanges = remoteAddressRanges; CustomInit(); } @@ -48,34 +42,36 @@ public TrafficSelectorPolicy(IList localAddressRanges, IList rem /// partial void CustomInit(); + /// /// Gets or sets a collection of local address spaces in CIDR format. /// - [JsonProperty(PropertyName = "localAddressRanges")] - public IList LocalAddressRanges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localAddressRanges")] + public System.Collections.Generic.IList LocalAddressRanges {get; set; } /// /// Gets or sets a collection of remote address spaces in CIDR format. /// - [JsonProperty(PropertyName = "remoteAddressRanges")] - public IList RemoteAddressRanges { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteAddressRanges")] + public System.Collections.Generic.IList RemoteAddressRanges {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (LocalAddressRanges == null) + if (this.LocalAddressRanges == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "LocalAddressRanges"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "LocalAddressRanges"); } - if (RemoteAddressRanges == null) + if (this.RemoteAddressRanges == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RemoteAddressRanges"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RemoteAddressRanges"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TransportProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/TransportProtocol.cs index 91ca934bfb5a..7b10e4887d09 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TransportProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TransportProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for TransportProtocol. /// + + public static class TransportProtocol { public const string Udp = "Udp"; public const string Tcp = "Tcp"; public const string All = "All"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingDetails.cs b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingDetails.cs index 3e242d66c369..b209cd97112e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingDetails.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingDetails.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,19 +23,29 @@ public TroubleshootingDetails() /// /// Initializes a new instance of the TroubleshootingDetails class. /// - /// The id of the get troubleshoot operation. - /// Reason type of failure. - /// A summary of troubleshooting. - /// Details on troubleshooting results. - /// List of recommended - /// actions. - public TroubleshootingDetails(string id = default(string), string reasonType = default(string), string summary = default(string), string detail = default(string), IList recommendedActions = default(IList)) + + /// The id of the get troubleshoot operation. + /// + + /// Reason type of failure. + /// + + /// A summary of troubleshooting. + /// + + /// Details on troubleshooting results. + /// + + /// List of recommended actions. + /// + public TroubleshootingDetails(string id = default(string), string reasonType = default(string), string summary = default(string), string detail = default(string), System.Collections.Generic.IList recommendedActions = default(System.Collections.Generic.IList)) + { - Id = id; - ReasonType = reasonType; - Summary = summary; - Detail = detail; - RecommendedActions = recommendedActions; + this.Id = id; + this.ReasonType = reasonType; + this.Summary = summary; + this.Detail = detail; + this.RecommendedActions = recommendedActions; CustomInit(); } @@ -52,35 +54,35 @@ public TroubleshootingDetails() /// partial void CustomInit(); + /// /// Gets or sets the id of the get troubleshoot operation. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets reason type of failure. /// - [JsonProperty(PropertyName = "reasonType")] - public string ReasonType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "reasonType")] + public string ReasonType {get; set; } /// /// Gets or sets a summary of troubleshooting. /// - [JsonProperty(PropertyName = "summary")] - public string Summary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "summary")] + public string Summary {get; set; } /// /// Gets or sets details on troubleshooting results. /// - [JsonProperty(PropertyName = "detail")] - public string Detail { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "detail")] + public string Detail {get; set; } /// /// Gets or sets list of recommended actions. /// - [JsonProperty(PropertyName = "recommendedActions")] - public IList RecommendedActions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "recommendedActions")] + public System.Collections.Generic.IList RecommendedActions {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingParameters.cs index 250b63eb4093..3d334b5ff2af 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingParameters.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Parameters that define the resource to troubleshoot. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class TroubleshootingParameters { /// @@ -32,17 +24,21 @@ public TroubleshootingParameters() /// /// Initializes a new instance of the TroubleshootingParameters class. /// - /// The target resource to - /// troubleshoot. - /// The ID for the storage account to save the - /// troubleshoot result. - /// The path to the blob to save the - /// troubleshoot result in. + + /// The target resource to troubleshoot. + /// + + /// The ID for the storage account to save the troubleshoot result. + /// + + /// The path to the blob to save the troubleshoot result in. + /// public TroubleshootingParameters(string targetResourceId, string storageId, string storagePath) + { - TargetResourceId = targetResourceId; - StorageId = storageId; - StoragePath = storagePath; + this.TargetResourceId = targetResourceId; + this.StorageId = storageId; + this.StoragePath = storagePath; CustomInit(); } @@ -51,46 +47,48 @@ public TroubleshootingParameters(string targetResourceId, string storageId, stri /// partial void CustomInit(); + /// /// Gets or sets the target resource to troubleshoot. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// - /// Gets or sets the ID for the storage account to save the - /// troubleshoot result. + /// Gets or sets the ID for the storage account to save the troubleshoot + /// result. /// - [JsonProperty(PropertyName = "properties.storageId")] - public string StorageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageId")] + public string StorageId {get; set; } /// - /// Gets or sets the path to the blob to save the troubleshoot result - /// in. + /// Gets or sets the path to the blob to save the troubleshoot result in. /// - [JsonProperty(PropertyName = "properties.storagePath")] - public string StoragePath { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storagePath")] + public string StoragePath {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } - if (StorageId == null) + if (this.StorageId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageId"); } - if (StoragePath == null) + if (this.StoragePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "StoragePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StoragePath"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingProperties.cs new file mode 100644 index 000000000000..a68a345c4d4e --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Storage location provided for troubleshoot. + /// + public partial class TroubleshootingProperties + { + /// + /// Initializes a new instance of the TroubleshootingProperties class. + /// + public TroubleshootingProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TroubleshootingProperties class. + /// + + /// The ID for the storage account to save the troubleshoot result. + /// + + /// The path to the blob to save the troubleshoot result in. + /// + public TroubleshootingProperties(string storageId, string storagePath) + + { + this.StorageId = storageId; + this.StoragePath = storagePath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the ID for the storage account to save the troubleshoot + /// result. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageId")] + public string StorageId {get; set; } + + /// + /// Gets or sets the path to the blob to save the troubleshoot result in. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storagePath")] + public string StoragePath {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.StorageId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageId"); + } + if (this.StoragePath == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StoragePath"); + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingRecommendedActions.cs b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingRecommendedActions.cs index 6114622e18d4..24ae52dba804 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingRecommendedActions.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingRecommendedActions.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class TroubleshootingRecommendedActions { /// - /// Initializes a new instance of the TroubleshootingRecommendedActions - /// class. + /// Initializes a new instance of the TroubleshootingRecommendedActions class. /// public TroubleshootingRecommendedActions() { @@ -28,22 +21,28 @@ public TroubleshootingRecommendedActions() } /// - /// Initializes a new instance of the TroubleshootingRecommendedActions - /// class. + /// Initializes a new instance of the TroubleshootingRecommendedActions class. /// - /// ID of the recommended action. - /// Description of recommended - /// actions. - /// The uri linking to a documentation for the - /// recommended troubleshooting actions. - /// The information from the URI for the - /// recommended troubleshooting actions. + + /// ID of the recommended action. + /// + + /// Description of recommended actions. + /// + + /// The uri linking to a documentation for the recommended troubleshooting + /// actions. + /// + + /// The information from the URI for the recommended troubleshooting actions. + /// public TroubleshootingRecommendedActions(string actionId = default(string), string actionText = default(string), string actionUri = default(string), string actionUriText = default(string)) + { - ActionId = actionId; - ActionText = actionText; - ActionUri = actionUri; - ActionUriText = actionUriText; + this.ActionId = actionId; + this.ActionText = actionText; + this.ActionUri = actionUri; + this.ActionUriText = actionUriText; CustomInit(); } @@ -52,31 +51,31 @@ public TroubleshootingRecommendedActions() /// partial void CustomInit(); + /// - /// Gets or sets ID of the recommended action. + /// Gets or sets iD of the recommended action. /// - [JsonProperty(PropertyName = "actionId")] - public string ActionId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actionId")] + public string ActionId {get; set; } /// /// Gets or sets description of recommended actions. /// - [JsonProperty(PropertyName = "actionText")] - public string ActionText { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actionText")] + public string ActionText {get; set; } /// /// Gets or sets the uri linking to a documentation for the recommended /// troubleshooting actions. /// - [JsonProperty(PropertyName = "actionUri")] - public string ActionUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actionUri")] + public string ActionUri {get; set; } /// /// Gets or sets the information from the URI for the recommended /// troubleshooting actions. /// - [JsonProperty(PropertyName = "actionUriText")] - public string ActionUriText { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actionUriText")] + public string ActionUriText {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingResult.cs index c647b3f464f1..c2483e53fa98 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TroubleshootingResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,25 @@ public TroubleshootingResult() /// /// Initializes a new instance of the TroubleshootingResult class. /// - /// The start time of the - /// troubleshooting. - /// The end time of the troubleshooting. - /// The result code of the troubleshooting. - /// Information from troubleshooting. - public TroubleshootingResult(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string code = default(string), IList results = default(IList)) + + /// The start time of the troubleshooting. + /// + + /// The end time of the troubleshooting. + /// + + /// The result code of the troubleshooting. + /// + + /// Information from troubleshooting. + /// + public TroubleshootingResult(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string code = default(string), System.Collections.Generic.IList results = default(System.Collections.Generic.IList)) + { - StartTime = startTime; - EndTime = endTime; - Code = code; - Results = results; + this.StartTime = startTime; + this.EndTime = endTime; + this.Code = code; + this.Results = results; CustomInit(); } @@ -50,29 +50,29 @@ public TroubleshootingResult() /// partial void CustomInit(); + /// /// Gets or sets the start time of the troubleshooting. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; set; } /// /// Gets or sets the end time of the troubleshooting. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime {get; set; } /// /// Gets or sets the result code of the troubleshooting. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets information from troubleshooting. /// - [JsonProperty(PropertyName = "results")] - public IList Results { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "results")] + public System.Collections.Generic.IList Results {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionHealth.cs b/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionHealth.cs index 05be66d2e252..cfe127ebbd20 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionHealth.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionHealth.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,23 +23,30 @@ public TunnelConnectionHealth() /// /// Initializes a new instance of the TunnelConnectionHealth class. /// - /// Tunnel name. - /// Virtual Network Gateway connection - /// status. Possible values include: 'Unknown', 'Connecting', - /// 'Connected', 'NotConnected' - /// The Ingress Bytes Transferred - /// in this connection. - /// The Egress Bytes Transferred - /// in this connection. - /// The time at which - /// connection was established in Utc format. + + /// Tunnel name. + /// + + /// Virtual Network Gateway connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// The Ingress Bytes Transferred in this connection. + /// + + /// The Egress Bytes Transferred in this connection. + /// + + /// The time at which connection was established in Utc format. + /// public TunnelConnectionHealth(string tunnel = default(string), string connectionStatus = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), string lastConnectionEstablishedUtcTime = default(string)) + { - Tunnel = tunnel; - ConnectionStatus = connectionStatus; - IngressBytesTransferred = ingressBytesTransferred; - EgressBytesTransferred = egressBytesTransferred; - LastConnectionEstablishedUtcTime = lastConnectionEstablishedUtcTime; + this.Tunnel = tunnel; + this.ConnectionStatus = connectionStatus; + this.IngressBytesTransferred = ingressBytesTransferred; + this.EgressBytesTransferred = egressBytesTransferred; + this.LastConnectionEstablishedUtcTime = lastConnectionEstablishedUtcTime; CustomInit(); } @@ -54,36 +55,35 @@ public TunnelConnectionHealth() /// partial void CustomInit(); + /// /// Gets tunnel name. /// - [JsonProperty(PropertyName = "tunnel")] - public string Tunnel { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnel")] + public string Tunnel {get; private set; } /// - /// Gets virtual Network Gateway connection status. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "connectionStatus")] - public string ConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } /// /// Gets the Ingress Bytes Transferred in this connection. /// - [JsonProperty(PropertyName = "ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } /// /// Gets the Egress Bytes Transferred in this connection. /// - [JsonProperty(PropertyName = "egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } /// /// Gets the time at which connection was established in Utc format. /// - [JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] - public string LastConnectionEstablishedUtcTime { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] + public string LastConnectionEstablishedUtcTime {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionStatus.cs index ffa5755c7686..29bae2ee9496 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/TunnelConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for TunnelConnectionStatus. /// + + public static class TunnelConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class TunnelConnectionStatus public const string Connected = "Connected"; public const string NotConnected = "NotConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/UnprepareNetworkPoliciesRequest.cs b/src/Network/Network.Management.Sdk/Generated/Models/UnprepareNetworkPoliciesRequest.cs index 74af81b0c4c5..a8eb44ddf329 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/UnprepareNetworkPoliciesRequest.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/UnprepareNetworkPoliciesRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class UnprepareNetworkPoliciesRequest { /// - /// Initializes a new instance of the UnprepareNetworkPoliciesRequest - /// class. + /// Initializes a new instance of the UnprepareNetworkPoliciesRequest class. /// public UnprepareNetworkPoliciesRequest() { @@ -28,14 +21,15 @@ public UnprepareNetworkPoliciesRequest() } /// - /// Initializes a new instance of the UnprepareNetworkPoliciesRequest - /// class. + /// Initializes a new instance of the UnprepareNetworkPoliciesRequest class. /// - /// The name of the service for which subnet - /// is being unprepared for. + + /// The name of the service for which subnet is being unprepared for. + /// public UnprepareNetworkPoliciesRequest(string serviceName = default(string)) + { - ServiceName = serviceName; + this.ServiceName = serviceName; CustomInit(); } @@ -44,12 +38,12 @@ public UnprepareNetworkPoliciesRequest() /// partial void CustomInit(); + /// - /// Gets or sets the name of the service for which subnet is being - /// unprepared for. + /// Gets or sets the name of the service for which subnet is being unprepared + /// for. /// - [JsonProperty(PropertyName = "serviceName")] - public string ServiceName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/Usage.cs b/src/Network/Network.Management.Sdk/Generated/Models/Usage.cs index 06aa23ed1614..bf24d98e38cf 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/Usage.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/Usage.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,16 +23,25 @@ public Usage() /// /// Initializes a new instance of the Usage class. /// - /// The current value of the usage. - /// The limit of usage. - /// The name of the type of usage. - /// Resource identifier. + + /// Resource identifier. + /// + + /// The current value of the usage. + /// + + /// The limit of usage. + /// + + /// The name of the type of usage. + /// public Usage(long currentValue, long limit, UsageName name, string id = default(string)) + { - Id = id; - CurrentValue = currentValue; - Limit = limit; - Name = name; + this.Id = id; + this.CurrentValue = currentValue; + this.Limit = limit; + this.Name = name; CustomInit(); } /// @@ -55,48 +57,50 @@ static Usage() /// partial void CustomInit(); + /// /// Gets resource identifier. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets the current value of the usage. /// - [JsonProperty(PropertyName = "currentValue")] - public long CurrentValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + public long CurrentValue {get; set; } /// /// Gets or sets the limit of usage. /// - [JsonProperty(PropertyName = "limit")] - public long Limit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public long Limit {get; set; } /// /// Gets or sets the name of the type of usage. /// - [JsonProperty(PropertyName = "name")] - public UsageName Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public UsageName Name {get; set; } /// - /// An enum describing the unit of measurement. + /// Gets or sets an enum describing the unit of measurement. /// - [JsonProperty(PropertyName = "unit")] - public static string Unit { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public static string Unit {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/UsageName.cs b/src/Network/Network.Management.Sdk/Generated/Models/UsageName.cs index 26cd2082e78d..cd803951492b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/UsageName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/UsageName.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public UsageName() /// /// Initializes a new instance of the UsageName class. /// - /// A string describing the resource name. - /// A localized string describing the - /// resource name. + + /// A string describing the resource name. + /// + + /// A localized string describing the resource name. + /// public UsageName(string value = default(string), string localizedValue = default(string)) + { - Value = value; - LocalizedValue = localizedValue; + this.Value = value; + this.LocalizedValue = localizedValue; CustomInit(); } @@ -44,17 +42,17 @@ public UsageName() /// partial void CustomInit(); + /// /// Gets or sets a string describing the resource name. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Gets or sets a localized string describing the resource name. /// - [JsonProperty(PropertyName = "localizedValue")] - public string LocalizedValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/UsageUnit.cs b/src/Network/Network.Management.Sdk/Generated/Models/UsageUnit.cs new file mode 100644 index 000000000000..dade0c861813 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/UsageUnit.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for UsageUnit. + /// + + + public static class UsageUnit + { + public const string Count = "Count"; + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/UseHubGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/UseHubGateway.cs index 6bf6370a4632..0990107e636d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/UseHubGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/UseHubGateway.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for UseHubGateway. /// + + public static class UseHubGateway { public const string False = "False"; public const string True = "True"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VM.cs b/src/Network/Network.Management.Sdk/Generated/Models/VM.cs index accfc00a32e2..49b762d12ad0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VM.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VM.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -30,13 +23,24 @@ public VM() /// /// Initializes a new instance of the VM class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - public VM(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + public VM(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, location, tags) { CustomInit(); } @@ -47,4 +51,4 @@ public VM() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VerbosityLevel.cs b/src/Network/Network.Management.Sdk/Generated/Models/VerbosityLevel.cs index a22faf6b7880..c83c6becf9be 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VerbosityLevel.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VerbosityLevel.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VerbosityLevel. /// + + public static class VerbosityLevel { public const string Normal = "Normal"; public const string Minimum = "Minimum"; public const string Full = "Full"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowParameters.cs index 624704124589..f992c42fc5f7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VerificationIPFlowParameters { /// - /// Initializes a new instance of the VerificationIPFlowParameters - /// class. + /// Initializes a new instance of the VerificationIPFlowParameters class. /// public VerificationIPFlowParameters() { @@ -29,38 +21,48 @@ public VerificationIPFlowParameters() } /// - /// Initializes a new instance of the VerificationIPFlowParameters - /// class. + /// Initializes a new instance of the VerificationIPFlowParameters class. /// - /// The ID of the target resource to - /// perform next-hop on. - /// The direction of the packet represented as - /// a 5-tuple. Possible values include: 'Inbound', 'Outbound' - /// Protocol to be verified on. Possible values - /// include: 'TCP', 'UDP' - /// 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. - /// 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. - /// The local IP address. Acceptable - /// values are valid IPv4 addresses. - /// The remote IP address. Acceptable - /// values are valid IPv4 addresses. - /// 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). + + /// The ID of the target resource to perform next-hop on. + /// + + /// The direction of the packet represented as a 5-tuple. + /// Possible values include: 'Inbound', 'Outbound' + + /// Protocol to be verified on. + /// Possible values include: 'TCP', 'UDP' + + /// 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. + /// + + /// 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. + /// + + /// The local IP address. Acceptable values are valid IPv4 addresses. + /// + + /// The remote IP address. Acceptable values are valid IPv4 addresses. + /// + + /// 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). + /// public VerificationIPFlowParameters(string targetResourceId, string direction, string protocol, string localPort, string remotePort, string localIPAddress, string remoteIPAddress, string targetNicResourceId = default(string)) + { - TargetResourceId = targetResourceId; - Direction = direction; - Protocol = protocol; - LocalPort = localPort; - RemotePort = remotePort; - LocalIPAddress = localIPAddress; - RemoteIPAddress = remoteIPAddress; - TargetNicResourceId = targetNicResourceId; + this.TargetResourceId = targetResourceId; + this.Direction = direction; + this.Protocol = protocol; + this.LocalPort = localPort; + this.RemotePort = remotePort; + this.LocalIPAddress = localIPAddress; + this.RemoteIPAddress = remoteIPAddress; + this.TargetNicResourceId = targetNicResourceId; CustomInit(); } @@ -69,100 +71,106 @@ public VerificationIPFlowParameters() /// partial void CustomInit(); + /// /// Gets or sets the ID of the target resource to perform next-hop on. /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } /// - /// Gets or sets the direction of the packet represented as a 5-tuple. - /// Possible values include: 'Inbound', 'Outbound' + /// Gets or sets the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "direction")] - public string Direction { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public string Direction {get; set; } /// - /// Gets or sets protocol to be verified on. Possible values include: - /// 'TCP', 'UDP' + /// Gets or sets protocol to be verified on. Possible values include: 'TCP', 'UDP' /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public string Protocol {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "localPort")] - public string LocalPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localPort")] + public string LocalPort {get; set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "remotePort")] - public string RemotePort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "remotePort")] + public string RemotePort {get; set; } /// /// Gets or sets the local IP address. Acceptable values are valid IPv4 /// addresses. /// - [JsonProperty(PropertyName = "localIPAddress")] - public string LocalIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localIPAddress")] + public string LocalIPAddress {get; set; } /// - /// Gets or sets the remote IP address. Acceptable values are valid - /// IPv4 addresses. + /// Gets or sets the remote IP address. Acceptable values are valid IPv4 + /// addresses. /// - [JsonProperty(PropertyName = "remoteIPAddress")] - public string RemoteIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteIPAddress")] + public string RemoteIPAddress {get; set; } /// - /// Gets or sets 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). + /// Gets or sets 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). /// - [JsonProperty(PropertyName = "targetNicResourceId")] - public string TargetNicResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetNicResourceId")] + public string TargetNicResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (TargetResourceId == null) + if (this.TargetResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TargetResourceId"); } - if (Direction == null) + if (this.Direction == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Direction"); } - if (Protocol == null) + if (this.Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } - if (LocalPort == null) + if (this.LocalPort == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "LocalPort"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "LocalPort"); } - if (RemotePort == null) + if (this.RemotePort == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RemotePort"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RemotePort"); } - if (LocalIPAddress == null) + if (this.LocalIPAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "LocalIPAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "LocalIPAddress"); } - if (RemoteIPAddress == null) + if (this.RemoteIPAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RemoteIPAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RemoteIPAddress"); } + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowResult.cs index 3b9c417e0f28..3b7826308290 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VerificationIPFlowResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,18 @@ public VerificationIPFlowResult() /// /// Initializes a new instance of the VerificationIPFlowResult class. /// - /// Indicates whether the traffic is allowed or - /// denied. Possible values include: 'Allow', 'Deny' - /// Name of the rule. If input is not matched - /// against any security rule, it is not displayed. + + /// Indicates whether the traffic is allowed or denied. + /// Possible values include: 'Allow', 'Deny' + + /// Name of the rule. If input is not matched against any security rule, it is + /// not displayed. + /// public VerificationIPFlowResult(string access = default(string), string ruleName = default(string)) + { - Access = access; - RuleName = ruleName; + this.Access = access; + this.RuleName = ruleName; CustomInit(); } @@ -45,19 +43,18 @@ public VerificationIPFlowResult() /// partial void CustomInit(); + /// - /// Gets or sets indicates whether the traffic is allowed or denied. - /// Possible values include: 'Allow', 'Deny' + /// Gets or sets indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; set; } /// - /// Gets or sets name of the rule. If input is not matched against any - /// security rule, it is not displayed. + /// Gets or sets name of the rule. If input is not matched against any security + /// rule, it is not displayed. /// - [JsonProperty(PropertyName = "ruleName")] - public string RuleName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleName")] + public string RuleName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceAdditionalNicProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceAdditionalNicProperties.cs index 711de9634add..95f4ced95f2f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceAdditionalNicProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceAdditionalNicProperties.cs @@ -1,20 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Network Virtual Appliance Additional Nic Properties + /// Network Virtual Appliance Additional NIC properties. /// /// /// Network Virtual Appliance Additional NIC properties. @@ -22,8 +16,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualApplianceAdditionalNicProperties { /// - /// Initializes a new instance of the - /// VirtualApplianceAdditionalNicProperties class. + /// Initializes a new instance of the VirtualApplianceAdditionalNicProperties class. /// public VirtualApplianceAdditionalNicProperties() { @@ -31,16 +24,19 @@ public VirtualApplianceAdditionalNicProperties() } /// - /// Initializes a new instance of the - /// VirtualApplianceAdditionalNicProperties class. + /// Initializes a new instance of the VirtualApplianceAdditionalNicProperties class. /// - /// Name of additional nic - /// Flag (true or false) for Intent for - /// Public Ip on additional nic - public VirtualApplianceAdditionalNicProperties(string name = default(string), bool? hasPublicIp = default(bool?)) + + /// Name of additional nic + /// + + /// Flag (true or false) for Intent for Public Ip on additional nic + /// + public VirtualApplianceAdditionalNicProperties(string name = default(string), bool? hasPublicIP = default(bool?)) + { - Name = name; - HasPublicIp = hasPublicIp; + this.Name = name; + this.HasPublicIP = hasPublicIP; CustomInit(); } @@ -49,18 +45,18 @@ public VirtualApplianceAdditionalNicProperties() /// partial void CustomInit(); + /// /// Gets or sets name of additional nic /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets flag (true or false) for Intent for Public Ip on - /// additional nic + /// Gets or sets flag (true or false) for Intent for Public Ip on additional + /// nic /// - [JsonProperty(PropertyName = "hasPublicIp")] - public bool? HasPublicIp { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hasPublicIp")] + public bool? HasPublicIP {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceNicProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceNicProperties.cs index cd22985d2673..45c30e0354f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceNicProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceNicProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualApplianceNicProperties { /// - /// Initializes a new instance of the VirtualApplianceNicProperties - /// class. + /// Initializes a new instance of the VirtualApplianceNicProperties class. /// public VirtualApplianceNicProperties() { @@ -28,20 +21,27 @@ public VirtualApplianceNicProperties() } /// - /// Initializes a new instance of the VirtualApplianceNicProperties - /// class. + /// Initializes a new instance of the VirtualApplianceNicProperties class. /// - /// NIC name. - /// Public IP address. - /// Private IP address. - /// Instance on which nic is - /// attached. - public VirtualApplianceNicProperties(string name = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string instanceName = default(string)) + + /// NIC name. + /// + + /// Public IP address. + /// + + /// Private IP address. + /// + + /// Instance on which nic is attached. + /// + public VirtualApplianceNicProperties(string name = default(string), string publicIPAddress = default(string), string privateIPAddress = default(string), string instanceName = default(string)) + { - Name = name; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; - InstanceName = instanceName; + this.Name = name; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; + this.InstanceName = instanceName; CustomInit(); } @@ -50,29 +50,29 @@ public VirtualApplianceNicProperties() /// partial void CustomInit(); + /// - /// Gets NIC name. + /// Gets nIC name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets public IP address. /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIPAddress {get; private set; } /// /// Gets private IP address. /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIPAddress {get; private set; } /// /// Gets instance on which nic is attached. /// - [JsonProperty(PropertyName = "instanceName")] - public string InstanceName { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceName")] + public string InstanceName {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSite.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSite.cs index 4d350d17b0b2..d7c7f35243e7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSite.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSite.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Virtual Appliance Site resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualApplianceSite : SubResource { /// @@ -32,25 +24,37 @@ public VirtualApplianceSite() /// /// Initializes a new instance of the VirtualApplianceSite class. /// - /// Resource ID. - /// Address Prefix. - /// Office 365 Policy. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Name of the virtual appliance site. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Site type. - public VirtualApplianceSite(string id = default(string), string addressPrefix = default(string), Office365PolicyProperties o365Policy = default(Office365PolicyProperties), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the virtual appliance site. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Site type. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Address Prefix. + /// + + /// Office 365 Policy. + /// + public VirtualApplianceSite(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string addressPrefix = default(string), Office365PolicyProperties o365Policy = default(Office365PolicyProperties)) + + : base(id) { - AddressPrefix = addressPrefix; - O365Policy = o365Policy; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AddressPrefix = addressPrefix; + this.O365Policy = o365Policy; CustomInit(); } @@ -59,43 +63,42 @@ public VirtualApplianceSite() /// partial void CustomInit(); + /// - /// Gets or sets address Prefix. + /// Gets or sets name of the virtual appliance site. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets office 365 Policy. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.o365Policy")] - public Office365PolicyProperties O365Policy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets site type. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the virtual appliance site. + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets address Prefix. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; set; } /// - /// Gets site type. + /// Gets or sets office 365 Policy. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.o365Policy")] + public Office365PolicyProperties O365Policy {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSiteProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSiteProperties.cs new file mode 100644 index 000000000000..5fc85d36f390 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSiteProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the rule group. + /// + public partial class VirtualApplianceSiteProperties + { + /// + /// Initializes a new instance of the VirtualApplianceSiteProperties class. + /// + public VirtualApplianceSiteProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualApplianceSiteProperties class. + /// + + /// Address Prefix. + /// + + /// Office 365 Policy. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VirtualApplianceSiteProperties(string addressPrefix = default(string), Office365PolicyProperties o365Policy = default(Office365PolicyProperties), string provisioningState = default(string)) + + { + this.AddressPrefix = addressPrefix; + this.O365Policy = o365Policy; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets address Prefix. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } + + /// + /// Gets or sets office 365 Policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "o365Policy")] + public Office365PolicyProperties O365Policy {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSkuProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSkuProperties.cs index b6c24deff7a5..1ab27b04aeef 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSkuProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualApplianceSkuProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualApplianceSkuProperties { /// - /// Initializes a new instance of the VirtualApplianceSkuProperties - /// class. + /// Initializes a new instance of the VirtualApplianceSkuProperties class. /// public VirtualApplianceSkuProperties() { @@ -28,18 +21,23 @@ public VirtualApplianceSkuProperties() } /// - /// Initializes a new instance of the VirtualApplianceSkuProperties - /// class. + /// Initializes a new instance of the VirtualApplianceSkuProperties class. /// - /// Virtual Appliance Vendor. - /// Virtual Appliance Scale - /// Unit. - /// Virtual Appliance Version. + + /// Virtual Appliance Vendor. + /// + + /// Virtual Appliance Scale Unit. + /// + + /// Virtual Appliance Version. + /// public VirtualApplianceSkuProperties(string vendor = default(string), string bundledScaleUnit = default(string), string marketPlaceVersion = default(string)) + { - Vendor = vendor; - BundledScaleUnit = bundledScaleUnit; - MarketPlaceVersion = marketPlaceVersion; + this.Vendor = vendor; + this.BundledScaleUnit = bundledScaleUnit; + this.MarketPlaceVersion = marketPlaceVersion; CustomInit(); } @@ -48,23 +46,23 @@ public VirtualApplianceSkuProperties() /// partial void CustomInit(); + /// /// Gets or sets virtual Appliance Vendor. /// - [JsonProperty(PropertyName = "vendor")] - public string Vendor { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vendor")] + public string Vendor {get; set; } /// /// Gets or sets virtual Appliance Scale Unit. /// - [JsonProperty(PropertyName = "bundledScaleUnit")] - public string BundledScaleUnit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bundledScaleUnit")] + public string BundledScaleUnit {get; set; } /// /// Gets or sets virtual Appliance Version. /// - [JsonProperty(PropertyName = "marketPlaceVersion")] - public string MarketPlaceVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "marketPlaceVersion")] + public string MarketPlaceVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHub.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHub.cs index e628756fcd4b..1fb434f29923 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHub.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHub.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VirtualHub Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualHub : Resource { /// @@ -34,85 +24,122 @@ public VirtualHub() /// /// Initializes a new instance of the VirtualHub class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The VirtualWAN to which the VirtualHub - /// belongs. - /// The VpnGateway associated with this - /// VirtualHub. - /// The P2SVpnGateway associated with this - /// VirtualHub. - /// The expressRouteGateway - /// associated with this VirtualHub. - /// The azureFirewall associated with this - /// VirtualHub. - /// The securityPartnerProvider - /// associated with this VirtualHub. - /// Address-prefix for this - /// VirtualHub. - /// The routeTable associated with this - /// virtual hub. - /// The provisioning state of the - /// virtual hub resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The Security Provider - /// name. - /// List of all virtual hub route - /// table v2s associated with this VirtualHub. - /// The sku of this VirtualHub. - /// The routing state. Possible values - /// include: 'None', 'Provisioned', 'Provisioning', 'Failed' - /// List of references to Bgp - /// Connections. - /// List of references to - /// IpConfigurations. - /// List of references to RouteMaps. - /// VirtualRouter ASN. - /// VirtualRouter IPs. - /// Flag to control transit - /// for VirtualRouter hub. - /// The preferred gateway to - /// route on-prem traffic. Possible values include: 'ExpressRoute', - /// 'VpnGateway', 'None' - /// The hubRoutingPreference of this - /// VirtualHub. Possible values include: 'ExpressRoute', 'VpnGateway', - /// 'ASPath' - /// The VirtualHub - /// Router autoscale configuration. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Kind of service virtual hub. This is metadata - /// used for the Azure portal experience for Route Server. - public VirtualHub(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualWan = default(SubResource), SubResource vpnGateway = default(SubResource), SubResource p2SVpnGateway = default(SubResource), SubResource expressRouteGateway = default(SubResource), SubResource azureFirewall = default(SubResource), SubResource securityPartnerProvider = default(SubResource), string addressPrefix = default(string), VirtualHubRouteTable routeTable = default(VirtualHubRouteTable), string provisioningState = default(string), string securityProviderName = default(string), IList virtualHubRouteTableV2s = default(IList), string sku = default(string), string routingState = default(string), IList bgpConnections = default(IList), IList ipConfigurations = default(IList), IList routeMaps = default(IList), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string preferredRoutingGateway = default(string), string hubRoutingPreference = default(string), VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration = default(VirtualRouterAutoScaleConfiguration), string etag = default(string), string kind = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Kind of service virtual hub. This is metadata used for the Azure portal + /// experience for Route Server. + /// + + /// The provisioning state of the virtual hub resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The routing state. + /// Possible values include: 'None', 'Provisioned', 'Provisioning', 'Failed' + + /// The VirtualWAN to which the VirtualHub belongs. + /// + + /// The VpnGateway associated with this VirtualHub. + /// + + /// The P2SVpnGateway associated with this VirtualHub. + /// + + /// The expressRouteGateway associated with this VirtualHub. + /// + + /// The azureFirewall associated with this VirtualHub. + /// + + /// The securityPartnerProvider associated with this VirtualHub. + /// + + /// Address-prefix for this VirtualHub. + /// + + /// The routeTable associated with this virtual hub. + /// + + /// The Security Provider name. + /// + + /// List of all virtual hub route table v2s associated with this VirtualHub. + /// + + /// The sku of this VirtualHub. + /// + + /// List of references to Bgp Connections. + /// + + /// List of references to IpConfigurations. + /// + + /// List of references to RouteMaps. + /// + + /// VirtualRouter ASN. + /// + + /// VirtualRouter IPs. + /// + + /// Flag to control transit for VirtualRouter hub. + /// + + /// The preferred gateway to route on-prem traffic + /// Possible values include: 'ExpressRoute', 'VpnGateway', 'None' + + /// The hubRoutingPreference of this VirtualHub. + /// Possible values include: 'ExpressRoute', 'VpnGateway', 'ASPath' + + /// The VirtualHub Router autoscale configuration. + /// + public VirtualHub(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string kind = default(string), string provisioningState = default(string), string routingState = default(string), SubResource virtualWan = default(SubResource), SubResource vpnGateway = default(SubResource), SubResource p2SVpnGateway = default(SubResource), SubResource expressRouteGateway = default(SubResource), SubResource azureFirewall = default(SubResource), SubResource securityPartnerProvider = default(SubResource), string addressPrefix = default(string), VirtualHubRouteTable routeTable = default(VirtualHubRouteTable), string securityProviderName = default(string), System.Collections.Generic.IList virtualHubRouteTableV2S = default(System.Collections.Generic.IList), string sku = default(string), System.Collections.Generic.IList bgpConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList routeMaps = default(System.Collections.Generic.IList), long? virtualRouterAsn = default(long?), System.Collections.Generic.IList virtualRouterIps = default(System.Collections.Generic.IList), bool? allowBranchToBranchTraffic = default(bool?), string preferredRoutingGateway = default(string), string hubRoutingPreference = default(string), VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration = default(VirtualRouterAutoScaleConfiguration)) + + : base(id, name, type, location, tags) { - VirtualWan = virtualWan; - VpnGateway = vpnGateway; - P2SVpnGateway = p2SVpnGateway; - ExpressRouteGateway = expressRouteGateway; - AzureFirewall = azureFirewall; - SecurityPartnerProvider = securityPartnerProvider; - AddressPrefix = addressPrefix; - RouteTable = routeTable; - ProvisioningState = provisioningState; - SecurityProviderName = securityProviderName; - VirtualHubRouteTableV2s = virtualHubRouteTableV2s; - Sku = sku; - RoutingState = routingState; - BgpConnections = bgpConnections; - IpConfigurations = ipConfigurations; - RouteMaps = routeMaps; - VirtualRouterAsn = virtualRouterAsn; - VirtualRouterIps = virtualRouterIps; - AllowBranchToBranchTraffic = allowBranchToBranchTraffic; - PreferredRoutingGateway = preferredRoutingGateway; - HubRoutingPreference = hubRoutingPreference; - VirtualRouterAutoScaleConfiguration = virtualRouterAutoScaleConfiguration; - Etag = etag; - Kind = kind; + this.Etag = etag; + this.Kind = kind; + this.ProvisioningState = provisioningState; + this.RoutingState = routingState; + this.VirtualWan = virtualWan; + this.VpnGateway = vpnGateway; + this.P2SVpnGateway = p2SVpnGateway; + this.ExpressRouteGateway = expressRouteGateway; + this.AzureFirewall = azureFirewall; + this.SecurityPartnerProvider = securityPartnerProvider; + this.AddressPrefix = addressPrefix; + this.RouteTable = routeTable; + this.SecurityProviderName = securityProviderName; + this.VirtualHubRouteTableV2S = virtualHubRouteTableV2S; + this.Sku = sku; + this.BgpConnections = bgpConnections; + this.IPConfigurations = ipConfigurations; + this.RouteMaps = routeMaps; + this.VirtualRouterAsn = virtualRouterAsn; + this.VirtualRouterIps = virtualRouterIps; + this.AllowBranchToBranchTraffic = allowBranchToBranchTraffic; + this.PreferredRoutingGateway = preferredRoutingGateway; + this.HubRoutingPreference = hubRoutingPreference; + this.VirtualRouterAutoScaleConfiguration = virtualRouterAutoScaleConfiguration; CustomInit(); } @@ -121,182 +148,197 @@ public VirtualHub() /// partial void CustomInit(); + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets kind of service virtual hub. This is metadata used for the Azure + /// portal experience for Route Server. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; private set; } + + /// + /// Gets the provisioning state of the virtual hub resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the routing state. Possible values include: 'None', 'Provisioned', 'Provisioning', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingState")] + public string RoutingState {get; private set; } + /// /// Gets or sets the VirtualWAN to which the VirtualHub belongs. /// - [JsonProperty(PropertyName = "properties.virtualWan")] - public SubResource VirtualWan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualWan")] + public SubResource VirtualWan {get; set; } /// /// Gets or sets the VpnGateway associated with this VirtualHub. /// - [JsonProperty(PropertyName = "properties.vpnGateway")] - public SubResource VpnGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnGateway")] + public SubResource VpnGateway {get; set; } /// /// Gets or sets the P2SVpnGateway associated with this VirtualHub. /// - [JsonProperty(PropertyName = "properties.p2SVpnGateway")] - public SubResource P2SVpnGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.p2SVpnGateway")] + public SubResource P2SVpnGateway {get; set; } /// - /// Gets or sets the expressRouteGateway associated with this - /// VirtualHub. + /// Gets or sets the expressRouteGateway associated with this VirtualHub. /// - [JsonProperty(PropertyName = "properties.expressRouteGateway")] - public SubResource ExpressRouteGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteGateway")] + public SubResource ExpressRouteGateway {get; set; } /// /// Gets or sets the azureFirewall associated with this VirtualHub. /// - [JsonProperty(PropertyName = "properties.azureFirewall")] - public SubResource AzureFirewall { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azureFirewall")] + public SubResource AzureFirewall {get; set; } /// - /// Gets or sets the securityPartnerProvider associated with this - /// VirtualHub. + /// Gets or sets the securityPartnerProvider associated with this VirtualHub. /// - [JsonProperty(PropertyName = "properties.securityPartnerProvider")] - public SubResource SecurityPartnerProvider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityPartnerProvider")] + public SubResource SecurityPartnerProvider {get; set; } /// /// Gets or sets address-prefix for this VirtualHub. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] - public string AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix {get; set; } /// /// Gets or sets the routeTable associated with this virtual hub. /// - [JsonProperty(PropertyName = "properties.routeTable")] - public VirtualHubRouteTable RouteTable { get; set; } - - /// - /// Gets the provisioning state of the virtual hub resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeTable")] + public VirtualHubRouteTable RouteTable {get; set; } /// /// Gets or sets the Security Provider name. /// - [JsonProperty(PropertyName = "properties.securityProviderName")] - public string SecurityProviderName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProviderName")] + public string SecurityProviderName {get; set; } /// - /// Gets or sets list of all virtual hub route table v2s associated - /// with this VirtualHub. + /// Gets or sets list of all virtual hub route table v2s associated with this + /// VirtualHub. /// - [JsonProperty(PropertyName = "properties.virtualHubRouteTableV2s")] - public IList VirtualHubRouteTableV2s { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHubRouteTableV2s")] + public System.Collections.Generic.IList VirtualHubRouteTableV2S {get; set; } /// /// Gets or sets the sku of this VirtualHub. /// - [JsonProperty(PropertyName = "properties.sku")] - public string Sku { get; set; } - - /// - /// Gets or sets the routing state. Possible values include: 'None', - /// 'Provisioned', 'Provisioning', 'Failed' - /// - [JsonProperty(PropertyName = "properties.routingState")] - public string RoutingState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public string Sku {get; set; } /// /// Gets list of references to Bgp Connections. /// - [JsonProperty(PropertyName = "properties.bgpConnections")] - public IList BgpConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpConnections")] + public System.Collections.Generic.IList BgpConnections {get; private set; } /// /// Gets list of references to IpConfigurations. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } /// /// Gets list of references to RouteMaps. /// - [JsonProperty(PropertyName = "properties.routeMaps")] - public IList RouteMaps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeMaps")] + public System.Collections.Generic.IList RouteMaps {get; private set; } /// /// Gets or sets virtualRouter ASN. /// - [JsonProperty(PropertyName = "properties.virtualRouterAsn")] - public long? VirtualRouterAsn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualRouterAsn")] + public long? VirtualRouterAsn {get; set; } /// /// Gets or sets virtualRouter IPs. /// - [JsonProperty(PropertyName = "properties.virtualRouterIps")] - public IList VirtualRouterIps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualRouterIps")] + public System.Collections.Generic.IList VirtualRouterIps {get; set; } /// /// Gets or sets flag to control transit for VirtualRouter hub. /// - [JsonProperty(PropertyName = "properties.allowBranchToBranchTraffic")] - public bool? AllowBranchToBranchTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowBranchToBranchTraffic")] + public bool? AllowBranchToBranchTraffic {get; set; } /// - /// Gets or sets the preferred gateway to route on-prem traffic. - /// Possible values include: 'ExpressRoute', 'VpnGateway', 'None' + /// Gets or sets the preferred gateway to route on-prem traffic Possible values include: 'ExpressRoute', 'VpnGateway', 'None' /// - [JsonProperty(PropertyName = "properties.preferredRoutingGateway")] - public string PreferredRoutingGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.preferredRoutingGateway")] + public string PreferredRoutingGateway {get; set; } /// - /// Gets or sets the hubRoutingPreference of this VirtualHub. Possible - /// values include: 'ExpressRoute', 'VpnGateway', 'ASPath' + /// Gets or sets the hubRoutingPreference of this VirtualHub. Possible values include: 'ExpressRoute', 'VpnGateway', 'ASPath' /// - [JsonProperty(PropertyName = "properties.hubRoutingPreference")] - public string HubRoutingPreference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hubRoutingPreference")] + public string HubRoutingPreference {get; set; } /// /// Gets or sets the VirtualHub Router autoscale configuration. /// - [JsonProperty(PropertyName = "properties.virtualRouterAutoScaleConfiguration")] - public VirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets kind of service virtual hub. This is metadata used for the - /// Azure portal experience for Route Server. - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualRouterAutoScaleConfiguration")] + public VirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualRouterAsn != null) + + + + + + + + + + + + + + + + + + + if (this.VirtualRouterAsn != null) { - if (VirtualRouterAsn > 4294967295) + if (this.VirtualRouterAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); } - if (VirtualRouterAsn < 0) + if (this.VirtualRouterAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); } } - if (VirtualRouterAutoScaleConfiguration != null) + + + + if (this.VirtualRouterAutoScaleConfiguration != null) { - VirtualRouterAutoScaleConfiguration.Validate(); + this.VirtualRouterAutoScaleConfiguration.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRoute.cs index de9580058c00..8542a3b021c1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRoute.cs @@ -1,23 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The effective route configured on the virtual hub or specified - /// resource. + /// The effective route configured on the virtual hub or specified resource. /// public partial class VirtualHubEffectiveRoute { @@ -32,18 +23,29 @@ public VirtualHubEffectiveRoute() /// /// Initializes a new instance of the VirtualHubEffectiveRoute class. /// - /// The list of address prefixes. - /// The list of next hops. - /// The type of the next hop. - /// The ASPath of this route. - /// The origin of this route. - public VirtualHubEffectiveRoute(IList addressPrefixes = default(IList), IList nextHops = default(IList), string nextHopType = default(string), string asPath = default(string), string routeOrigin = default(string)) + + /// The list of address prefixes. + /// + + /// The list of next hops. + /// + + /// The type of the next hop. + /// + + /// The ASPath of this route. + /// + + /// The origin of this route. + /// + public VirtualHubEffectiveRoute(System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList), System.Collections.Generic.IList nextHops = default(System.Collections.Generic.IList), string nextHopType = default(string), string asPath = default(string), string routeOrigin = default(string)) + { - AddressPrefixes = addressPrefixes; - NextHops = nextHops; - NextHopType = nextHopType; - AsPath = asPath; - RouteOrigin = routeOrigin; + this.AddressPrefixes = addressPrefixes; + this.NextHops = nextHops; + this.NextHopType = nextHopType; + this.AsPath = asPath; + this.RouteOrigin = routeOrigin; CustomInit(); } @@ -52,35 +54,35 @@ public VirtualHubEffectiveRoute() /// partial void CustomInit(); + /// /// Gets or sets the list of address prefixes. /// - [JsonProperty(PropertyName = "addressPrefixes")] - public IList AddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; set; } /// /// Gets or sets the list of next hops. /// - [JsonProperty(PropertyName = "nextHops")] - public IList NextHops { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHops")] + public System.Collections.Generic.IList NextHops {get; set; } /// /// Gets or sets the type of the next hop. /// - [JsonProperty(PropertyName = "nextHopType")] - public string NextHopType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + public string NextHopType {get; set; } /// /// Gets or sets the ASPath of this route. /// - [JsonProperty(PropertyName = "asPath")] - public string AsPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asPath")] + public string AsPath {get; set; } /// /// Gets or sets the origin of this route. /// - [JsonProperty(PropertyName = "routeOrigin")] - public string RouteOrigin { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "routeOrigin")] + public string RouteOrigin {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRouteList.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRouteList.cs index b3010110a689..3325bbbbbd39 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRouteList.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubEffectiveRouteList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualHubEffectiveRouteList { /// - /// Initializes a new instance of the VirtualHubEffectiveRouteList - /// class. + /// Initializes a new instance of the VirtualHubEffectiveRouteList class. /// public VirtualHubEffectiveRouteList() { @@ -30,14 +21,16 @@ public VirtualHubEffectiveRouteList() } /// - /// Initializes a new instance of the VirtualHubEffectiveRouteList - /// class. + /// Initializes a new instance of the VirtualHubEffectiveRouteList class. /// - /// The list of effective routes configured on the - /// virtual hub or the specified resource. - public VirtualHubEffectiveRouteList(IList value = default(IList)) + + /// The list of effective routes configured on the virtual hub or the specified + /// resource. + /// + public VirtualHubEffectiveRouteList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -46,12 +39,12 @@ public VirtualHubEffectiveRouteList() /// partial void CustomInit(); + /// - /// Gets or sets the list of effective routes configured on the virtual - /// hub or the specified resource. + /// Gets or sets the list of effective routes configured on the virtual hub or + /// the specified resource. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubId.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubId.cs index 776b6b732bae..80c2d42532cc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubId.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubId.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,15 @@ public VirtualHubId() /// /// Initializes a new instance of the VirtualHubId class. /// - /// 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. + + /// 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. + /// public VirtualHubId(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -44,14 +40,13 @@ public VirtualHubId() /// partial void CustomInit(); + /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubProperties.cs new file mode 100644 index 000000000000..51d3ce924413 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubProperties.cs @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VirtualHub. + /// + public partial class VirtualHubProperties + { + /// + /// Initializes a new instance of the VirtualHubProperties class. + /// + public VirtualHubProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualHubProperties class. + /// + + /// The VirtualWAN to which the VirtualHub belongs. + /// + + /// The VpnGateway associated with this VirtualHub. + /// + + /// The P2SVpnGateway associated with this VirtualHub. + /// + + /// The expressRouteGateway associated with this VirtualHub. + /// + + /// The azureFirewall associated with this VirtualHub. + /// + + /// The securityPartnerProvider associated with this VirtualHub. + /// + + /// Address-prefix for this VirtualHub. + /// + + /// The routeTable associated with this virtual hub. + /// + + /// The provisioning state of the virtual hub resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The Security Provider name. + /// + + /// List of all virtual hub route table v2s associated with this VirtualHub. + /// + + /// The sku of this VirtualHub. + /// + + /// The routing state. + /// Possible values include: 'None', 'Provisioned', 'Provisioning', 'Failed' + + /// List of references to Bgp Connections. + /// + + /// List of references to IpConfigurations. + /// + + /// List of references to RouteMaps. + /// + + /// VirtualRouter ASN. + /// + + /// VirtualRouter IPs. + /// + + /// Flag to control transit for VirtualRouter hub. + /// + + /// The preferred gateway to route on-prem traffic + /// Possible values include: 'ExpressRoute', 'VpnGateway', 'None' + + /// The hubRoutingPreference of this VirtualHub. + /// Possible values include: 'ExpressRoute', 'VpnGateway', 'ASPath' + + /// The VirtualHub Router autoscale configuration. + /// + public VirtualHubProperties(SubResource virtualWan = default(SubResource), SubResource vpnGateway = default(SubResource), SubResource p2SVpnGateway = default(SubResource), SubResource expressRouteGateway = default(SubResource), SubResource azureFirewall = default(SubResource), SubResource securityPartnerProvider = default(SubResource), string addressPrefix = default(string), VirtualHubRouteTable routeTable = default(VirtualHubRouteTable), string provisioningState = default(string), string securityProviderName = default(string), System.Collections.Generic.IList virtualHubRouteTableV2S = default(System.Collections.Generic.IList), string sku = default(string), string routingState = default(string), System.Collections.Generic.IList bgpConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList routeMaps = default(System.Collections.Generic.IList), long? virtualRouterAsn = default(long?), System.Collections.Generic.IList virtualRouterIps = default(System.Collections.Generic.IList), bool? allowBranchToBranchTraffic = default(bool?), string preferredRoutingGateway = default(string), string hubRoutingPreference = default(string), VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration = default(VirtualRouterAutoScaleConfiguration)) + + { + this.VirtualWan = virtualWan; + this.VpnGateway = vpnGateway; + this.P2SVpnGateway = p2SVpnGateway; + this.ExpressRouteGateway = expressRouteGateway; + this.AzureFirewall = azureFirewall; + this.SecurityPartnerProvider = securityPartnerProvider; + this.AddressPrefix = addressPrefix; + this.RouteTable = routeTable; + this.ProvisioningState = provisioningState; + this.SecurityProviderName = securityProviderName; + this.VirtualHubRouteTableV2S = virtualHubRouteTableV2S; + this.Sku = sku; + this.RoutingState = routingState; + this.BgpConnections = bgpConnections; + this.IPConfigurations = ipConfigurations; + this.RouteMaps = routeMaps; + this.VirtualRouterAsn = virtualRouterAsn; + this.VirtualRouterIps = virtualRouterIps; + this.AllowBranchToBranchTraffic = allowBranchToBranchTraffic; + this.PreferredRoutingGateway = preferredRoutingGateway; + this.HubRoutingPreference = hubRoutingPreference; + this.VirtualRouterAutoScaleConfiguration = virtualRouterAutoScaleConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the VirtualWAN to which the VirtualHub belongs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualWan")] + public SubResource VirtualWan {get; set; } + + /// + /// Gets or sets the VpnGateway associated with this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnGateway")] + public SubResource VpnGateway {get; set; } + + /// + /// Gets or sets the P2SVpnGateway associated with this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "p2SVpnGateway")] + public SubResource P2SVpnGateway {get; set; } + + /// + /// Gets or sets the expressRouteGateway associated with this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteGateway")] + public SubResource ExpressRouteGateway {get; set; } + + /// + /// Gets or sets the azureFirewall associated with this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "azureFirewall")] + public SubResource AzureFirewall {get; set; } + + /// + /// Gets or sets the securityPartnerProvider associated with this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityPartnerProvider")] + public SubResource SecurityPartnerProvider {get; set; } + + /// + /// Gets or sets address-prefix for this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix {get; set; } + + /// + /// Gets or sets the routeTable associated with this virtual hub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routeTable")] + public VirtualHubRouteTable RouteTable {get; set; } + + /// + /// Gets the provisioning state of the virtual hub resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the Security Provider name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProviderName")] + public string SecurityProviderName {get; set; } + + /// + /// Gets or sets list of all virtual hub route table v2s associated with this + /// VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHubRouteTableV2s")] + public System.Collections.Generic.IList VirtualHubRouteTableV2S {get; set; } + + /// + /// Gets or sets the sku of this VirtualHub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } + + /// + /// Gets the routing state. Possible values include: 'None', 'Provisioned', 'Provisioning', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingState")] + public string RoutingState {get; private set; } + + /// + /// Gets list of references to Bgp Connections. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpConnections")] + public System.Collections.Generic.IList BgpConnections {get; private set; } + + /// + /// Gets list of references to IpConfigurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } + + /// + /// Gets list of references to RouteMaps. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routeMaps")] + public System.Collections.Generic.IList RouteMaps {get; private set; } + + /// + /// Gets or sets virtualRouter ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualRouterAsn")] + public long? VirtualRouterAsn {get; set; } + + /// + /// Gets or sets virtualRouter IPs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualRouterIps")] + public System.Collections.Generic.IList VirtualRouterIps {get; set; } + + /// + /// Gets or sets flag to control transit for VirtualRouter hub. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowBranchToBranchTraffic")] + public bool? AllowBranchToBranchTraffic {get; set; } + + /// + /// Gets or sets the preferred gateway to route on-prem traffic Possible values include: 'ExpressRoute', 'VpnGateway', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "preferredRoutingGateway")] + public string PreferredRoutingGateway {get; set; } + + /// + /// Gets or sets the hubRoutingPreference of this VirtualHub. Possible values include: 'ExpressRoute', 'VpnGateway', 'ASPath' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hubRoutingPreference")] + public string HubRoutingPreference {get; set; } + + /// + /// Gets or sets the VirtualHub Router autoscale configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualRouterAutoScaleConfiguration")] + public VirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + + + + + + + + + if (this.VirtualRouterAsn != null) + { + if (this.VirtualRouterAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); + } + if (this.VirtualRouterAsn < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + } + } + + + + if (this.VirtualRouterAutoScaleConfiguration != null) + { + this.VirtualRouterAutoScaleConfiguration.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRoute.cs index 4f1170290512..0d592a3e8b71 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRoute.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,12 +23,17 @@ public VirtualHubRoute() /// /// Initializes a new instance of the VirtualHubRoute class. /// - /// List of all addressPrefixes. - /// NextHop ip address. - public VirtualHubRoute(IList addressPrefixes = default(IList), string nextHopIpAddress = default(string)) + + /// List of all addressPrefixes. + /// + + /// NextHop ip address. + /// + public VirtualHubRoute(System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList), string nextHopIPAddress = default(string)) + { - AddressPrefixes = addressPrefixes; - NextHopIpAddress = nextHopIpAddress; + this.AddressPrefixes = addressPrefixes; + this.NextHopIPAddress = nextHopIPAddress; CustomInit(); } @@ -45,17 +42,17 @@ public VirtualHubRoute() /// partial void CustomInit(); + /// /// Gets or sets list of all addressPrefixes. /// - [JsonProperty(PropertyName = "addressPrefixes")] - public IList AddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes {get; set; } /// /// Gets or sets nextHop ip address. /// - [JsonProperty(PropertyName = "nextHopIpAddress")] - public string NextHopIpAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] + public string NextHopIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTable.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTable.cs index d13fba63c236..b88f67ac8130 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTable.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public VirtualHubRouteTable() /// /// Initializes a new instance of the VirtualHubRouteTable class. /// - /// List of all routes. - public VirtualHubRouteTable(IList routes = default(IList)) + + /// List of all routes. + /// + public VirtualHubRouteTable(System.Collections.Generic.IList routes = default(System.Collections.Generic.IList)) + { - Routes = routes; + this.Routes = routes; CustomInit(); } @@ -43,11 +38,11 @@ public VirtualHubRouteTable() /// partial void CustomInit(); + /// /// Gets or sets list of all routes. /// - [JsonProperty(PropertyName = "routes")] - public IList Routes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "routes")] + public System.Collections.Generic.IList Routes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2.cs index 5c740962624f..65cb38475a45 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VirtualHubRouteTableV2 Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualHubRouteTableV2 : SubResource { /// @@ -34,26 +24,34 @@ public VirtualHubRouteTableV2() /// /// Initializes a new instance of the VirtualHubRouteTableV2 class. /// - /// Resource ID. - /// List of all routes. - /// List of all connections attached - /// to this route table v2. - /// The provisioning state of the - /// virtual hub route table v2 resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualHubRouteTableV2(string id = default(string), IList routes = default(IList), IList attachedConnections = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the virtual hub route table v2 resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of all routes. + /// + + /// List of all connections attached to this route table v2. + /// + public VirtualHubRouteTableV2(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList attachedConnections = default(System.Collections.Generic.IList)) + + : base(id) { - Routes = routes; - AttachedConnections = attachedConnections; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Routes = routes; + this.AttachedConnections = attachedConnections; CustomInit(); } @@ -62,40 +60,37 @@ public VirtualHubRouteTableV2() /// partial void CustomInit(); + /// - /// Gets or sets list of all routes. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.routes")] - public IList Routes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets list of all connections attached to this route table - /// v2. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.attachedConnections")] - public IList AttachedConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the virtual hub route table v2 - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the virtual hub route table v2 resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets list of all routes. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routes")] + public System.Collections.Generic.IList Routes {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets list of all connections attached to this route table v2. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.attachedConnections")] + public System.Collections.Generic.IList AttachedConnections {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2Properties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2Properties.cs new file mode 100644 index 000000000000..65964c4c3ff1 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteTableV2Properties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VirtualHubRouteTableV2. + /// + public partial class VirtualHubRouteTableV2Properties + { + /// + /// Initializes a new instance of the VirtualHubRouteTableV2Properties class. + /// + public VirtualHubRouteTableV2Properties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualHubRouteTableV2Properties class. + /// + + /// List of all routes. + /// + + /// List of all connections attached to this route table v2. + /// + + /// The provisioning state of the virtual hub route table v2 resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VirtualHubRouteTableV2Properties(System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList attachedConnections = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.Routes = routes; + this.AttachedConnections = attachedConnections; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of all routes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routes")] + public System.Collections.Generic.IList Routes {get; set; } + + /// + /// Gets or sets list of all connections attached to this route table v2. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "attachedConnections")] + public System.Collections.Generic.IList AttachedConnections {get; set; } + + /// + /// Gets the provisioning state of the virtual hub route table v2 resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteV2.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteV2.cs index 58ba7b09baf4..53ecd5327bb8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteV2.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualHubRouteV2.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,25 @@ public VirtualHubRouteV2() /// /// Initializes a new instance of the VirtualHubRouteV2 class. /// - /// The type of destinations. - /// List of all destinations. - /// The type of next hops. - /// NextHops ip address. - public VirtualHubRouteV2(string destinationType = default(string), IList destinations = default(IList), string nextHopType = default(string), IList nextHops = default(IList)) + + /// The type of destinations. + /// + + /// List of all destinations. + /// + + /// The type of next hops. + /// + + /// NextHops ip address. + /// + public VirtualHubRouteV2(string destinationType = default(string), System.Collections.Generic.IList destinations = default(System.Collections.Generic.IList), string nextHopType = default(string), System.Collections.Generic.IList nextHops = default(System.Collections.Generic.IList)) + { - DestinationType = destinationType; - Destinations = destinations; - NextHopType = nextHopType; - NextHops = nextHops; + this.DestinationType = destinationType; + this.Destinations = destinations; + this.NextHopType = nextHopType; + this.NextHops = nextHops; CustomInit(); } @@ -49,29 +50,29 @@ public VirtualHubRouteV2() /// partial void CustomInit(); + /// /// Gets or sets the type of destinations. /// - [JsonProperty(PropertyName = "destinationType")] - public string DestinationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationType")] + public string DestinationType {get; set; } /// /// Gets or sets list of all destinations. /// - [JsonProperty(PropertyName = "destinations")] - public IList Destinations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinations")] + public System.Collections.Generic.IList Destinations {get; set; } /// /// Gets or sets the type of next hops. /// - [JsonProperty(PropertyName = "nextHopType")] - public string NextHopType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + public string NextHopType {get; set; } /// /// Gets or sets nextHops ip address. /// - [JsonProperty(PropertyName = "nextHops")] - public IList NextHops { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHops")] + public System.Collections.Generic.IList NextHops {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetwork.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetwork.cs index 72dfe1ec88ac..aa9f72a1339b 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetwork.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetwork.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Virtual Network resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetwork : Resource { /// @@ -34,67 +24,96 @@ public VirtualNetwork() /// /// Initializes a new instance of the VirtualNetwork class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The extended location of the virtual - /// network. - /// The AddressSpace that contains an array - /// of IP address ranges that can be used by subnets. - /// The dhcpOptions that contains an array of - /// DNS servers available to VMs deployed in the virtual - /// network. - /// The FlowTimeout value (in - /// minutes) for the Virtual Network - /// A list of subnets in a Virtual - /// Network. - /// A list of peerings in a - /// Virtual Network. - /// The resourceGuid property of the Virtual - /// Network resource. - /// The provisioning state of the - /// virtual network resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// 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. - /// Indicates if VM protection is - /// enabled for all the subnets in the virtual network. - /// The DDoS protection plan - /// associated with the virtual network. - /// Bgp Communities sent over ExpressRoute - /// with each route corresponding to a prefix in this VNET. - /// Indicates if encryption is enabled on - /// virtual network and if VM without encryption is allowed in - /// encrypted VNet. - /// Array of IpAllocation which reference - /// this VNET. - /// A collection of references to flow log - /// resources. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), int? flowTimeoutInMinutes = default(int?), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), VirtualNetworkBgpCommunities bgpCommunities = default(VirtualNetworkBgpCommunities), VirtualNetworkEncryption encryption = default(VirtualNetworkEncryption), IList ipAllocations = default(IList), IList flowLogs = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of the virtual network. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The AddressSpace that contains an array of IP address ranges that can be + /// used by subnets. + /// + + /// The dhcpOptions that contains an array of DNS servers available to VMs + /// deployed in the virtual network. + /// + + /// The provisioning state of the virtual network resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The FlowTimeout value (in minutes) for the Virtual Network + /// + + /// A list of subnets in a Virtual Network. + /// + + /// A list of peerings in a Virtual Network. + /// + + /// The resourceGuid property of the Virtual Network resource. + /// + + /// 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. + /// + + /// Indicates if VM protection is enabled for all the subnets in the virtual + /// network. + /// + + /// The DDoS protection plan associated with the virtual network. + /// + + /// Bgp Communities sent over ExpressRoute with each route corresponding to a + /// prefix in this VNET. + /// + + /// Indicates if encryption is enabled on virtual network and if VM without + /// encryption is allowed in encrypted VNet. + /// + + /// Array of IpAllocation which reference this VNET. + /// + + /// A collection of references to flow log resources. + /// + public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), string provisioningState = default(string), int? flowTimeoutInMinutes = default(int?), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkPeerings = default(System.Collections.Generic.IList), string resourceGuid = default(string), bool? enableDdosProtection = default(bool?), bool? enableVMProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), VirtualNetworkBgpCommunities bgpCommunities = default(VirtualNetworkBgpCommunities), VirtualNetworkEncryption encryption = default(VirtualNetworkEncryption), System.Collections.Generic.IList ipAllocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList flowLogs = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; - AddressSpace = addressSpace; - DhcpOptions = dhcpOptions; - FlowTimeoutInMinutes = flowTimeoutInMinutes; - Subnets = subnets; - VirtualNetworkPeerings = virtualNetworkPeerings; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - EnableDdosProtection = enableDdosProtection; - EnableVmProtection = enableVmProtection; - DdosProtectionPlan = ddosProtectionPlan; - BgpCommunities = bgpCommunities; - Encryption = encryption; - IpAllocations = ipAllocations; - FlowLogs = flowLogs; - Etag = etag; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.AddressSpace = addressSpace; + this.DhcpOptions = dhcpOptions; + this.ProvisioningState = provisioningState; + this.FlowTimeoutInMinutes = flowTimeoutInMinutes; + this.Subnets = subnets; + this.VirtualNetworkPeerings = virtualNetworkPeerings; + this.ResourceGuid = resourceGuid; + this.EnableDdosProtection = enableDdosProtection; + this.EnableVMProtection = enableVMProtection; + this.DdosProtectionPlan = ddosProtectionPlan; + this.BgpCommunities = bgpCommunities; + this.Encryption = encryption; + this.IPAllocations = ipAllocations; + this.FlowLogs = flowLogs; CustomInit(); } @@ -103,125 +122,127 @@ public VirtualNetwork() /// partial void CustomInit(); + /// /// Gets or sets the extended location of the virtual network. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the AddressSpace that contains an array of IP address - /// ranges that can be used by subnets. + /// Gets or sets the AddressSpace that contains an array of IP address ranges + /// that can be used by subnets. /// - [JsonProperty(PropertyName = "properties.addressSpace")] - public AddressSpace AddressSpace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressSpace")] + public AddressSpace AddressSpace {get; set; } /// /// Gets or sets the dhcpOptions that contains an array of DNS servers /// available to VMs deployed in the virtual network. /// - [JsonProperty(PropertyName = "properties.dhcpOptions")] - public DhcpOptions DhcpOptions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dhcpOptions")] + public DhcpOptions DhcpOptions {get; set; } /// - /// Gets or sets the FlowTimeout value (in minutes) for the Virtual - /// Network + /// Gets the provisioning state of the virtual network resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.flowTimeoutInMinutes")] - public int? FlowTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets a list of subnets in a Virtual Network. + /// Gets or sets the FlowTimeout value (in minutes) for the Virtual Network /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flowTimeoutInMinutes")] + public int? FlowTimeoutInMinutes {get; set; } /// - /// Gets or sets a list of peerings in a Virtual Network. + /// Gets or sets a list of subnets in a Virtual Network. /// - [JsonProperty(PropertyName = "properties.virtualNetworkPeerings")] - public IList VirtualNetworkPeerings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets {get; set; } /// - /// Gets the resourceGuid property of the Virtual Network resource. + /// Gets or sets a list of peerings in a Virtual Network. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkPeerings")] + public System.Collections.Generic.IList VirtualNetworkPeerings {get; set; } /// - /// Gets the provisioning state of the virtual network resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the resourceGuid property of the Virtual Network resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets 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. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.enableDdosProtection")] - public bool? EnableDdosProtection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableDdosProtection")] + public bool? EnableDdosProtection {get; set; } /// - /// Gets or sets indicates if VM protection is enabled for all the - /// subnets in the virtual network. + /// Gets or sets indicates if VM protection is enabled for all the subnets in + /// the virtual network. /// - [JsonProperty(PropertyName = "properties.enableVmProtection")] - public bool? EnableVmProtection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableVmProtection")] + public bool? EnableVMProtection {get; set; } /// - /// Gets or sets the DDoS protection plan associated with the virtual - /// network. + /// Gets or sets the DDoS protection plan associated with the virtual network. /// - [JsonProperty(PropertyName = "properties.ddosProtectionPlan")] - public SubResource DdosProtectionPlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ddosProtectionPlan")] + public SubResource DdosProtectionPlan {get; set; } /// /// Gets or sets bgp Communities sent over ExpressRoute with each route /// corresponding to a prefix in this VNET. /// - [JsonProperty(PropertyName = "properties.bgpCommunities")] - public VirtualNetworkBgpCommunities BgpCommunities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpCommunities")] + public VirtualNetworkBgpCommunities BgpCommunities {get; set; } /// - /// Gets or sets indicates if encryption is enabled on virtual network - /// and if VM without encryption is allowed in encrypted VNet. + /// Gets or sets indicates if encryption is enabled on virtual network and if + /// VM without encryption is allowed in encrypted VNet. /// - [JsonProperty(PropertyName = "properties.encryption")] - public VirtualNetworkEncryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public VirtualNetworkEncryption Encryption {get; set; } /// /// Gets or sets array of IpAllocation which reference this VNET. /// - [JsonProperty(PropertyName = "properties.ipAllocations")] - public IList IpAllocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAllocations")] + public System.Collections.Generic.IList IPAllocations {get; set; } /// /// Gets a collection of references to flow log resources. /// - [JsonProperty(PropertyName = "properties.flowLogs")] - public IList FlowLogs { get; private set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.flowLogs")] + public System.Collections.Generic.IList FlowLogs {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualNetworkPeerings != null) + + + + + + + if (this.VirtualNetworkPeerings != null) { - foreach (var element in VirtualNetworkPeerings) + foreach (var element in this.VirtualNetworkPeerings) { if (element != null) { @@ -229,24 +250,18 @@ public virtual void Validate() } } } - if (BgpCommunities != null) + + + if (this.BgpCommunities != null) { - BgpCommunities.Validate(); + this.BgpCommunities.Validate(); } - if (Encryption != null) + if (this.Encryption != null) { - Encryption.Validate(); - } - if (FlowLogs != null) - { - foreach (var element1 in FlowLogs) - { - if (element1 != null) - { - element1.Validate(); - } - } + this.Encryption.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkBgpCommunities.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkBgpCommunities.cs index e1143dd2cde8..0006a365082d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkBgpCommunities.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkBgpCommunities.cs @@ -1,28 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Bgp Communities sent over ExpressRoute with each route corresponding to - /// a prefix in this VNET. + /// Bgp Communities sent over ExpressRoute with each route corresponding to a + /// prefix in this VNET. /// public partial class VirtualNetworkBgpCommunities { /// - /// Initializes a new instance of the VirtualNetworkBgpCommunities - /// class. + /// Initializes a new instance of the VirtualNetworkBgpCommunities class. /// public VirtualNetworkBgpCommunities() { @@ -30,17 +22,19 @@ public VirtualNetworkBgpCommunities() } /// - /// Initializes a new instance of the VirtualNetworkBgpCommunities - /// class. + /// Initializes a new instance of the VirtualNetworkBgpCommunities class. /// - /// The BGP community associated - /// with the virtual network. - /// The BGP community associated with - /// the region of the virtual network. + + /// The BGP community associated with the virtual network. + /// + + /// The BGP community associated with the region of the virtual network. + /// public VirtualNetworkBgpCommunities(string virtualNetworkCommunity, string regionalCommunity = default(string)) + { - VirtualNetworkCommunity = virtualNetworkCommunity; - RegionalCommunity = regionalCommunity; + this.VirtualNetworkCommunity = virtualNetworkCommunity; + this.RegionalCommunity = regionalCommunity; CustomInit(); } @@ -49,31 +43,32 @@ public VirtualNetworkBgpCommunities() /// partial void CustomInit(); + /// /// Gets or sets the BGP community associated with the virtual network. /// - [JsonProperty(PropertyName = "virtualNetworkCommunity")] - public string VirtualNetworkCommunity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkCommunity")] + public string VirtualNetworkCommunity {get; set; } /// - /// Gets the BGP community associated with the region of the virtual - /// network. + /// Gets the BGP community associated with the region of the virtual network. /// - [JsonProperty(PropertyName = "regionalCommunity")] - public string RegionalCommunity { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "regionalCommunity")] + public string RegionalCommunity {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualNetworkCommunity == null) + if (this.VirtualNetworkCommunity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkCommunity"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkCommunity"); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkConnectionGatewayReference.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkConnectionGatewayReference.cs index 00b8d44ddb19..7ab970ee8e35 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkConnectionGatewayReference.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkConnectionGatewayReference.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualNetworkConnectionGatewayReference { /// - /// Initializes a new instance of the - /// VirtualNetworkConnectionGatewayReference class. + /// Initializes a new instance of the VirtualNetworkConnectionGatewayReference class. /// public VirtualNetworkConnectionGatewayReference() { @@ -29,14 +21,15 @@ public VirtualNetworkConnectionGatewayReference() } /// - /// Initializes a new instance of the - /// VirtualNetworkConnectionGatewayReference class. + /// Initializes a new instance of the VirtualNetworkConnectionGatewayReference class. /// - /// The ID of VirtualNetworkGateway or - /// LocalNetworkGateway resource. + + /// The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + /// public VirtualNetworkConnectionGatewayReference(string id) + { - Id = id; + this.Id = id; CustomInit(); } @@ -45,25 +38,26 @@ public VirtualNetworkConnectionGatewayReference(string id) /// partial void CustomInit(); + /// /// Gets or sets the ID of VirtualNetworkGateway or LocalNetworkGateway /// resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Id == null) + if (this.Id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryption.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryption.cs index 3fcd89f98c9c..cce2e72df1a2 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryption.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryption.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +24,17 @@ public VirtualNetworkEncryption() /// /// Initializes a new instance of the VirtualNetworkEncryption class. /// - /// Indicates if encryption is enabled on the - /// virtual network. - /// If the encrypted VNet allows VM that does - /// not support encryption. Possible values include: 'DropUnencrypted', - /// 'AllowUnencrypted' + + /// Indicates if encryption is enabled on the virtual network. + /// + + /// If the encrypted VNet allows VM that does not support encryption + /// Possible values include: 'DropUnencrypted', 'AllowUnencrypted' public VirtualNetworkEncryption(bool enabled, string enforcement = default(string)) + { - Enabled = enabled; - Enforcement = enforcement; + this.Enabled = enabled; + this.Enforcement = enforcement; CustomInit(); } @@ -47,29 +43,28 @@ public VirtualNetworkEncryption() /// partial void CustomInit(); + /// - /// Gets or sets indicates if encryption is enabled on the virtual - /// network. + /// Gets or sets indicates if encryption is enabled on the virtual network. /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled {get; set; } /// /// Gets or sets if the encrypted VNet allows VM that does not support - /// encryption. Possible values include: 'DropUnencrypted', - /// 'AllowUnencrypted' + /// encryption Possible values include: 'DropUnencrypted', 'AllowUnencrypted' /// - [JsonProperty(PropertyName = "enforcement")] - public string Enforcement { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enforcement")] + public string Enforcement {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryptionEnforcement.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryptionEnforcement.cs index b6b87e102a89..410d16b83d6f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryptionEnforcement.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkEncryptionEnforcement.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkEncryptionEnforcement. /// + + public static class VirtualNetworkEncryptionEnforcement { public const string DropUnencrypted = "DropUnencrypted"; public const string AllowUnencrypted = "AllowUnencrypted"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGateway.cs index 309771855381..6f0f25d0d4ae 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGateway : Resource { /// @@ -34,111 +24,145 @@ public VirtualNetworkGateway() /// /// Initializes a new instance of the VirtualNetworkGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Autoscale configuration for - /// virutal network gateway - /// IP configurations for virtual - /// network gateway. - /// The type of this virtual network gateway. - /// Possible values include: 'Vpn', 'ExpressRoute', - /// 'LocalGateway' + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// The extended location of type local virtual network gateway. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + /// The type of this virtual network gateway. - /// Possible values include: 'PolicyBased', 'RouteBased' - /// The generation for this - /// VirtualNetworkGateway. Must be None if gatewayType is not VPN. - /// Possible values include: 'None', 'Generation1', - /// 'Generation2' - /// Whether BGP is enabled for this virtual - /// network gateway or not. - /// Whether private IP needs to be - /// enabled on this gateway for connections or not. - /// ActiveActive flag. - /// disableIPSecReplayProtection - /// flag. - /// The reference to the - /// LocalNetworkGateway resource which represents local network site - /// having default routes. Assign Null value in case of removing - /// existing default site setting. - /// The reference to the VirtualNetworkGatewaySku - /// resource which represents the SKU selected for Virtual network - /// gateway. - /// The reference to the - /// VpnClientConfiguration resource which represents the P2S VpnClient - /// configurations. - /// The reference to - /// the VirtualNetworkGatewayPolicyGroup resource which represents the - /// available VirtualNetworkGatewayPolicyGroup for the gateway. - /// Virtual network gateway's BGP speaker - /// settings. - /// The reference to the address space - /// resource which represents the custom routes address space specified - /// by the customer for virtual network gateway and VpnClient. - /// The resource GUID property of the - /// virtual network gateway resource. - /// The provisioning state of the - /// virtual network gateway resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Whether dns forwarding is enabled - /// or not. - /// The IP address allocated - /// by the gateway to which dns requests can be sent. - /// Customer vnet resource - /// id. VirtualNetworkGateway of type local gateway is associated with - /// the customer vnet. - /// NatRules for virtual network - /// gateway. - /// EnableBgpRouteTranslationForNat - /// flag. - /// Configures this gateway to - /// accept traffic from remote Virtual WAN networks. - /// Configure this gateway to - /// accept traffic from other Azure Virtual Networks. This - /// configuration does not support connectivity to Azure Virtual - /// WAN. - /// Property to indicate if the Express Route - /// Gateway serves traffic when there are multiple Express Route - /// Gateways in the vnet. Possible values include: 'Enabled', - /// 'Disabled' - /// The extended location of type local - /// virtual network gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration = default(VirtualNetworkGatewayAutoScaleConfiguration), IList ipConfigurations = default(IList), string gatewayType = default(string), string vpnType = default(string), string vpnGatewayGeneration = default(string), bool? enableBgp = default(bool?), bool? enablePrivateIpAddress = default(bool?), bool? activeActive = default(bool?), bool? disableIPSecReplayProtection = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), IList virtualNetworkGatewayPolicyGroups = default(IList), BgpSettings bgpSettings = default(BgpSettings), AddressSpace customRoutes = default(AddressSpace), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDnsForwarding = default(bool?), string inboundDnsForwardingEndpoint = default(string), string vNetExtendedLocationResourceId = default(string), IList natRules = default(IList), bool? enableBgpRouteTranslationForNat = default(bool?), bool? allowVirtualWanTraffic = default(bool?), bool? allowRemoteVnetTraffic = default(bool?), string adminState = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string)) - : base(id, name, type, location, tags) + /// Possible values include: 'PolicyBased', 'RouteBased' + + /// Virtual network gateway's BGP speaker settings. + /// + + /// The provisioning state of the virtual network gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Property to indicate if the Express Route Gateway serves traffic when there + /// are multiple Express Route Gateways in the vnet + /// Possible values include: 'Enabled', 'Disabled' + + /// Autoscale configuration for virutal network gateway + /// + + /// IP configurations for virtual network gateway. + /// + + /// The type of this virtual network gateway. + /// Possible values include: 'Vpn', 'ExpressRoute', 'LocalGateway' + + /// The generation for this VirtualNetworkGateway. Must be None if gatewayType + /// is not VPN. + /// Possible values include: 'None', 'Generation1', 'Generation2' + + /// Whether BGP is enabled for this virtual network gateway or not. + /// + + /// Whether private IP needs to be enabled on this gateway for connections or + /// not. + /// + + /// ActiveActive flag. + /// + + /// disableIPSecReplayProtection flag. + /// + + /// The reference to the LocalNetworkGateway resource which represents local + /// network site having default routes. Assign Null value in case of removing + /// existing default site setting. + /// + + /// The reference to the VirtualNetworkGatewaySku resource which represents the + /// SKU selected for Virtual network gateway. + /// + + /// The reference to the VpnClientConfiguration resource which represents the + /// P2S VpnClient configurations. + /// + + /// The reference to the VirtualNetworkGatewayPolicyGroup resource which + /// represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + /// + + /// The reference to the address space resource which represents the custom + /// routes address space specified by the customer for virtual network gateway + /// and VpnClient. + /// + + /// The resource GUID property of the virtual network gateway resource. + /// + + /// Whether dns forwarding is enabled or not. + /// + + /// The IP address allocated by the gateway to which dns requests can be sent. + /// + + /// Customer vnet resource id. VirtualNetworkGateway of type local gateway is + /// associated with the customer vnet. + /// + + /// NatRules for virtual network gateway. + /// + + /// EnableBgpRouteTranslationForNat flag. + /// + + /// Configures this gateway to accept traffic from remote Virtual WAN networks. + /// + + /// Configure this gateway to accept traffic from other Azure Virtual Networks. + /// This configuration does not support connectivity to Azure Virtual WAN. + /// + public VirtualNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), string vpnType = default(string), BgpSettings bgpSettings = default(BgpSettings), string provisioningState = default(string), string adminState = default(string), VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration = default(VirtualNetworkGatewayAutoScaleConfiguration), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string gatewayType = default(string), string vpnGatewayGeneration = default(string), bool? enableBgp = default(bool?), bool? enablePrivateIPAddress = default(bool?), bool? active = default(bool?), bool? disableIPSecReplayProtection = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), System.Collections.Generic.IList virtualNetworkGatewayPolicyGroups = default(System.Collections.Generic.IList), AddressSpace customRoutes = default(AddressSpace), string resourceGuid = default(string), bool? enableDnsForwarding = default(bool?), string inboundDnsForwardingEndpoint = default(string), string vNetExtendedLocationResourceId = default(string), System.Collections.Generic.IList natRules = default(System.Collections.Generic.IList), bool? enableBgpRouteTranslationForNat = default(bool?), bool? allowVirtualWanTraffic = default(bool?), bool? allowRemoteVnetTraffic = default(bool?)) + + : base(id, name, type, location, tags) { - AutoScaleConfiguration = autoScaleConfiguration; - IpConfigurations = ipConfigurations; - GatewayType = gatewayType; - VpnType = vpnType; - VpnGatewayGeneration = vpnGatewayGeneration; - EnableBgp = enableBgp; - EnablePrivateIpAddress = enablePrivateIpAddress; - ActiveActive = activeActive; - DisableIPSecReplayProtection = disableIPSecReplayProtection; - GatewayDefaultSite = gatewayDefaultSite; - Sku = sku; - VpnClientConfiguration = vpnClientConfiguration; - VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; - BgpSettings = bgpSettings; - CustomRoutes = customRoutes; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - EnableDnsForwarding = enableDnsForwarding; - InboundDnsForwardingEndpoint = inboundDnsForwardingEndpoint; - VNetExtendedLocationResourceId = vNetExtendedLocationResourceId; - NatRules = natRules; - EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; - AllowVirtualWanTraffic = allowVirtualWanTraffic; - AllowRemoteVnetTraffic = allowRemoteVnetTraffic; - AdminState = adminState; - ExtendedLocation = extendedLocation; - Etag = etag; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.VpnType = vpnType; + this.BgpSettings = bgpSettings; + this.ProvisioningState = provisioningState; + this.AdminState = adminState; + this.AutoScaleConfiguration = autoScaleConfiguration; + this.IPConfigurations = ipConfigurations; + this.GatewayType = gatewayType; + this.VpnGatewayGeneration = vpnGatewayGeneration; + this.EnableBgp = enableBgp; + this.EnablePrivateIPAddress = enablePrivateIPAddress; + this.Active = active; + this.DisableIPSecReplayProtection = disableIPSecReplayProtection; + this.GatewayDefaultSite = gatewayDefaultSite; + this.Sku = sku; + this.VpnClientConfiguration = vpnClientConfiguration; + this.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; + this.CustomRoutes = customRoutes; + this.ResourceGuid = resourceGuid; + this.EnableDnsForwarding = enableDnsForwarding; + this.InboundDnsForwardingEndpoint = inboundDnsForwardingEndpoint; + this.VNetExtendedLocationResourceId = vNetExtendedLocationResourceId; + this.NatRules = natRules; + this.EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + this.AllowVirtualWanTraffic = allowVirtualWanTraffic; + this.AllowRemoteVnetTraffic = allowRemoteVnetTraffic; CustomInit(); } @@ -147,216 +171,216 @@ public VirtualNetworkGateway() /// partial void CustomInit(); + /// - /// Gets or sets autoscale configuration for virutal network gateway + /// Gets or sets the extended location of type local virtual network gateway. /// - [JsonProperty(PropertyName = "properties.autoScaleConfiguration")] - public VirtualNetworkGatewayAutoScaleConfiguration AutoScaleConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets IP configurations for virtual network gateway. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the type of this virtual network gateway. Possible - /// values include: 'Vpn', 'ExpressRoute', 'LocalGateway' + /// Gets or sets the type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' /// - [JsonProperty(PropertyName = "properties.gatewayType")] - public string GatewayType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnType")] + public string VpnType {get; set; } /// - /// Gets or sets the type of this virtual network gateway. Possible - /// values include: 'PolicyBased', 'RouteBased' + /// Gets or sets virtual network gateway's BGP speaker settings. /// - [JsonProperty(PropertyName = "properties.vpnType")] - public string VpnType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] + public BgpSettings BgpSettings {get; set; } /// - /// Gets or sets the generation for this VirtualNetworkGateway. Must be - /// None if gatewayType is not VPN. Possible values include: 'None', - /// 'Generation1', 'Generation2' + /// Gets the provisioning state of the virtual network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.vpnGatewayGeneration")] - public string VpnGatewayGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets whether BGP is enabled for this virtual network - /// gateway or not. + /// Gets or sets property to indicate if the Express Route Gateway serves + /// traffic when there are multiple Express Route Gateways in the vnet Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.enableBgp")] - public bool? EnableBgp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.adminState")] + public string AdminState {get; set; } /// - /// Gets or sets whether private IP needs to be enabled on this gateway - /// for connections or not. + /// Gets or sets autoscale configuration for virutal network gateway /// - [JsonProperty(PropertyName = "properties.enablePrivateIpAddress")] - public bool? EnablePrivateIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoScaleConfiguration")] + public VirtualNetworkGatewayAutoScaleConfiguration AutoScaleConfiguration {get; set; } /// - /// Gets or sets activeActive flag. + /// Gets or sets iP configurations for virtual network gateway. /// - [JsonProperty(PropertyName = "properties.activeActive")] - public bool? ActiveActive { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } /// - /// Gets or sets disableIPSecReplayProtection flag. + /// Gets or sets the type of this virtual network gateway. Possible values include: 'Vpn', 'ExpressRoute', 'LocalGateway' /// - [JsonProperty(PropertyName = "properties.disableIPSecReplayProtection")] - public bool? DisableIPSecReplayProtection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayType")] + public string GatewayType {get; set; } /// - /// Gets or sets the reference to the LocalNetworkGateway resource - /// which represents local network site having default routes. Assign - /// Null value in case of removing existing default site setting. + /// Gets or sets the generation for this VirtualNetworkGateway. Must be None if + /// gatewayType is not VPN. Possible values include: 'None', 'Generation1', 'Generation2' /// - [JsonProperty(PropertyName = "properties.gatewayDefaultSite")] - public SubResource GatewayDefaultSite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnGatewayGeneration")] + public string VpnGatewayGeneration {get; set; } /// - /// Gets or sets the reference to the VirtualNetworkGatewaySku resource - /// which represents the SKU selected for Virtual network gateway. + /// Gets or sets whether BGP is enabled for this virtual network gateway or + /// not. /// - [JsonProperty(PropertyName = "properties.sku")] - public VirtualNetworkGatewaySku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + public bool? EnableBgp {get; set; } /// - /// Gets or sets the reference to the VpnClientConfiguration resource - /// which represents the P2S VpnClient configurations. + /// Gets or sets whether private IP needs to be enabled on this gateway for + /// connections or not. /// - [JsonProperty(PropertyName = "properties.vpnClientConfiguration")] - public VpnClientConfiguration VpnClientConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePrivateIpAddress")] + public bool? EnablePrivateIPAddress {get; set; } /// - /// Gets or sets the reference to the VirtualNetworkGatewayPolicyGroup - /// resource which represents the available - /// VirtualNetworkGatewayPolicyGroup for the gateway. + /// Gets or sets activeActive flag. /// - [JsonProperty(PropertyName = "properties.virtualNetworkGatewayPolicyGroups")] - public IList VirtualNetworkGatewayPolicyGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeActive")] + public bool? Active {get; set; } /// - /// Gets or sets virtual network gateway's BGP speaker settings. + /// Gets or sets disableIPSecReplayProtection flag. /// - [JsonProperty(PropertyName = "properties.bgpSettings")] - public BgpSettings BgpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableIPSecReplayProtection")] + public bool? DisableIPSecReplayProtection {get; set; } /// - /// Gets or sets the reference to the address space resource which - /// represents the custom routes address space specified by the - /// customer for virtual network gateway and VpnClient. + /// Gets or sets the reference to the LocalNetworkGateway resource which + /// represents local network site having default routes. Assign Null value in + /// case of removing existing default site setting. /// - [JsonProperty(PropertyName = "properties.customRoutes")] - public AddressSpace CustomRoutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayDefaultSite")] + public SubResource GatewayDefaultSite {get; set; } /// - /// Gets the resource GUID property of the virtual network gateway - /// resource. + /// Gets or sets the reference to the VirtualNetworkGatewaySku resource which + /// represents the SKU selected for Virtual network gateway. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public VirtualNetworkGatewaySku Sku {get; set; } /// - /// Gets the provisioning state of the virtual network gateway - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the reference to the VpnClientConfiguration resource which + /// represents the P2S VpnClient configurations. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientConfiguration")] + public VpnClientConfiguration VpnClientConfiguration {get; set; } /// - /// Gets or sets whether dns forwarding is enabled or not. + /// Gets or sets the reference to the VirtualNetworkGatewayPolicyGroup resource + /// which represents the available VirtualNetworkGatewayPolicyGroup for the + /// gateway. /// - [JsonProperty(PropertyName = "properties.enableDnsForwarding")] - public bool? EnableDnsForwarding { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGatewayPolicyGroups")] + public System.Collections.Generic.IList VirtualNetworkGatewayPolicyGroups {get; set; } /// - /// Gets the IP address allocated by the gateway to which dns requests - /// can be sent. + /// Gets or sets the reference to the address space resource which represents + /// the custom routes address space specified by the customer for virtual + /// network gateway and VpnClient. /// - [JsonProperty(PropertyName = "properties.inboundDnsForwardingEndpoint")] - public string InboundDnsForwardingEndpoint { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customRoutes")] + public AddressSpace CustomRoutes {get; set; } /// - /// Gets or sets customer vnet resource id. VirtualNetworkGateway of - /// type local gateway is associated with the customer vnet. + /// Gets the resource GUID property of the virtual network gateway resource. /// - [JsonProperty(PropertyName = "properties.vNetExtendedLocationResourceId")] - public string VNetExtendedLocationResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets natRules for virtual network gateway. + /// Gets or sets whether dns forwarding is enabled or not. /// - [JsonProperty(PropertyName = "properties.natRules")] - public IList NatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableDnsForwarding")] + public bool? EnableDnsForwarding {get; set; } /// - /// Gets or sets enableBgpRouteTranslationForNat flag. + /// Gets the IP address allocated by the gateway to which dns requests can be + /// sent. /// - [JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] - public bool? EnableBgpRouteTranslationForNat { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundDnsForwardingEndpoint")] + public string InboundDnsForwardingEndpoint {get; private set; } /// - /// Gets or sets configures this gateway to accept traffic from remote - /// Virtual WAN networks. + /// Gets or sets customer vnet resource id. VirtualNetworkGateway of type local + /// gateway is associated with the customer vnet. /// - [JsonProperty(PropertyName = "properties.allowVirtualWanTraffic")] - public bool? AllowVirtualWanTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vNetExtendedLocationResourceId")] + public string VNetExtendedLocationResourceId {get; set; } /// - /// Gets or sets configure this gateway to accept traffic from other - /// Azure Virtual Networks. This configuration does not support - /// connectivity to Azure Virtual WAN. + /// Gets or sets natRules for virtual network gateway. /// - [JsonProperty(PropertyName = "properties.allowRemoteVnetTraffic")] - public bool? AllowRemoteVnetTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.natRules")] + public System.Collections.Generic.IList NatRules {get; set; } /// - /// Gets or sets property to indicate if the Express Route Gateway - /// serves traffic when there are multiple Express Route Gateways in - /// the vnet. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets enableBgpRouteTranslationForNat flag. /// - [JsonProperty(PropertyName = "properties.adminState")] - public string AdminState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] + public bool? EnableBgpRouteTranslationForNat {get; set; } /// - /// Gets or sets the extended location of type local virtual network - /// gateway. + /// Gets or sets configures this gateway to accept traffic from remote Virtual + /// WAN networks. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowVirtualWanTraffic")] + public bool? AllowVirtualWanTraffic {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets configure this gateway to accept traffic from other Azure + /// Virtual Networks. This configuration does not support connectivity to Azure + /// Virtual WAN. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowRemoteVnetTraffic")] + public bool? AllowRemoteVnetTraffic {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualNetworkGatewayPolicyGroups != null) - { - foreach (var element in VirtualNetworkGatewayPolicyGroups) - { - if (element != null) - { - element.Validate(); - } - } - } - if (BgpSettings != null) + + + + if (this.BgpSettings != null) { - BgpSettings.Validate(); + this.BgpSettings.Validate(); } + + + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleBounds.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleBounds.cs index 8984992cf1c0..bbba3547b35a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleBounds.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleBounds.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; public partial class VirtualNetworkGatewayAutoScaleBounds { /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayAutoScaleBounds class. + /// Initializes a new instance of the VirtualNetworkGatewayAutoScaleBounds class. /// public VirtualNetworkGatewayAutoScaleBounds() { @@ -25,17 +18,19 @@ public VirtualNetworkGatewayAutoScaleBounds() } /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayAutoScaleBounds class. + /// Initializes a new instance of the VirtualNetworkGatewayAutoScaleBounds class. /// - /// Minimum scale Units for Autoscale - /// configuration - /// Maximum Scale Units for Autoscale - /// configuration + + /// Minimum scale Units for Autoscale configuration + /// + + /// Maximum Scale Units for Autoscale configuration + /// public VirtualNetworkGatewayAutoScaleBounds(int? min = default(int?), int? max = default(int?)) + { - Min = min; - Max = max; + this.Min = min; + this.Max = max; CustomInit(); } @@ -44,17 +39,17 @@ public VirtualNetworkGatewayAutoScaleBounds() /// partial void CustomInit(); + /// /// Gets or sets minimum scale Units for Autoscale configuration /// - [JsonProperty(PropertyName = "min")] - public int? Min { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "min")] + public int? Min {get; set; } /// /// Gets or sets maximum Scale Units for Autoscale configuration /// - [JsonProperty(PropertyName = "max")] - public int? Max { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "max")] + public int? Max {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleConfiguration.cs index 03b633bc42fc..2de161aefe5d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayAutoScaleConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualNetworkGatewayAutoScaleConfiguration { /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayAutoScaleConfiguration class. + /// Initializes a new instance of the VirtualNetworkGatewayAutoScaleConfiguration class. /// public VirtualNetworkGatewayAutoScaleConfiguration() { @@ -28,14 +21,15 @@ public VirtualNetworkGatewayAutoScaleConfiguration() } /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayAutoScaleConfiguration class. + /// Initializes a new instance of the VirtualNetworkGatewayAutoScaleConfiguration class. /// - /// The bounds of the autoscale - /// configuration + + /// The bounds of the autoscale configuration + /// public VirtualNetworkGatewayAutoScaleConfiguration(VirtualNetworkGatewayAutoScaleBounds bounds = default(VirtualNetworkGatewayAutoScaleBounds)) + { - Bounds = bounds; + this.Bounds = bounds; CustomInit(); } @@ -44,11 +38,11 @@ public VirtualNetworkGatewayAutoScaleConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the bounds of the autoscale configuration /// - [JsonProperty(PropertyName = "bounds")] - public VirtualNetworkGatewayAutoScaleBounds Bounds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bounds")] + public VirtualNetworkGatewayAutoScaleBounds Bounds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnection.cs index 4efccfb1a860..f96e5cc314df 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayConnection : Resource { /// - /// Initializes a new instance of the VirtualNetworkGatewayConnection - /// class. + /// Initializes a new instance of the VirtualNetworkGatewayConnection class. /// public VirtualNetworkGatewayConnection() { @@ -33,100 +22,143 @@ public VirtualNetworkGatewayConnection() } /// - /// Initializes a new instance of the VirtualNetworkGatewayConnection - /// class. - /// - /// The reference to virtual - /// network gateway resource. - /// Gateway connection type. Possible - /// values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', - /// 'VPNClient' - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The authorizationKey. - /// The reference to virtual - /// network gateway resource. - /// The reference to local network - /// gateway resource. - /// List of ingress NatRules. - /// List of egress NatRules. - /// Connection protocol used for this - /// connection. Possible values include: 'IKEv2', 'IKEv1' - /// The routing weight. - /// The dead peer detection timeout of - /// this connection in seconds. - /// The connection mode for this - /// connection. Possible values include: 'Default', 'ResponderOnly', - /// 'InitiatorOnly' - /// The IPSec shared key. - /// Virtual Network Gateway connection - /// status. Possible values include: 'Unknown', 'Connecting', - /// 'Connected', 'NotConnected' - /// Collection of all tunnels' - /// connection health status. - /// The egress bytes transferred - /// in this connection. - /// The ingress bytes transferred - /// in this connection. - /// The reference to peerings resource. - /// EnableBgp flag. - /// GatewayCustomBgpIpAddresses to - /// be used for virtual network gateway Connection. - /// Use private local Azure IP for - /// the connection. - /// Enable policy-based - /// traffic selectors. - /// The IPSec Policies to be considered by - /// this connection. - /// The Traffic Selector Policies - /// to be considered by this connection. - /// The resource GUID property of the - /// virtual network gateway connection resource. - /// The provisioning state of the - /// virtual network gateway connection resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Bypass ExpressRoute Gateway - /// for data forwarding. - /// Bypass the ExpressRoute - /// gateway when accessing private-links. ExpressRoute FastPath - /// (expressRouteGatewayBypass) must be enabled. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), IList ingressNatRules = default(IList), IList egressNatRules = default(IList), string connectionProtocol = default(string), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), IList gatewayCustomBgpIpAddresses = default(IList), bool? useLocalAzureIpAddress = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), IList trafficSelectorPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?), string etag = default(string)) - : base(id, name, type, location, tags) + /// Initializes a new instance of the VirtualNetworkGatewayConnection class. + /// + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the virtual network gateway connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The authorizationKey. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to local network gateway resource. + /// + + /// List of ingress NatRules. + /// + + /// List of egress NatRules. + /// + + /// Gateway connection type. + /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// The routing weight. + /// + + /// The dead peer detection timeout of this connection in seconds. + /// + + /// The connection mode for this connection. + /// Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + + /// The IPSec shared key. + /// + + /// Virtual Network Gateway connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Collection of all tunnels' connection health status. + /// + + /// The egress bytes transferred in this connection. + /// + + /// The ingress bytes transferred in this connection. + /// + + /// The reference to peerings resource. + /// + + /// EnableBgp flag. + /// + + /// GatewayCustomBgpIpAddresses to be used for virtual network gateway + /// Connection. + /// + + /// Use private local Azure IP for the connection. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// The Traffic Selector Policies to be considered by this connection. + /// + + /// The resource GUID property of the virtual network gateway connection + /// resource. + /// + + /// Bypass ExpressRoute Gateway for data forwarding. + /// + + /// Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute + /// FastPath (expressRouteGatewayBypass) must be enabled. + /// + public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), System.Collections.Generic.IList ingressNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList egressNatRules = default(System.Collections.Generic.IList), string connectionProtocol = default(string), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), System.Collections.Generic.IList tunnelConnectionStatus = default(System.Collections.Generic.IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), System.Collections.Generic.IList gatewayCustomBgpIPAddresses = default(System.Collections.Generic.IList), bool? useLocalAzureIPAddress = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList trafficSelectorPolicies = default(System.Collections.Generic.IList), string resourceGuid = default(string), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?)) + + : base(id, name, type, location, tags) { - AuthorizationKey = authorizationKey; - VirtualNetworkGateway1 = virtualNetworkGateway1; - VirtualNetworkGateway2 = virtualNetworkGateway2; - LocalNetworkGateway2 = localNetworkGateway2; - IngressNatRules = ingressNatRules; - EgressNatRules = egressNatRules; - ConnectionType = connectionType; - ConnectionProtocol = connectionProtocol; - RoutingWeight = routingWeight; - DpdTimeoutSeconds = dpdTimeoutSeconds; - ConnectionMode = connectionMode; - SharedKey = sharedKey; - ConnectionStatus = connectionStatus; - TunnelConnectionStatus = tunnelConnectionStatus; - EgressBytesTransferred = egressBytesTransferred; - IngressBytesTransferred = ingressBytesTransferred; - Peer = peer; - EnableBgp = enableBgp; - GatewayCustomBgpIpAddresses = gatewayCustomBgpIpAddresses; - UseLocalAzureIpAddress = useLocalAzureIpAddress; - UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; - IpsecPolicies = ipsecPolicies; - TrafficSelectorPolicies = trafficSelectorPolicies; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - ExpressRouteGatewayBypass = expressRouteGatewayBypass; - EnablePrivateLinkFastPath = enablePrivateLinkFastPath; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.AuthorizationKey = authorizationKey; + this.VirtualNetworkGateway1 = virtualNetworkGateway1; + this.VirtualNetworkGateway2 = virtualNetworkGateway2; + this.LocalNetworkGateway2 = localNetworkGateway2; + this.IngressNatRules = ingressNatRules; + this.EgressNatRules = egressNatRules; + this.ConnectionType = connectionType; + this.ConnectionProtocol = connectionProtocol; + this.RoutingWeight = routingWeight; + this.DpdTimeoutSeconds = dpdTimeoutSeconds; + this.ConnectionMode = connectionMode; + this.SharedKey = sharedKey; + this.ConnectionStatus = connectionStatus; + this.TunnelConnectionStatus = tunnelConnectionStatus; + this.EgressBytesTransferred = egressBytesTransferred; + this.IngressBytesTransferred = ingressBytesTransferred; + this.Peer = peer; + this.EnableBgp = enableBgp; + this.GatewayCustomBgpIPAddresses = gatewayCustomBgpIPAddresses; + this.UseLocalAzureIPAddress = useLocalAzureIPAddress; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.TrafficSelectorPolicies = trafficSelectorPolicies; + this.ResourceGuid = resourceGuid; + this.ExpressRouteGatewayBypass = expressRouteGatewayBypass; + this.EnablePrivateLinkFastPath = enablePrivateLinkFastPath; CustomInit(); } @@ -135,219 +167,223 @@ public VirtualNetworkGatewayConnection() /// partial void CustomInit(); + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the virtual network gateway connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets the authorizationKey. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; set; } /// /// Gets or sets the reference to virtual network gateway resource. /// - [JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] - public VirtualNetworkGateway VirtualNetworkGateway1 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] + public VirtualNetworkGateway VirtualNetworkGateway1 {get; set; } /// /// Gets or sets the reference to virtual network gateway resource. /// - [JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] - public VirtualNetworkGateway VirtualNetworkGateway2 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] + public VirtualNetworkGateway VirtualNetworkGateway2 {get; set; } /// /// Gets or sets the reference to local network gateway resource. /// - [JsonProperty(PropertyName = "properties.localNetworkGateway2")] - public LocalNetworkGateway LocalNetworkGateway2 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkGateway2")] + public LocalNetworkGateway LocalNetworkGateway2 {get; set; } /// /// Gets or sets list of ingress NatRules. /// - [JsonProperty(PropertyName = "properties.ingressNatRules")] - public IList IngressNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressNatRules")] + public System.Collections.Generic.IList IngressNatRules {get; set; } /// /// Gets or sets list of egress NatRules. /// - [JsonProperty(PropertyName = "properties.egressNatRules")] - public IList EgressNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressNatRules")] + public System.Collections.Generic.IList EgressNatRules {get; set; } /// - /// Gets or sets gateway connection type. Possible values include: - /// 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + /// Gets or sets gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' /// - [JsonProperty(PropertyName = "properties.connectionType")] - public string ConnectionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionType")] + public string ConnectionType {get; set; } /// - /// Gets or sets connection protocol used for this connection. Possible - /// values include: 'IKEv2', 'IKEv1' + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' /// - [JsonProperty(PropertyName = "properties.connectionProtocol")] - public string ConnectionProtocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionProtocol")] + public string ConnectionProtocol {get; set; } /// /// Gets or sets the routing weight. /// - [JsonProperty(PropertyName = "properties.routingWeight")] - public int? RoutingWeight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] + public int? RoutingWeight {get; set; } /// - /// Gets or sets the dead peer detection timeout of this connection in - /// seconds. + /// Gets or sets the dead peer detection timeout of this connection in seconds. /// - [JsonProperty(PropertyName = "properties.dpdTimeoutSeconds")] - public int? DpdTimeoutSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dpdTimeoutSeconds")] + public int? DpdTimeoutSeconds {get; set; } /// - /// Gets or sets the connection mode for this connection. Possible - /// values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + /// Gets or sets the connection mode for this connection. Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' /// - [JsonProperty(PropertyName = "properties.connectionMode")] - public string ConnectionMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionMode")] + public string ConnectionMode {get; set; } /// /// Gets or sets the IPSec shared key. /// - [JsonProperty(PropertyName = "properties.sharedKey")] - public string SharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey {get; set; } /// - /// Gets virtual Network Gateway connection status. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] + public string ConnectionStatus {get; private set; } /// - /// Gets collection of all tunnels' connection health status. + /// Gets collection of all tunnels' connection health status. /// - [JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] - public IList TunnelConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] + public System.Collections.Generic.IList TunnelConnectionStatus {get; private set; } /// /// Gets the egress bytes transferred in this connection. /// - [JsonProperty(PropertyName = "properties.egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } /// /// Gets the ingress bytes transferred in this connection. /// - [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } /// /// Gets or sets the reference to peerings resource. /// - [JsonProperty(PropertyName = "properties.peer")] - public SubResource Peer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peer")] + public SubResource Peer {get; set; } /// /// Gets or sets enableBgp flag. /// - [JsonProperty(PropertyName = "properties.enableBgp")] - public bool? EnableBgp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + public bool? EnableBgp {get; set; } /// - /// Gets or sets gatewayCustomBgpIpAddresses to be used for virtual - /// network gateway Connection. + /// Gets or sets gatewayCustomBgpIpAddresses to be used for virtual network + /// gateway Connection. /// - [JsonProperty(PropertyName = "properties.gatewayCustomBgpIpAddresses")] - public IList GatewayCustomBgpIpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayCustomBgpIpAddresses")] + public System.Collections.Generic.IList GatewayCustomBgpIPAddresses {get; set; } /// /// Gets or sets use private local Azure IP for the connection. /// - [JsonProperty(PropertyName = "properties.useLocalAzureIpAddress")] - public bool? UseLocalAzureIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useLocalAzureIpAddress")] + public bool? UseLocalAzureIPAddress {get; set; } /// /// Gets or sets enable policy-based traffic selectors. /// - [JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] - public bool? UsePolicyBasedTrafficSelectors { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } /// - /// Gets or sets the IPSec Policies to be considered by this - /// connection. + /// Gets or sets the IPSec Policies to be considered by this connection. /// - [JsonProperty(PropertyName = "properties.ipsecPolicies")] - public IList IpsecPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } /// /// Gets or sets the Traffic Selector Policies to be considered by this /// connection. /// - [JsonProperty(PropertyName = "properties.trafficSelectorPolicies")] - public IList TrafficSelectorPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trafficSelectorPolicies")] + public System.Collections.Generic.IList TrafficSelectorPolicies {get; set; } /// - /// Gets the resource GUID property of the virtual network gateway - /// connection resource. + /// Gets the resource GUID property of the virtual network gateway connection + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - - /// - /// Gets the provisioning state of the virtual network gateway - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Gets or sets bypass ExpressRoute Gateway for data forwarding. /// - [JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] - public bool? ExpressRouteGatewayBypass { get; set; } - - /// - /// Gets or sets bypass the ExpressRoute gateway when accessing - /// private-links. ExpressRoute FastPath (expressRouteGatewayBypass) - /// must be enabled. - /// - [JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")] - public bool? EnablePrivateLinkFastPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets bypass the ExpressRoute gateway when accessing private-links. + /// ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")] + public bool? EnablePrivateLinkFastPath {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualNetworkGateway1 == null) + if (this.VirtualNetworkGateway1 == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); } - if (ConnectionType == null) + if (this.ConnectionType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectionType"); } - if (VirtualNetworkGateway1 != null) + + + + if (this.VirtualNetworkGateway1 != null) { - VirtualNetworkGateway1.Validate(); + this.VirtualNetworkGateway1.Validate(); } - if (VirtualNetworkGateway2 != null) + if (this.VirtualNetworkGateway2 != null) { - VirtualNetworkGateway2.Validate(); + this.VirtualNetworkGateway2.Validate(); } - if (LocalNetworkGateway2 != null) + if (this.LocalNetworkGateway2 != null) { - LocalNetworkGateway2.Validate(); + this.LocalNetworkGateway2.Validate(); } - if (GatewayCustomBgpIpAddresses != null) + + + + + + + + + + if (this.GatewayCustomBgpIPAddresses != null) { - foreach (var element in GatewayCustomBgpIpAddresses) + foreach (var element in this.GatewayCustomBgpIPAddresses) { if (element != null) { @@ -355,26 +391,27 @@ public virtual void Validate() } } } - if (IpsecPolicies != null) + if (this.IpsecPolicies != null) { - foreach (var element1 in IpsecPolicies) + foreach (var element in this.IpsecPolicies) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (TrafficSelectorPolicies != null) + if (this.TrafficSelectorPolicies != null) { - foreach (var element2 in TrafficSelectorPolicies) + foreach (var element in this.TrafficSelectorPolicies) { - if (element2 != null) + if (element != null) { - element2.Validate(); + element.Validate(); } } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs index 7da999a0f7a3..807aa5da799f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayConnectionListEntity : Resource { /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayConnectionListEntity class. + /// Initializes a new instance of the VirtualNetworkGatewayConnectionListEntity class. /// public VirtualNetworkGatewayConnectionListEntity() { @@ -33,90 +22,127 @@ public VirtualNetworkGatewayConnectionListEntity() } /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayConnectionListEntity class. + /// Initializes a new instance of the VirtualNetworkGatewayConnectionListEntity class. /// - /// The reference to virtual - /// network gateway resource. - /// Gateway connection type. Possible - /// values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', - /// 'VPNClient' - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The authorizationKey. - /// The reference to virtual - /// network gateway resource. - /// The reference to local network - /// gateway resource. - /// Connection protocol used for this - /// connection. Possible values include: 'IKEv2', 'IKEv1' - /// The routing weight. - /// The connection mode for this - /// connection. Possible values include: 'Default', 'ResponderOnly', - /// 'InitiatorOnly' - /// The IPSec shared key. - /// Virtual Network Gateway connection - /// status. Possible values include: 'Unknown', 'Connecting', - /// 'Connected', 'NotConnected' - /// Collection of all tunnels' - /// connection health status. - /// The egress bytes transferred - /// in this connection. - /// The ingress bytes transferred - /// in this connection. - /// The reference to peerings resource. - /// EnableBgp flag. - /// GatewayCustomBgpIpAddresses to - /// be used for virtual network gateway Connection. - /// Enable policy-based - /// traffic selectors. - /// The IPSec Policies to be considered by - /// this connection. - /// The Traffic Selector Policies - /// to be considered by this connection. - /// The resource GUID property of the - /// virtual network gateway connection resource. - /// The provisioning state of the - /// virtual network gateway connection resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Bypass ExpressRoute Gateway - /// for data forwarding. - /// Bypass the ExpressRoute - /// gateway when accessing private-links. ExpressRoute FastPath - /// (expressRouteGatewayBypass) must be enabled. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetworkGatewayConnectionListEntity(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkConnectionGatewayReference virtualNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), VirtualNetworkConnectionGatewayReference localNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), string connectionProtocol = default(string), int? routingWeight = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), IList gatewayCustomBgpIpAddresses = default(IList), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), IList trafficSelectorPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the virtual network gateway connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The authorizationKey. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to local network gateway resource. + /// + + /// Gateway connection type. + /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// The routing weight. + /// + + /// The connection mode for this connection. + /// Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + + /// The IPSec shared key. + /// + + /// Virtual Network Gateway connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Collection of all tunnels' connection health status. + /// + + /// The egress bytes transferred in this connection. + /// + + /// The ingress bytes transferred in this connection. + /// + + /// The reference to peerings resource. + /// + + /// EnableBgp flag. + /// + + /// GatewayCustomBgpIpAddresses to be used for virtual network gateway + /// Connection. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// The Traffic Selector Policies to be considered by this connection. + /// + + /// The resource GUID property of the virtual network gateway connection + /// resource. + /// + + /// Bypass ExpressRoute Gateway for data forwarding. + /// + + /// Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute + /// FastPath (expressRouteGatewayBypass) must be enabled. + /// + public VirtualNetworkGatewayConnectionListEntity(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), string authorizationKey = default(string), VirtualNetworkConnectionGatewayReference virtualNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), VirtualNetworkConnectionGatewayReference localNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), string connectionProtocol = default(string), int? routingWeight = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), System.Collections.Generic.IList tunnelConnectionStatus = default(System.Collections.Generic.IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), System.Collections.Generic.IList gatewayCustomBgpIPAddresses = default(System.Collections.Generic.IList), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList trafficSelectorPolicies = default(System.Collections.Generic.IList), string resourceGuid = default(string), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?)) + + : base(id, name, type, location, tags) { - AuthorizationKey = authorizationKey; - VirtualNetworkGateway1 = virtualNetworkGateway1; - VirtualNetworkGateway2 = virtualNetworkGateway2; - LocalNetworkGateway2 = localNetworkGateway2; - ConnectionType = connectionType; - ConnectionProtocol = connectionProtocol; - RoutingWeight = routingWeight; - ConnectionMode = connectionMode; - SharedKey = sharedKey; - ConnectionStatus = connectionStatus; - TunnelConnectionStatus = tunnelConnectionStatus; - EgressBytesTransferred = egressBytesTransferred; - IngressBytesTransferred = ingressBytesTransferred; - Peer = peer; - EnableBgp = enableBgp; - GatewayCustomBgpIpAddresses = gatewayCustomBgpIpAddresses; - UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; - IpsecPolicies = ipsecPolicies; - TrafficSelectorPolicies = trafficSelectorPolicies; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - ExpressRouteGatewayBypass = expressRouteGatewayBypass; - EnablePrivateLinkFastPath = enablePrivateLinkFastPath; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.AuthorizationKey = authorizationKey; + this.VirtualNetworkGateway1 = virtualNetworkGateway1; + this.VirtualNetworkGateway2 = virtualNetworkGateway2; + this.LocalNetworkGateway2 = localNetworkGateway2; + this.ConnectionType = connectionType; + this.ConnectionProtocol = connectionProtocol; + this.RoutingWeight = routingWeight; + this.ConnectionMode = connectionMode; + this.SharedKey = sharedKey; + this.ConnectionStatus = connectionStatus; + this.TunnelConnectionStatus = tunnelConnectionStatus; + this.EgressBytesTransferred = egressBytesTransferred; + this.IngressBytesTransferred = ingressBytesTransferred; + this.Peer = peer; + this.EnableBgp = enableBgp; + this.GatewayCustomBgpIPAddresses = gatewayCustomBgpIPAddresses; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.TrafficSelectorPolicies = trafficSelectorPolicies; + this.ResourceGuid = resourceGuid; + this.ExpressRouteGatewayBypass = expressRouteGatewayBypass; + this.EnablePrivateLinkFastPath = enablePrivateLinkFastPath; CustomInit(); } @@ -125,194 +151,197 @@ public VirtualNetworkGatewayConnectionListEntity() /// partial void CustomInit(); + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the virtual network gateway connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets or sets the authorizationKey. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey {get; set; } /// /// Gets or sets the reference to virtual network gateway resource. /// - [JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] - public VirtualNetworkConnectionGatewayReference VirtualNetworkGateway1 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] + public VirtualNetworkConnectionGatewayReference VirtualNetworkGateway1 {get; set; } /// /// Gets or sets the reference to virtual network gateway resource. /// - [JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] - public VirtualNetworkConnectionGatewayReference VirtualNetworkGateway2 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] + public VirtualNetworkConnectionGatewayReference VirtualNetworkGateway2 {get; set; } /// /// Gets or sets the reference to local network gateway resource. /// - [JsonProperty(PropertyName = "properties.localNetworkGateway2")] - public VirtualNetworkConnectionGatewayReference LocalNetworkGateway2 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkGateway2")] + public VirtualNetworkConnectionGatewayReference LocalNetworkGateway2 {get; set; } /// - /// Gets or sets gateway connection type. Possible values include: - /// 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + /// Gets or sets gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' /// - [JsonProperty(PropertyName = "properties.connectionType")] - public string ConnectionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionType")] + public string ConnectionType {get; set; } /// - /// Gets or sets connection protocol used for this connection. Possible - /// values include: 'IKEv2', 'IKEv1' + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' /// - [JsonProperty(PropertyName = "properties.connectionProtocol")] - public string ConnectionProtocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionProtocol")] + public string ConnectionProtocol {get; set; } /// /// Gets or sets the routing weight. /// - [JsonProperty(PropertyName = "properties.routingWeight")] - public int? RoutingWeight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] + public int? RoutingWeight {get; set; } /// - /// Gets or sets the connection mode for this connection. Possible - /// values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + /// Gets or sets the connection mode for this connection. Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' /// - [JsonProperty(PropertyName = "properties.connectionMode")] - public string ConnectionMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionMode")] + public string ConnectionMode {get; set; } /// /// Gets or sets the IPSec shared key. /// - [JsonProperty(PropertyName = "properties.sharedKey")] - public string SharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey {get; set; } /// - /// Gets virtual Network Gateway connection status. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] + public string ConnectionStatus {get; private set; } /// - /// Gets collection of all tunnels' connection health status. + /// Gets collection of all tunnels' connection health status. /// - [JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] - public IList TunnelConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] + public System.Collections.Generic.IList TunnelConnectionStatus {get; private set; } /// /// Gets the egress bytes transferred in this connection. /// - [JsonProperty(PropertyName = "properties.egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } /// /// Gets the ingress bytes transferred in this connection. /// - [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } /// /// Gets or sets the reference to peerings resource. /// - [JsonProperty(PropertyName = "properties.peer")] - public SubResource Peer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peer")] + public SubResource Peer {get; set; } /// /// Gets or sets enableBgp flag. /// - [JsonProperty(PropertyName = "properties.enableBgp")] - public bool? EnableBgp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + public bool? EnableBgp {get; set; } /// - /// Gets or sets gatewayCustomBgpIpAddresses to be used for virtual - /// network gateway Connection. + /// Gets or sets gatewayCustomBgpIpAddresses to be used for virtual network + /// gateway Connection. /// - [JsonProperty(PropertyName = "properties.gatewayCustomBgpIpAddresses")] - public IList GatewayCustomBgpIpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayCustomBgpIpAddresses")] + public System.Collections.Generic.IList GatewayCustomBgpIPAddresses {get; set; } /// /// Gets or sets enable policy-based traffic selectors. /// - [JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] - public bool? UsePolicyBasedTrafficSelectors { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } /// - /// Gets or sets the IPSec Policies to be considered by this - /// connection. + /// Gets or sets the IPSec Policies to be considered by this connection. /// - [JsonProperty(PropertyName = "properties.ipsecPolicies")] - public IList IpsecPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } /// /// Gets or sets the Traffic Selector Policies to be considered by this /// connection. /// - [JsonProperty(PropertyName = "properties.trafficSelectorPolicies")] - public IList TrafficSelectorPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trafficSelectorPolicies")] + public System.Collections.Generic.IList TrafficSelectorPolicies {get; set; } /// - /// Gets the resource GUID property of the virtual network gateway - /// connection resource. + /// Gets the resource GUID property of the virtual network gateway connection + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } - - /// - /// Gets the provisioning state of the virtual network gateway - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Gets or sets bypass ExpressRoute Gateway for data forwarding. /// - [JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] - public bool? ExpressRouteGatewayBypass { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass {get; set; } /// - /// Gets or sets bypass the ExpressRoute gateway when accessing - /// private-links. ExpressRoute FastPath (expressRouteGatewayBypass) - /// must be enabled. + /// Gets or sets bypass the ExpressRoute gateway when accessing private-links. + /// ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. /// - [JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")] - public bool? EnablePrivateLinkFastPath { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")] + public bool? EnablePrivateLinkFastPath {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualNetworkGateway1 == null) + if (this.VirtualNetworkGateway1 == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); } - if (ConnectionType == null) + if (this.ConnectionType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectionType"); } - if (VirtualNetworkGateway1 != null) + + + + if (this.VirtualNetworkGateway1 != null) { - VirtualNetworkGateway1.Validate(); + this.VirtualNetworkGateway1.Validate(); } - if (VirtualNetworkGateway2 != null) + if (this.VirtualNetworkGateway2 != null) { - VirtualNetworkGateway2.Validate(); + this.VirtualNetworkGateway2.Validate(); } - if (LocalNetworkGateway2 != null) + if (this.LocalNetworkGateway2 != null) { - LocalNetworkGateway2.Validate(); + this.LocalNetworkGateway2.Validate(); } - if (GatewayCustomBgpIpAddresses != null) + + + + + + + + if (this.GatewayCustomBgpIPAddresses != null) { - foreach (var element in GatewayCustomBgpIpAddresses) + foreach (var element in this.GatewayCustomBgpIPAddresses) { if (element != null) { @@ -320,26 +349,27 @@ public virtual void Validate() } } } - if (IpsecPolicies != null) + if (this.IpsecPolicies != null) { - foreach (var element1 in IpsecPolicies) + foreach (var element in this.IpsecPolicies) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (TrafficSelectorPolicies != null) + if (this.TrafficSelectorPolicies != null) { - foreach (var element2 in TrafficSelectorPolicies) + foreach (var element in this.TrafficSelectorPolicies) { - if (element2 != null) + if (element != null) { - element2.Validate(); + element.Validate(); } } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.cs new file mode 100644 index 000000000000..de024e79f4c1 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// VirtualNetworkGatewayConnection properties. + /// + public partial class VirtualNetworkGatewayConnectionListEntityPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayConnectionListEntityPropertiesFormat class. + /// + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkGatewayConnectionListEntityPropertiesFormat class. + /// + + /// The authorizationKey. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to local network gateway resource. + /// + + /// Gateway connection type. + /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// The routing weight. + /// + + /// The connection mode for this connection. + /// Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + + /// The IPSec shared key. + /// + + /// Virtual Network Gateway connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Collection of all tunnels' connection health status. + /// + + /// The egress bytes transferred in this connection. + /// + + /// The ingress bytes transferred in this connection. + /// + + /// The reference to peerings resource. + /// + + /// EnableBgp flag. + /// + + /// GatewayCustomBgpIpAddresses to be used for virtual network gateway + /// Connection. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// The Traffic Selector Policies to be considered by this connection. + /// + + /// The resource GUID property of the virtual network gateway connection + /// resource. + /// + + /// The provisioning state of the virtual network gateway connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Bypass ExpressRoute Gateway for data forwarding. + /// + + /// Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute + /// FastPath (expressRouteGatewayBypass) must be enabled. + /// + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1, string connectionType, string authorizationKey = default(string), VirtualNetworkConnectionGatewayReference virtualNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), VirtualNetworkConnectionGatewayReference localNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), string connectionProtocol = default(string), int? routingWeight = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), System.Collections.Generic.IList tunnelConnectionStatus = default(System.Collections.Generic.IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), System.Collections.Generic.IList gatewayCustomBgpIPAddresses = default(System.Collections.Generic.IList), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList trafficSelectorPolicies = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?)) + + { + this.AuthorizationKey = authorizationKey; + this.VirtualNetworkGateway1 = virtualNetworkGateway1; + this.VirtualNetworkGateway2 = virtualNetworkGateway2; + this.LocalNetworkGateway2 = localNetworkGateway2; + this.ConnectionType = connectionType; + this.ConnectionProtocol = connectionProtocol; + this.RoutingWeight = routingWeight; + this.ConnectionMode = connectionMode; + this.SharedKey = sharedKey; + this.ConnectionStatus = connectionStatus; + this.TunnelConnectionStatus = tunnelConnectionStatus; + this.EgressBytesTransferred = egressBytesTransferred; + this.IngressBytesTransferred = ingressBytesTransferred; + this.Peer = peer; + this.EnableBgp = enableBgp; + this.GatewayCustomBgpIPAddresses = gatewayCustomBgpIPAddresses; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.TrafficSelectorPolicies = trafficSelectorPolicies; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.ExpressRouteGatewayBypass = expressRouteGatewayBypass; + this.EnablePrivateLinkFastPath = enablePrivateLinkFastPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the authorizationKey. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; set; } + + /// + /// Gets or sets the reference to virtual network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkGateway1")] + public VirtualNetworkConnectionGatewayReference VirtualNetworkGateway1 {get; set; } + + /// + /// Gets or sets the reference to virtual network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkGateway2")] + public VirtualNetworkConnectionGatewayReference VirtualNetworkGateway2 {get; set; } + + /// + /// Gets or sets the reference to local network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "localNetworkGateway2")] + public VirtualNetworkConnectionGatewayReference LocalNetworkGateway2 {get; set; } + + /// + /// Gets or sets gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionType")] + public string ConnectionType {get; set; } + + /// + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionProtocol")] + public string ConnectionProtocol {get; set; } + + /// + /// Gets or sets the routing weight. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingWeight")] + public int? RoutingWeight {get; set; } + + /// + /// Gets or sets the connection mode for this connection. Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionMode")] + public string ConnectionMode {get; set; } + + /// + /// Gets or sets the IPSec shared key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedKey")] + public string SharedKey {get; set; } + + /// + /// Gets virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } + + /// + /// Gets collection of all tunnels' connection health status. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnelConnectionStatus")] + public System.Collections.Generic.IList TunnelConnectionStatus {get; private set; } + + /// + /// Gets the egress bytes transferred in this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } + + /// + /// Gets the ingress bytes transferred in this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } + + /// + /// Gets or sets the reference to peerings resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peer")] + public SubResource Peer {get; set; } + + /// + /// Gets or sets enableBgp flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgp")] + public bool? EnableBgp {get; set; } + + /// + /// Gets or sets gatewayCustomBgpIpAddresses to be used for virtual network + /// gateway Connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayCustomBgpIpAddresses")] + public System.Collections.Generic.IList GatewayCustomBgpIPAddresses {get; set; } + + /// + /// Gets or sets enable policy-based traffic selectors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } + + /// + /// Gets or sets the IPSec Policies to be considered by this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } + + /// + /// Gets or sets the Traffic Selector Policies to be considered by this + /// connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trafficSelectorPolicies")] + public System.Collections.Generic.IList TrafficSelectorPolicies {get; set; } + + /// + /// Gets the resource GUID property of the virtual network gateway connection + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the virtual network gateway connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets bypass ExpressRoute Gateway for data forwarding. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass {get; set; } + + /// + /// Gets or sets bypass the ExpressRoute gateway when accessing private-links. + /// ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePrivateLinkFastPath")] + public bool? EnablePrivateLinkFastPath {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.VirtualNetworkGateway1 == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); + } + if (this.ConnectionType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectionType"); + } + + if (this.VirtualNetworkGateway1 != null) + { + this.VirtualNetworkGateway1.Validate(); + } + if (this.VirtualNetworkGateway2 != null) + { + this.VirtualNetworkGateway2.Validate(); + } + if (this.LocalNetworkGateway2 != null) + { + this.LocalNetworkGateway2.Validate(); + } + + + + + + + + if (this.GatewayCustomBgpIPAddresses != null) + { + foreach (var element in this.GatewayCustomBgpIPAddresses) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.IpsecPolicies != null) + { + foreach (var element in this.IpsecPolicies) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.TrafficSelectorPolicies != null) + { + foreach (var element in this.TrafficSelectorPolicies) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionMode.cs index 2007e1e57491..f9f1b672b05d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewayConnectionMode. /// + + public static class VirtualNetworkGatewayConnectionMode { public const string Default = "Default"; public const string ResponderOnly = "ResponderOnly"; public const string InitiatorOnly = "InitiatorOnly"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionPropertiesFormat.cs new file mode 100644 index 000000000000..5f1c7ab28c2c --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionPropertiesFormat.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// VirtualNetworkGatewayConnection properties. + /// + public partial class VirtualNetworkGatewayConnectionPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayConnectionPropertiesFormat class. + /// + public VirtualNetworkGatewayConnectionPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkGatewayConnectionPropertiesFormat class. + /// + + /// The authorizationKey. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to virtual network gateway resource. + /// + + /// The reference to local network gateway resource. + /// + + /// List of ingress NatRules. + /// + + /// List of egress NatRules. + /// + + /// Gateway connection type. + /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// The routing weight. + /// + + /// The dead peer detection timeout of this connection in seconds. + /// + + /// The connection mode for this connection. + /// Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + + /// The IPSec shared key. + /// + + /// Virtual Network Gateway connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Collection of all tunnels' connection health status. + /// + + /// The egress bytes transferred in this connection. + /// + + /// The ingress bytes transferred in this connection. + /// + + /// The reference to peerings resource. + /// + + /// EnableBgp flag. + /// + + /// GatewayCustomBgpIpAddresses to be used for virtual network gateway + /// Connection. + /// + + /// Use private local Azure IP for the connection. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// The Traffic Selector Policies to be considered by this connection. + /// + + /// The resource GUID property of the virtual network gateway connection + /// resource. + /// + + /// The provisioning state of the virtual network gateway connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Bypass ExpressRoute Gateway for data forwarding. + /// + + /// Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute + /// FastPath (expressRouteGatewayBypass) must be enabled. + /// + public VirtualNetworkGatewayConnectionPropertiesFormat(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), System.Collections.Generic.IList ingressNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList egressNatRules = default(System.Collections.Generic.IList), string connectionProtocol = default(string), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), System.Collections.Generic.IList tunnelConnectionStatus = default(System.Collections.Generic.IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), System.Collections.Generic.IList gatewayCustomBgpIPAddresses = default(System.Collections.Generic.IList), bool? useLocalAzureIPAddress = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList trafficSelectorPolicies = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), bool? enablePrivateLinkFastPath = default(bool?)) + + { + this.AuthorizationKey = authorizationKey; + this.VirtualNetworkGateway1 = virtualNetworkGateway1; + this.VirtualNetworkGateway2 = virtualNetworkGateway2; + this.LocalNetworkGateway2 = localNetworkGateway2; + this.IngressNatRules = ingressNatRules; + this.EgressNatRules = egressNatRules; + this.ConnectionType = connectionType; + this.ConnectionProtocol = connectionProtocol; + this.RoutingWeight = routingWeight; + this.DpdTimeoutSeconds = dpdTimeoutSeconds; + this.ConnectionMode = connectionMode; + this.SharedKey = sharedKey; + this.ConnectionStatus = connectionStatus; + this.TunnelConnectionStatus = tunnelConnectionStatus; + this.EgressBytesTransferred = egressBytesTransferred; + this.IngressBytesTransferred = ingressBytesTransferred; + this.Peer = peer; + this.EnableBgp = enableBgp; + this.GatewayCustomBgpIPAddresses = gatewayCustomBgpIPAddresses; + this.UseLocalAzureIPAddress = useLocalAzureIPAddress; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.TrafficSelectorPolicies = trafficSelectorPolicies; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.ExpressRouteGatewayBypass = expressRouteGatewayBypass; + this.EnablePrivateLinkFastPath = enablePrivateLinkFastPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the authorizationKey. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationKey")] + public string AuthorizationKey {get; set; } + + /// + /// Gets or sets the reference to virtual network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkGateway1")] + public VirtualNetworkGateway VirtualNetworkGateway1 {get; set; } + + /// + /// Gets or sets the reference to virtual network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkGateway2")] + public VirtualNetworkGateway VirtualNetworkGateway2 {get; set; } + + /// + /// Gets or sets the reference to local network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "localNetworkGateway2")] + public LocalNetworkGateway LocalNetworkGateway2 {get; set; } + + /// + /// Gets or sets list of ingress NatRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressNatRules")] + public System.Collections.Generic.IList IngressNatRules {get; set; } + + /// + /// Gets or sets list of egress NatRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressNatRules")] + public System.Collections.Generic.IList EgressNatRules {get; set; } + + /// + /// Gets or sets gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionType")] + public string ConnectionType {get; set; } + + /// + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionProtocol")] + public string ConnectionProtocol {get; set; } + + /// + /// Gets or sets the routing weight. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingWeight")] + public int? RoutingWeight {get; set; } + + /// + /// Gets or sets the dead peer detection timeout of this connection in seconds. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dpdTimeoutSeconds")] + public int? DpdTimeoutSeconds {get; set; } + + /// + /// Gets or sets the connection mode for this connection. Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionMode")] + public string ConnectionMode {get; set; } + + /// + /// Gets or sets the IPSec shared key. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedKey")] + public string SharedKey {get; set; } + + /// + /// Gets virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } + + /// + /// Gets collection of all tunnels' connection health status. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnelConnectionStatus")] + public System.Collections.Generic.IList TunnelConnectionStatus {get; private set; } + + /// + /// Gets the egress bytes transferred in this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } + + /// + /// Gets the ingress bytes transferred in this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } + + /// + /// Gets or sets the reference to peerings resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peer")] + public SubResource Peer {get; set; } + + /// + /// Gets or sets enableBgp flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgp")] + public bool? EnableBgp {get; set; } + + /// + /// Gets or sets gatewayCustomBgpIpAddresses to be used for virtual network + /// gateway Connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayCustomBgpIpAddresses")] + public System.Collections.Generic.IList GatewayCustomBgpIPAddresses {get; set; } + + /// + /// Gets or sets use private local Azure IP for the connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "useLocalAzureIpAddress")] + public bool? UseLocalAzureIPAddress {get; set; } + + /// + /// Gets or sets enable policy-based traffic selectors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } + + /// + /// Gets or sets the IPSec Policies to be considered by this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } + + /// + /// Gets or sets the Traffic Selector Policies to be considered by this + /// connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trafficSelectorPolicies")] + public System.Collections.Generic.IList TrafficSelectorPolicies {get; set; } + + /// + /// Gets the resource GUID property of the virtual network gateway connection + /// resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the virtual network gateway connection + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets bypass ExpressRoute Gateway for data forwarding. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass {get; set; } + + /// + /// Gets or sets bypass the ExpressRoute gateway when accessing private-links. + /// ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePrivateLinkFastPath")] + public bool? EnablePrivateLinkFastPath {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.VirtualNetworkGateway1 == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); + } + if (this.ConnectionType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectionType"); + } + + if (this.VirtualNetworkGateway1 != null) + { + this.VirtualNetworkGateway1.Validate(); + } + if (this.VirtualNetworkGateway2 != null) + { + this.VirtualNetworkGateway2.Validate(); + } + if (this.LocalNetworkGateway2 != null) + { + this.LocalNetworkGateway2.Validate(); + } + + + + + + + + + + if (this.GatewayCustomBgpIPAddresses != null) + { + foreach (var element in this.GatewayCustomBgpIPAddresses) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.IpsecPolicies != null) + { + foreach (var element in this.IpsecPolicies) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.TrafficSelectorPolicies != null) + { + foreach (var element in this.TrafficSelectorPolicies) + { + if (element != null) + { + element.Validate(); + } + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionProtocol.cs index 7d57bd630138..3a3c2ad180d0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewayConnectionProtocol. /// + + public static class VirtualNetworkGatewayConnectionProtocol { public const string IKEv2 = "IKEv2"; public const string IKEv1 = "IKEv1"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs index ae7c84d4c1e1..fec86221f978 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewayConnectionStatus. /// + + public static class VirtualNetworkGatewayConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class VirtualNetworkGatewayConnectionStatus public const string Connected = "Connected"; public const string NotConnected = "NotConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionType.cs index f70f88460170..6e5fed29e0d6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewayConnectionType. /// + + public static class VirtualNetworkGatewayConnectionType { public const string IPsec = "IPsec"; @@ -21,4 +18,4 @@ public static class VirtualNetworkGatewayConnectionType public const string ExpressRoute = "ExpressRoute"; public const string VPNClient = "VPNClient"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs index fbed5dab2cff..6893dcca3e12 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// IP configuration for virtual network gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayIPConfiguration : SubResource { /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayIPConfiguration class. + /// Initializes a new instance of the VirtualNetworkGatewayIPConfiguration class. /// public VirtualNetworkGatewayIPConfiguration() { @@ -31,36 +22,45 @@ public VirtualNetworkGatewayIPConfiguration() } /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayIPConfiguration class. + /// Initializes a new instance of the VirtualNetworkGatewayIPConfiguration class. /// - /// Resource ID. - /// The private IP address - /// allocation method. Possible values include: 'Static', - /// 'Dynamic' - /// The reference to the subnet resource. - /// The reference to the public IP - /// resource. - /// Private IP Address for this - /// gateway. - /// The provisioning state of the - /// virtual network gateway IP configuration resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetworkGatewayIPConfiguration(string id = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string privateIPAddress = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the virtual network gateway IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the subnet resource. + /// + + /// The reference to the public IP resource. + /// + + /// Private IP Address for this gateway. + /// + public VirtualNetworkGatewayIPConfiguration(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string privateIPAddress = default(string)) + + : base(id) { - PrivateIPAllocationMethod = privateIPAllocationMethod; - Subnet = subnet; - PublicIPAddress = publicIPAddress; - PrivateIPAddress = privateIPAddress; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; CustomInit(); } @@ -69,52 +69,50 @@ public VirtualNetworkGatewayIPConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the private IP address allocation method. Possible - /// values include: 'Static', 'Dynamic' + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] - public string PrivateIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the reference to the subnet resource. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the reference to the public IP resource. + /// Gets the provisioning state of the virtual network gateway IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public SubResource PublicIPAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets private IP Address for this gateway. + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] - public string PrivateIPAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } /// - /// Gets the provisioning state of the virtual network gateway IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets or sets the reference to the subnet resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the reference to the public IP resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + public SubResource PublicIPAddress {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets private IP Address for this gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfigurationPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfigurationPropertiesFormat.cs new file mode 100644 index 000000000000..ed8c137854ce --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayIPConfigurationPropertiesFormat.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of VirtualNetworkGatewayIPConfiguration. + /// + public partial class VirtualNetworkGatewayIPConfigurationPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayIPConfigurationPropertiesFormat class. + /// + public VirtualNetworkGatewayIPConfigurationPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkGatewayIPConfigurationPropertiesFormat class. + /// + + /// The private IP address allocation method. + /// Possible values include: 'Static', 'Dynamic' + + /// The reference to the subnet resource. + /// + + /// The reference to the public IP resource. + /// + + /// Private IP Address for this gateway. + /// + + /// The provisioning state of the virtual network gateway IP configuration + /// resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VirtualNetworkGatewayIPConfigurationPropertiesFormat(string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string privateIPAddress = default(string), string provisioningState = default(string)) + + { + this.PrivateIPAllocationMethod = privateIPAllocationMethod; + this.Subnet = subnet; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the private IP address allocation method. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAllocationMethod")] + public string PrivateIPAllocationMethod {get; set; } + + /// + /// Gets or sets the reference to the subnet resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets the reference to the public IP resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddress")] + public SubResource PublicIPAddress {get; set; } + + /// + /// Gets private IP Address for this gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress {get; private set; } + + /// + /// Gets the provisioning state of the virtual network gateway IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRule.cs index f869335babac..d6f63209bb2f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRule.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VirtualNetworkGatewayNatRule Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayNatRule : SubResource { /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRule - /// class. + /// Initializes a new instance of the VirtualNetworkGatewayNatRule class. /// public VirtualNetworkGatewayNatRule() { @@ -33,42 +22,52 @@ public VirtualNetworkGatewayNatRule() } /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRule - /// class. + /// Initializes a new instance of the VirtualNetworkGatewayNatRule class. /// - /// Resource ID. - /// The provisioning state of the NAT - /// Rule resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The type - /// of NAT rule for VPN NAT. Possible values include: 'Static', - /// 'Dynamic' - /// The Source NAT direction of a VPN NAT. Possible - /// values include: 'EgressSnat', 'IngressSnat' - /// The private IP address internal - /// mapping for NAT. - /// The private IP address external - /// mapping for NAT. - /// The IP Configuration ID this NAT - /// rule applies to. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public VirtualNetworkGatewayNatRule(string id = default(string), string provisioningState = default(string), string virtualNetworkGatewayNatRulePropertiesType = default(string), string mode = default(string), IList internalMappings = default(IList), IList externalMappings = default(IList), string ipConfigurationId = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the NAT Rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of NAT rule for VPN NAT. + /// Possible values include: 'Static', 'Dynamic' + + /// The Source NAT direction of a VPN NAT. + /// Possible values include: 'EgressSnat', 'IngressSnat' + + /// The private IP address internal mapping for NAT. + /// + + /// The private IP address external mapping for NAT. + /// + + /// The IP Configuration ID this NAT rule applies to. + /// + public VirtualNetworkGatewayNatRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string propertiesType = default(string), string mode = default(string), System.Collections.Generic.IList internalMappings = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalMappings = default(System.Collections.Generic.IList), string ipConfigurationId = default(string)) + + : base(id) { - ProvisioningState = provisioningState; - VirtualNetworkGatewayNatRulePropertiesType = virtualNetworkGatewayNatRulePropertiesType; - Mode = mode; - InternalMappings = internalMappings; - ExternalMappings = externalMappings; - IpConfigurationId = ipConfigurationId; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PropertiesType = propertiesType; + this.Mode = mode; + this.InternalMappings = internalMappings; + this.ExternalMappings = externalMappings; + this.IPConfigurationId = ipConfigurationId; CustomInit(); } @@ -77,64 +76,61 @@ public VirtualNetworkGatewayNatRule() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the NAT Rule resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the type of NAT rule for VPN NAT. Possible values - /// include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualNetworkGatewayNatRulePropertiesType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the Source NAT direction of a VPN NAT. Possible values - /// include: 'EgressSnat', 'IngressSnat' + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the private IP address internal mapping for NAT. + /// Gets the provisioning state of the NAT Rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.internalMappings")] - public IList InternalMappings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the private IP address external mapping for NAT. + /// Gets or sets the type of NAT rule for VPN NAT. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.externalMappings")] - public IList ExternalMappings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string PropertiesType {get; set; } /// - /// Gets or sets the IP Configuration ID this NAT rule applies to. + /// Gets or sets the Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' /// - [JsonProperty(PropertyName = "properties.ipConfigurationId")] - public string IpConfigurationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mode")] + public string Mode {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the private IP address internal mapping for NAT. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.internalMappings")] + public System.Collections.Generic.IList InternalMappings {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the private IP address external mapping for NAT. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalMappings")] + public System.Collections.Generic.IList ExternalMappings {get; set; } /// - /// Gets resource type. + /// Gets or sets the IP Configuration ID this NAT rule applies to. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurationId")] + public string IPConfigurationId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRuleProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRuleProperties.cs new file mode 100644 index 000000000000..4d4de363e91a --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayNatRuleProperties.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VirtualNetworkGatewayNatRule. + /// + public partial class VirtualNetworkGatewayNatRuleProperties + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayNatRuleProperties class. + /// + public VirtualNetworkGatewayNatRuleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkGatewayNatRuleProperties class. + /// + + /// The provisioning state of the NAT Rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of NAT rule for VPN NAT. + /// Possible values include: 'Static', 'Dynamic' + + /// The Source NAT direction of a VPN NAT. + /// Possible values include: 'EgressSnat', 'IngressSnat' + + /// The private IP address internal mapping for NAT. + /// + + /// The private IP address external mapping for NAT. + /// + + /// The IP Configuration ID this NAT rule applies to. + /// + public VirtualNetworkGatewayNatRuleProperties(string provisioningState = default(string), string type = default(string), string mode = default(string), System.Collections.Generic.IList internalMappings = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalMappings = default(System.Collections.Generic.IList), string ipConfigurationId = default(string)) + + { + this.ProvisioningState = provisioningState; + this.Type = type; + this.Mode = mode; + this.InternalMappings = internalMappings; + this.ExternalMappings = externalMappings; + this.IPConfigurationId = ipConfigurationId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the NAT Rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the type of NAT rule for VPN NAT. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets the Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } + + /// + /// Gets or sets the private IP address internal mapping for NAT. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "internalMappings")] + public System.Collections.Generic.IList InternalMappings {get; set; } + + /// + /// Gets or sets the private IP address external mapping for NAT. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalMappings")] + public System.Collections.Generic.IList ExternalMappings {get; set; } + + /// + /// Gets or sets the IP Configuration ID this NAT rule applies to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurationId")] + public string IPConfigurationId {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroup.cs index 255052326153..eec4f1bdabcd 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroup.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Parameters for VirtualNetworkGatewayPolicyGroup. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayPolicyGroup : SubResource { /// - /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroup - /// class. + /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroup class. /// public VirtualNetworkGatewayPolicyGroup() { @@ -33,36 +22,44 @@ public VirtualNetworkGatewayPolicyGroup() } /// - /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroup - /// class. + /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroup class. /// - /// Shows if this is a Default - /// VirtualNetworkGatewayPolicyGroup or not. - /// Priority for - /// VirtualNetworkGatewayPolicyGroup. - /// Multiple PolicyMembers for - /// VirtualNetworkGatewayPolicyGroup. - /// Resource ID. - /// List of references - /// to vngClientConnectionConfigurations. - /// The provisioning state of the - /// VirtualNetworkGatewayPolicyGroup resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetworkGatewayPolicyGroup(bool isDefault, int priority, IList policyMembers, string id = default(string), IList vngClientConnectionConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + /// + + /// Priority for VirtualNetworkGatewayPolicyGroup. + /// + + /// Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + /// + + /// List of references to vngClientConnectionConfigurations. + /// + public VirtualNetworkGatewayPolicyGroup(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), bool? isDefault = default(bool?), int? priority = default(int?), System.Collections.Generic.IList policyMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList vngClientConnectionConfigurations = default(System.Collections.Generic.IList)) + + : base(id) { - IsDefault = isDefault; - Priority = priority; - PolicyMembers = policyMembers; - VngClientConnectionConfigurations = vngClientConnectionConfigurations; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.IsDefault = isDefault; + this.Priority = priority; + this.PolicyMembers = policyMembers; + this.VngClientConnectionConfigurations = vngClientConnectionConfigurations; CustomInit(); } @@ -71,66 +68,51 @@ public VirtualNetworkGatewayPolicyGroup() /// partial void CustomInit(); - /// - /// Gets or sets shows if this is a Default - /// VirtualNetworkGatewayPolicyGroup or not. - /// - [JsonProperty(PropertyName = "properties.isDefault")] - public bool IsDefault { get; set; } /// - /// Gets or sets priority for VirtualNetworkGatewayPolicyGroup. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets multiple PolicyMembers for - /// VirtualNetworkGatewayPolicyGroup. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.policyMembers")] - public IList PolicyMembers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets list of references to vngClientConnectionConfigurations. + /// Gets the provisioning state of the VirtualNetworkGatewayPolicyGroup + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.vngClientConnectionConfigurations")] - public IList VngClientConnectionConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the VirtualNetworkGatewayPolicyGroup - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets shows if this is a Default VirtualNetworkGatewayPolicyGroup or + /// not. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDefault")] + public bool? IsDefault {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets priority for VirtualNetworkGatewayPolicyGroup. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.policyMembers")] + public System.Collections.Generic.IList PolicyMembers {get; set; } /// - /// Validate the object. + /// Gets list of references to vngClientConnectionConfigurations. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PolicyMembers == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PolicyMembers"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vngClientConnectionConfigurations")] + public System.Collections.Generic.IList VngClientConnectionConfigurations {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupMember.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupMember.cs index 4961ca39c0b2..bb39da119fff 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupMember.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupMember.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualNetworkGatewayPolicyGroupMember { /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayPolicyGroupMember class. + /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroupMember class. /// public VirtualNetworkGatewayPolicyGroupMember() { @@ -28,21 +21,25 @@ public VirtualNetworkGatewayPolicyGroupMember() } /// - /// Initializes a new instance of the - /// VirtualNetworkGatewayPolicyGroupMember class. + /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroupMember class. /// - /// Name of the - /// VirtualNetworkGatewayPolicyGroupMember. + + /// Name of the VirtualNetworkGatewayPolicyGroupMember. + /// + /// The Vpn Policy member attribute type. - /// Possible values include: 'CertificateGroupId', 'AADGroupId', - /// 'RadiusAzureGroupId' + /// Possible values include: 'CertificateGroupId', 'AADGroupId', + /// 'RadiusAzureGroupId' + /// The value of Attribute used for this - /// VirtualNetworkGatewayPolicyGroupMember. + /// VirtualNetworkGatewayPolicyGroupMember. + /// public VirtualNetworkGatewayPolicyGroupMember(string name = default(string), string attributeType = default(string), string attributeValue = default(string)) + { - Name = name; - AttributeType = attributeType; - AttributeValue = attributeValue; + this.Name = name; + this.AttributeType = attributeType; + this.AttributeValue = attributeValue; CustomInit(); } @@ -51,25 +48,24 @@ public VirtualNetworkGatewayPolicyGroupMember() /// partial void CustomInit(); + /// /// Gets or sets name of the VirtualNetworkGatewayPolicyGroupMember. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the Vpn Policy member attribute type. Possible values - /// include: 'CertificateGroupId', 'AADGroupId', 'RadiusAzureGroupId' + /// Gets or sets the Vpn Policy member attribute type. Possible values include: 'CertificateGroupId', 'AADGroupId', 'RadiusAzureGroupId' /// - [JsonProperty(PropertyName = "attributeType")] - public string AttributeType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "attributeType")] + public string AttributeType {get; set; } /// /// Gets or sets the value of Attribute used for this /// VirtualNetworkGatewayPolicyGroupMember. /// - [JsonProperty(PropertyName = "attributeValue")] - public string AttributeValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "attributeValue")] + public string AttributeValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupProperties.cs new file mode 100644 index 000000000000..bfc49ba9d025 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPolicyGroupProperties.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of VirtualNetworkGatewayPolicyGroup. + /// + public partial class VirtualNetworkGatewayPolicyGroupProperties + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroupProperties class. + /// + public VirtualNetworkGatewayPolicyGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkGatewayPolicyGroupProperties class. + /// + + /// Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + /// + + /// Priority for VirtualNetworkGatewayPolicyGroup. + /// + + /// Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + /// + + /// List of references to vngClientConnectionConfigurations. + /// + + /// The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VirtualNetworkGatewayPolicyGroupProperties(bool isDefault, int priority, System.Collections.Generic.IList policyMembers, System.Collections.Generic.IList vngClientConnectionConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.IsDefault = isDefault; + this.Priority = priority; + this.PolicyMembers = policyMembers; + this.VngClientConnectionConfigurations = vngClientConnectionConfigurations; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets shows if this is a Default VirtualNetworkGatewayPolicyGroup or + /// not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDefault")] + public bool IsDefault {get; set; } + + /// + /// Gets or sets priority for VirtualNetworkGatewayPolicyGroup. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int Priority {get; set; } + + /// + /// Gets or sets multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "policyMembers")] + public System.Collections.Generic.IList PolicyMembers {get; set; } + + /// + /// Gets list of references to vngClientConnectionConfigurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vngClientConnectionConfigurations")] + public System.Collections.Generic.IList VngClientConnectionConfigurations {get; private set; } + + /// + /// Gets the provisioning state of the VirtualNetworkGatewayPolicyGroup + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PolicyMembers == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PolicyMembers"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPropertiesFormat.cs new file mode 100644 index 000000000000..37888c0f538c --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayPropertiesFormat.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// VirtualNetworkGateway properties. + /// + public partial class VirtualNetworkGatewayPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayPropertiesFormat class. + /// + public VirtualNetworkGatewayPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkGatewayPropertiesFormat class. + /// + + /// Autoscale configuration for virutal network gateway + /// + + /// IP configurations for virtual network gateway. + /// + + /// The type of this virtual network gateway. + /// Possible values include: 'Vpn', 'ExpressRoute', 'LocalGateway' + + /// The type of this virtual network gateway. + /// Possible values include: 'PolicyBased', 'RouteBased' + + /// The generation for this VirtualNetworkGateway. Must be None if gatewayType + /// is not VPN. + /// Possible values include: 'None', 'Generation1', 'Generation2' + + /// Whether BGP is enabled for this virtual network gateway or not. + /// + + /// Whether private IP needs to be enabled on this gateway for connections or + /// not. + /// + + /// ActiveActive flag. + /// + + /// disableIPSecReplayProtection flag. + /// + + /// The reference to the LocalNetworkGateway resource which represents local + /// network site having default routes. Assign Null value in case of removing + /// existing default site setting. + /// + + /// The reference to the VirtualNetworkGatewaySku resource which represents the + /// SKU selected for Virtual network gateway. + /// + + /// The reference to the VpnClientConfiguration resource which represents the + /// P2S VpnClient configurations. + /// + + /// The reference to the VirtualNetworkGatewayPolicyGroup resource which + /// represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + /// + + /// Virtual network gateway's BGP speaker settings. + /// + + /// The reference to the address space resource which represents the custom + /// routes address space specified by the customer for virtual network gateway + /// and VpnClient. + /// + + /// The resource GUID property of the virtual network gateway resource. + /// + + /// The provisioning state of the virtual network gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Whether dns forwarding is enabled or not. + /// + + /// The IP address allocated by the gateway to which dns requests can be sent. + /// + + /// Customer vnet resource id. VirtualNetworkGateway of type local gateway is + /// associated with the customer vnet. + /// + + /// NatRules for virtual network gateway. + /// + + /// EnableBgpRouteTranslationForNat flag. + /// + + /// Configures this gateway to accept traffic from remote Virtual WAN networks. + /// + + /// Configure this gateway to accept traffic from other Azure Virtual Networks. + /// This configuration does not support connectivity to Azure Virtual WAN. + /// + + /// Property to indicate if the Express Route Gateway serves traffic when there + /// are multiple Express Route Gateways in the vnet + /// Possible values include: 'Enabled', 'Disabled' + public VirtualNetworkGatewayPropertiesFormat(VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration = default(VirtualNetworkGatewayAutoScaleConfiguration), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), string gatewayType = default(string), string vpnType = default(string), string vpnGatewayGeneration = default(string), bool? enableBgp = default(bool?), bool? enablePrivateIPAddress = default(bool?), bool? active = default(bool?), bool? disableIPSecReplayProtection = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), System.Collections.Generic.IList virtualNetworkGatewayPolicyGroups = default(System.Collections.Generic.IList), BgpSettings bgpSettings = default(BgpSettings), AddressSpace customRoutes = default(AddressSpace), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDnsForwarding = default(bool?), string inboundDnsForwardingEndpoint = default(string), string vNetExtendedLocationResourceId = default(string), System.Collections.Generic.IList natRules = default(System.Collections.Generic.IList), bool? enableBgpRouteTranslationForNat = default(bool?), bool? allowVirtualWanTraffic = default(bool?), bool? allowRemoteVnetTraffic = default(bool?), string adminState = default(string)) + + { + this.AutoScaleConfiguration = autoScaleConfiguration; + this.IPConfigurations = ipConfigurations; + this.GatewayType = gatewayType; + this.VpnType = vpnType; + this.VpnGatewayGeneration = vpnGatewayGeneration; + this.EnableBgp = enableBgp; + this.EnablePrivateIPAddress = enablePrivateIPAddress; + this.Active = active; + this.DisableIPSecReplayProtection = disableIPSecReplayProtection; + this.GatewayDefaultSite = gatewayDefaultSite; + this.Sku = sku; + this.VpnClientConfiguration = vpnClientConfiguration; + this.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; + this.BgpSettings = bgpSettings; + this.CustomRoutes = customRoutes; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.EnableDnsForwarding = enableDnsForwarding; + this.InboundDnsForwardingEndpoint = inboundDnsForwardingEndpoint; + this.VNetExtendedLocationResourceId = vNetExtendedLocationResourceId; + this.NatRules = natRules; + this.EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + this.AllowVirtualWanTraffic = allowVirtualWanTraffic; + this.AllowRemoteVnetTraffic = allowRemoteVnetTraffic; + this.AdminState = adminState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets autoscale configuration for virutal network gateway + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoScaleConfiguration")] + public VirtualNetworkGatewayAutoScaleConfiguration AutoScaleConfiguration {get; set; } + + /// + /// Gets or sets iP configurations for virtual network gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; set; } + + /// + /// Gets or sets the type of this virtual network gateway. Possible values include: 'Vpn', 'ExpressRoute', 'LocalGateway' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayType")] + public string GatewayType {get; set; } + + /// + /// Gets or sets the type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnType")] + public string VpnType {get; set; } + + /// + /// Gets or sets the generation for this VirtualNetworkGateway. Must be None if + /// gatewayType is not VPN. Possible values include: 'None', 'Generation1', 'Generation2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnGatewayGeneration")] + public string VpnGatewayGeneration {get; set; } + + /// + /// Gets or sets whether BGP is enabled for this virtual network gateway or + /// not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgp")] + public bool? EnableBgp {get; set; } + + /// + /// Gets or sets whether private IP needs to be enabled on this gateway for + /// connections or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePrivateIpAddress")] + public bool? EnablePrivateIPAddress {get; set; } + + /// + /// Gets or sets activeActive flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "activeActive")] + public bool? Active {get; set; } + + /// + /// Gets or sets disableIPSecReplayProtection flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableIPSecReplayProtection")] + public bool? DisableIPSecReplayProtection {get; set; } + + /// + /// Gets or sets the reference to the LocalNetworkGateway resource which + /// represents local network site having default routes. Assign Null value in + /// case of removing existing default site setting. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "gatewayDefaultSite")] + public SubResource GatewayDefaultSite {get; set; } + + /// + /// Gets or sets the reference to the VirtualNetworkGatewaySku resource which + /// represents the SKU selected for Virtual network gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public VirtualNetworkGatewaySku Sku {get; set; } + + /// + /// Gets or sets the reference to the VpnClientConfiguration resource which + /// represents the P2S VpnClient configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientConfiguration")] + public VpnClientConfiguration VpnClientConfiguration {get; set; } + + /// + /// Gets or sets the reference to the VirtualNetworkGatewayPolicyGroup resource + /// which represents the available VirtualNetworkGatewayPolicyGroup for the + /// gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkGatewayPolicyGroups")] + public System.Collections.Generic.IList VirtualNetworkGatewayPolicyGroups {get; set; } + + /// + /// Gets or sets virtual network gateway's BGP speaker settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpSettings")] + public BgpSettings BgpSettings {get; set; } + + /// + /// Gets or sets the reference to the address space resource which represents + /// the custom routes address space specified by the customer for virtual + /// network gateway and VpnClient. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customRoutes")] + public AddressSpace CustomRoutes {get; set; } + + /// + /// Gets the resource GUID property of the virtual network gateway resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the virtual network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets whether dns forwarding is enabled or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableDnsForwarding")] + public bool? EnableDnsForwarding {get; set; } + + /// + /// Gets the IP address allocated by the gateway to which dns requests can be + /// sent. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundDnsForwardingEndpoint")] + public string InboundDnsForwardingEndpoint {get; private set; } + + /// + /// Gets or sets customer vnet resource id. VirtualNetworkGateway of type local + /// gateway is associated with the customer vnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vNetExtendedLocationResourceId")] + public string VNetExtendedLocationResourceId {get; set; } + + /// + /// Gets or sets natRules for virtual network gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "natRules")] + public System.Collections.Generic.IList NatRules {get; set; } + + /// + /// Gets or sets enableBgpRouteTranslationForNat flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgpRouteTranslationForNat")] + public bool? EnableBgpRouteTranslationForNat {get; set; } + + /// + /// Gets or sets configures this gateway to accept traffic from remote Virtual + /// WAN networks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowVirtualWanTraffic")] + public bool? AllowVirtualWanTraffic {get; set; } + + /// + /// Gets or sets configure this gateway to accept traffic from other Azure + /// Virtual Networks. This configuration does not support connectivity to Azure + /// Virtual WAN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowRemoteVnetTraffic")] + public bool? AllowRemoteVnetTraffic {get; set; } + + /// + /// Gets or sets property to indicate if the Express Route Gateway serves + /// traffic when there are multiple Express Route Gateways in the vnet Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "adminState")] + public string AdminState {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + + if (this.BgpSettings != null) + { + this.BgpSettings.Validate(); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySku.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySku.cs index c8f23c16d325..b86668c66182 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySku.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,22 +23,27 @@ public VirtualNetworkGatewaySku() /// /// Initializes a new instance of the VirtualNetworkGatewaySku class. /// - /// Gateway SKU name. Possible values include: - /// 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - /// 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', 'VpnGw1AZ', - /// 'VpnGw2AZ', 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', - /// 'ErGw2AZ', 'ErGw3AZ', 'ErGwScale' - /// Gateway SKU tier. Possible values include: - /// 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - /// 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', 'VpnGw1AZ', - /// 'VpnGw2AZ', 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', - /// 'ErGw2AZ', 'ErGw3AZ', 'ErGwScale' - /// The capacity. + + /// Gateway SKU name. + /// Possible values include: 'Basic', 'HighPerformance', 'Standard', + /// 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', + /// 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', + /// 'ErGw2AZ', 'ErGw3AZ', 'ErGwScale' + + /// Gateway SKU tier. + /// Possible values include: 'Basic', 'HighPerformance', 'Standard', + /// 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', + /// 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', + /// 'ErGw2AZ', 'ErGw3AZ', 'ErGwScale' + + /// The capacity. + /// public VirtualNetworkGatewaySku(string name = default(string), string tier = default(string), int? capacity = default(int?)) + { - Name = name; - Tier = tier; - Capacity = capacity; + this.Name = name; + this.Tier = tier; + this.Capacity = capacity; CustomInit(); } @@ -53,31 +52,23 @@ public VirtualNetworkGatewaySku() /// partial void CustomInit(); + /// - /// Gets or sets gateway SKU name. Possible values include: 'Basic', - /// 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - /// 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', 'VpnGw1AZ', 'VpnGw2AZ', - /// 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', 'ErGw2AZ', - /// 'ErGw3AZ', 'ErGwScale' + /// Gets or sets gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ', 'ErGwScale' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets gateway SKU tier. Possible values include: 'Basic', - /// 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - /// 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', 'VpnGw1AZ', 'VpnGw2AZ', - /// 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', 'ErGw2AZ', - /// 'ErGw3AZ', 'ErGwScale' + /// Gets or sets gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw4', 'VpnGw5', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'VpnGw4AZ', 'VpnGw5AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ', 'ErGwScale' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } /// /// Gets the capacity. /// - [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public int? Capacity {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuName.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuName.cs index 005669379919..84e24380ea78 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewaySkuName. /// + + public static class VirtualNetworkGatewaySkuName { public const string Basic = "Basic"; @@ -35,4 +32,4 @@ public static class VirtualNetworkGatewaySkuName public const string ErGw3AZ = "ErGw3AZ"; public const string ErGwScale = "ErGwScale"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuTier.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuTier.cs index 40c9f3564232..03de0a1d85b3 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuTier.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewaySkuTier. /// + + public static class VirtualNetworkGatewaySkuTier { public const string Basic = "Basic"; @@ -35,4 +32,4 @@ public static class VirtualNetworkGatewaySkuTier public const string ErGw3AZ = "ErGw3AZ"; public const string ErGwScale = "ErGwScale"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayType.cs index 2b6c6f9454d7..9e5124bc29c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkGatewayType. /// + + public static class VirtualNetworkGatewayType { public const string Vpn = "Vpn"; public const string ExpressRoute = "ExpressRoute"; public const string LocalGateway = "LocalGateway"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeering.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeering.cs index 8d387c34da1a..87b13585ab08 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeering.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeering.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Peerings in a virtual network resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkPeering : SubResource { /// @@ -32,74 +24,93 @@ public VirtualNetworkPeering() /// /// Initializes a new instance of the VirtualNetworkPeering class. /// - /// Resource ID. - /// Whether the VMs in the - /// local virtual network space would be able to access the VMs in - /// remote virtual network space. - /// Whether the forwarded traffic - /// from the VMs in the local virtual network will be - /// allowed/disallowed in remote virtual network. - /// If gateway links can be used in - /// remote virtual networking to link to this virtual network. - /// 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. - /// The reference to 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). - /// The reference to the address space - /// peered with the remote virtual network. - /// The reference to the - /// current address space of the remote virtual network. - /// The reference to the remote - /// virtual network's Bgp Communities. - /// The reference to the - /// remote virtual network's encryption - /// The status of the virtual network - /// peering. Possible values include: 'Initiated', 'Connected', - /// 'Disconnected' - /// The peering sync status of the - /// virtual network peering. Possible values include: 'FullyInSync', - /// 'RemoteNotInSync', 'LocalNotInSync', - /// 'LocalAndRemoteNotInSync' - /// The provisioning state of the - /// virtual network peering resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// If we need to verify the - /// provisioning state of the remote gateway. - /// The resourceGuid property of the Virtual - /// Network peering resource. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public VirtualNetworkPeering(string id = default(string), bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), AddressSpace remoteAddressSpace = default(AddressSpace), AddressSpace remoteVirtualNetworkAddressSpace = default(AddressSpace), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), VirtualNetworkEncryption remoteVirtualNetworkEncryption = default(VirtualNetworkEncryption), string peeringState = default(string), string peeringSyncLevel = default(string), string provisioningState = default(string), bool? doNotVerifyRemoteGateways = default(bool?), string resourceGuid = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the virtual network peering resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Whether the VMs in the local virtual network space would be able to access + /// the VMs in remote virtual network space. + /// + + /// Whether the forwarded traffic from the VMs in the local virtual network + /// will be allowed/disallowed in remote virtual network. + /// + + /// If gateway links can be used in remote virtual networking to link to this + /// virtual network. + /// + + /// 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. + /// + + /// The reference to 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). + /// + + /// The reference to the address space peered with the remote virtual network. + /// + + /// The reference to the current address space of the remote virtual network. + /// + + /// The reference to the remote virtual network's Bgp Communities. + /// + + /// The reference to the remote virtual network's encryption + /// + + /// The status of the virtual network peering. + /// Possible values include: 'Initiated', 'Connected', 'Disconnected' + + /// The peering sync status of the virtual network peering. + /// Possible values include: 'FullyInSync', 'RemoteNotInSync', + /// 'LocalNotInSync', 'LocalAndRemoteNotInSync' + + /// If we need to verify the provisioning state of the remote gateway. + /// + + /// The resourceGuid property of the Virtual Network peering resource. + /// + public VirtualNetworkPeering(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), AddressSpace remoteAddressSpace = default(AddressSpace), AddressSpace remoteVirtualNetworkAddressSpace = default(AddressSpace), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), VirtualNetworkEncryption remoteVirtualNetworkEncryption = default(VirtualNetworkEncryption), string peeringState = default(string), string peeringSyncLevel = default(string), bool? doNotVerifyRemoteGateways = default(bool?), string resourceGuid = default(string)) + + : base(id) { - AllowVirtualNetworkAccess = allowVirtualNetworkAccess; - AllowForwardedTraffic = allowForwardedTraffic; - AllowGatewayTransit = allowGatewayTransit; - UseRemoteGateways = useRemoteGateways; - RemoteVirtualNetwork = remoteVirtualNetwork; - RemoteAddressSpace = remoteAddressSpace; - RemoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; - RemoteBgpCommunities = remoteBgpCommunities; - RemoteVirtualNetworkEncryption = remoteVirtualNetworkEncryption; - PeeringState = peeringState; - PeeringSyncLevel = peeringSyncLevel; - ProvisioningState = provisioningState; - DoNotVerifyRemoteGateways = doNotVerifyRemoteGateways; - ResourceGuid = resourceGuid; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.AllowVirtualNetworkAccess = allowVirtualNetworkAccess; + this.AllowForwardedTraffic = allowForwardedTraffic; + this.AllowGatewayTransit = allowGatewayTransit; + this.UseRemoteGateways = useRemoteGateways; + this.RemoteVirtualNetwork = remoteVirtualNetwork; + this.RemoteAddressSpace = remoteAddressSpace; + this.RemoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; + this.RemoteBgpCommunities = remoteBgpCommunities; + this.RemoteVirtualNetworkEncryption = remoteVirtualNetworkEncryption; + this.PeeringState = peeringState; + this.PeeringSyncLevel = peeringSyncLevel; + this.DoNotVerifyRemoteGateways = doNotVerifyRemoteGateways; + this.ResourceGuid = resourceGuid; CustomInit(); } @@ -108,148 +119,149 @@ public VirtualNetworkPeering() /// partial void CustomInit(); + /// - /// Gets or sets whether the VMs in the local virtual network space - /// would be able to access the VMs in remote virtual network space. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] - public bool? AllowVirtualNetworkAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets whether the forwarded traffic from the VMs in the - /// local virtual network will be allowed/disallowed in remote virtual - /// network. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.allowForwardedTraffic")] - public bool? AllowForwardedTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets if gateway links can be used in remote virtual - /// networking to link to this virtual network. + /// Gets or sets resource type. /// - [JsonProperty(PropertyName = "properties.allowGatewayTransit")] - public bool? AllowGatewayTransit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets 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. + /// Gets the provisioning state of the virtual network peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.useRemoteGateways")] - public bool? UseRemoteGateways { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the reference to 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). + /// Gets or sets whether the VMs in the local virtual network space would be + /// able to access the VMs in remote virtual network space. /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] - public SubResource RemoteVirtualNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] + public bool? AllowVirtualNetworkAccess {get; set; } /// - /// Gets or sets the reference to the address space peered with the - /// remote virtual network. + /// Gets or sets whether the forwarded traffic from the VMs in the local + /// virtual network will be allowed/disallowed in remote virtual network. /// - [JsonProperty(PropertyName = "properties.remoteAddressSpace")] - public AddressSpace RemoteAddressSpace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowForwardedTraffic")] + public bool? AllowForwardedTraffic {get; set; } /// - /// Gets or sets the reference to the current address space of the - /// remote virtual network. + /// Gets or sets if gateway links can be used in remote virtual networking to + /// link to this virtual network. /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetworkAddressSpace")] - public AddressSpace RemoteVirtualNetworkAddressSpace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowGatewayTransit")] + public bool? AllowGatewayTransit {get; set; } /// - /// Gets or sets the reference to the remote virtual network's Bgp - /// Communities. + /// Gets or sets 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. /// - [JsonProperty(PropertyName = "properties.remoteBgpCommunities")] - public VirtualNetworkBgpCommunities RemoteBgpCommunities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useRemoteGateways")] + public bool? UseRemoteGateways {get; set; } /// - /// Gets the reference to the remote virtual network's encryption + /// Gets or sets the reference to 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). /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetworkEncryption")] - public VirtualNetworkEncryption RemoteVirtualNetworkEncryption { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] + public SubResource RemoteVirtualNetwork {get; set; } /// - /// Gets or sets the status of the virtual network peering. Possible - /// values include: 'Initiated', 'Connected', 'Disconnected' + /// Gets or sets the reference to the address space peered with the remote + /// virtual network. /// - [JsonProperty(PropertyName = "properties.peeringState")] - public string PeeringState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteAddressSpace")] + public AddressSpace RemoteAddressSpace {get; set; } /// - /// Gets or sets the peering sync status of the virtual network - /// peering. Possible values include: 'FullyInSync', 'RemoteNotInSync', - /// 'LocalNotInSync', 'LocalAndRemoteNotInSync' + /// Gets or sets the reference to the current address space of the remote + /// virtual network. /// - [JsonProperty(PropertyName = "properties.peeringSyncLevel")] - public string PeeringSyncLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVirtualNetworkAddressSpace")] + public AddressSpace RemoteVirtualNetworkAddressSpace {get; set; } /// - /// Gets the provisioning state of the virtual network peering - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets the reference to the remote virtual network's Bgp Communities. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteBgpCommunities")] + public VirtualNetworkBgpCommunities RemoteBgpCommunities {get; set; } /// - /// Gets or sets if we need to verify the provisioning state of the - /// remote gateway. + /// Gets the reference to the remote virtual network's encryption /// - [JsonProperty(PropertyName = "properties.doNotVerifyRemoteGateways")] - public bool? DoNotVerifyRemoteGateways { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVirtualNetworkEncryption")] + public VirtualNetworkEncryption RemoteVirtualNetworkEncryption {get; private set; } /// - /// Gets the resourceGuid property of the Virtual Network peering - /// resource. + /// Gets or sets the status of the virtual network peering. Possible values include: 'Initiated', 'Connected', 'Disconnected' /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringState")] + public string PeeringState {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the peering sync status of the virtual network peering. Possible values include: 'FullyInSync', 'RemoteNotInSync', 'LocalNotInSync', 'LocalAndRemoteNotInSync' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringSyncLevel")] + public string PeeringSyncLevel {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets if we need to verify the provisioning state of the remote + /// gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.doNotVerifyRemoteGateways")] + public bool? DoNotVerifyRemoteGateways {get; set; } /// - /// Gets or sets resource type. + /// Gets the resourceGuid property of the Virtual Network peering resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RemoteBgpCommunities != null) + + + + + + + + if (this.RemoteBgpCommunities != null) { - RemoteBgpCommunities.Validate(); + this.RemoteBgpCommunities.Validate(); } - if (RemoteVirtualNetworkEncryption != null) + if (this.RemoteVirtualNetworkEncryption != null) { - RemoteVirtualNetworkEncryption.Validate(); + this.RemoteVirtualNetworkEncryption.Validate(); } + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringLevel.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringLevel.cs index 4ba41da779d6..86ebceb02aa9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringLevel.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringLevel.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkPeeringLevel. /// + + public static class VirtualNetworkPeeringLevel { public const string FullyInSync = "FullyInSync"; @@ -21,4 +18,4 @@ public static class VirtualNetworkPeeringLevel public const string LocalNotInSync = "LocalNotInSync"; public const string LocalAndRemoteNotInSync = "LocalAndRemoteNotInSync"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringPropertiesFormat.cs new file mode 100644 index 000000000000..3e5dcd2ec7ca --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringPropertiesFormat.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the virtual network peering. + /// + public partial class VirtualNetworkPeeringPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkPeeringPropertiesFormat class. + /// + public VirtualNetworkPeeringPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkPeeringPropertiesFormat class. + /// + + /// Whether the VMs in the local virtual network space would be able to access + /// the VMs in remote virtual network space. + /// + + /// Whether the forwarded traffic from the VMs in the local virtual network + /// will be allowed/disallowed in remote virtual network. + /// + + /// If gateway links can be used in remote virtual networking to link to this + /// virtual network. + /// + + /// 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. + /// + + /// The reference to 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). + /// + + /// The reference to the address space peered with the remote virtual network. + /// + + /// The reference to the current address space of the remote virtual network. + /// + + /// The reference to the remote virtual network's Bgp Communities. + /// + + /// The reference to the remote virtual network's encryption + /// + + /// The status of the virtual network peering. + /// Possible values include: 'Initiated', 'Connected', 'Disconnected' + + /// The peering sync status of the virtual network peering. + /// Possible values include: 'FullyInSync', 'RemoteNotInSync', + /// 'LocalNotInSync', 'LocalAndRemoteNotInSync' + + /// The provisioning state of the virtual network peering resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// If we need to verify the provisioning state of the remote gateway. + /// + + /// The resourceGuid property of the Virtual Network peering resource. + /// + public VirtualNetworkPeeringPropertiesFormat(bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), AddressSpace remoteAddressSpace = default(AddressSpace), AddressSpace remoteVirtualNetworkAddressSpace = default(AddressSpace), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), VirtualNetworkEncryption remoteVirtualNetworkEncryption = default(VirtualNetworkEncryption), string peeringState = default(string), string peeringSyncLevel = default(string), string provisioningState = default(string), bool? doNotVerifyRemoteGateways = default(bool?), string resourceGuid = default(string)) + + { + this.AllowVirtualNetworkAccess = allowVirtualNetworkAccess; + this.AllowForwardedTraffic = allowForwardedTraffic; + this.AllowGatewayTransit = allowGatewayTransit; + this.UseRemoteGateways = useRemoteGateways; + this.RemoteVirtualNetwork = remoteVirtualNetwork; + this.RemoteAddressSpace = remoteAddressSpace; + this.RemoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; + this.RemoteBgpCommunities = remoteBgpCommunities; + this.RemoteVirtualNetworkEncryption = remoteVirtualNetworkEncryption; + this.PeeringState = peeringState; + this.PeeringSyncLevel = peeringSyncLevel; + this.ProvisioningState = provisioningState; + this.DoNotVerifyRemoteGateways = doNotVerifyRemoteGateways; + this.ResourceGuid = resourceGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets whether the VMs in the local virtual network space would be + /// able to access the VMs in remote virtual network space. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowVirtualNetworkAccess")] + public bool? AllowVirtualNetworkAccess {get; set; } + + /// + /// Gets or sets whether the forwarded traffic from the VMs in the local + /// virtual network will be allowed/disallowed in remote virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowForwardedTraffic")] + public bool? AllowForwardedTraffic {get; set; } + + /// + /// Gets or sets if gateway links can be used in remote virtual networking to + /// link to this virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowGatewayTransit")] + public bool? AllowGatewayTransit {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "useRemoteGateways")] + public bool? UseRemoteGateways {get; set; } + + /// + /// Gets or sets the reference to 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). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVirtualNetwork")] + public SubResource RemoteVirtualNetwork {get; set; } + + /// + /// Gets or sets the reference to the address space peered with the remote + /// virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteAddressSpace")] + public AddressSpace RemoteAddressSpace {get; set; } + + /// + /// Gets or sets the reference to the current address space of the remote + /// virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVirtualNetworkAddressSpace")] + public AddressSpace RemoteVirtualNetworkAddressSpace {get; set; } + + /// + /// Gets or sets the reference to the remote virtual network's Bgp Communities. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteBgpCommunities")] + public VirtualNetworkBgpCommunities RemoteBgpCommunities {get; set; } + + /// + /// Gets the reference to the remote virtual network's encryption + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVirtualNetworkEncryption")] + public VirtualNetworkEncryption RemoteVirtualNetworkEncryption {get; private set; } + + /// + /// Gets or sets the status of the virtual network peering. Possible values include: 'Initiated', 'Connected', 'Disconnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringState")] + public string PeeringState {get; set; } + + /// + /// Gets or sets the peering sync status of the virtual network peering. Possible values include: 'FullyInSync', 'RemoteNotInSync', 'LocalNotInSync', 'LocalAndRemoteNotInSync' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringSyncLevel")] + public string PeeringSyncLevel {get; set; } + + /// + /// Gets the provisioning state of the virtual network peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets if we need to verify the provisioning state of the remote + /// gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "doNotVerifyRemoteGateways")] + public bool? DoNotVerifyRemoteGateways {get; set; } + + /// + /// Gets the resourceGuid property of the Virtual Network peering resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.RemoteBgpCommunities != null) + { + this.RemoteBgpCommunities.Validate(); + } + if (this.RemoteVirtualNetworkEncryption != null) + { + this.RemoteVirtualNetworkEncryption.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringState.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringState.cs index e342e3cb7181..168dfef11e25 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPeeringState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkPeeringState. /// + + public static class VirtualNetworkPeeringState { public const string Initiated = "Initiated"; public const string Connected = "Connected"; public const string Disconnected = "Disconnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateEndpointNetworkPolicies.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateEndpointNetworkPolicies.cs index f163072d5afd..9470a86666a6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateEndpointNetworkPolicies.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateEndpointNetworkPolicies.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkPrivateEndpointNetworkPolicies. /// + + public static class VirtualNetworkPrivateEndpointNetworkPolicies { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateLinkServiceNetworkPolicies.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateLinkServiceNetworkPolicies.cs index 0abd6c551a88..4ad0d50b5f00 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateLinkServiceNetworkPolicies.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPrivateLinkServiceNetworkPolicies.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualNetworkPrivateLinkServiceNetworkPolicies. /// + + public static class VirtualNetworkPrivateLinkServiceNetworkPolicies { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFormat.cs new file mode 100644 index 000000000000..587dcd33fb34 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFormat.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the virtual network. + /// + public partial class VirtualNetworkPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkPropertiesFormat class. + /// + public VirtualNetworkPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkPropertiesFormat class. + /// + + /// The AddressSpace that contains an array of IP address ranges that can be + /// used by subnets. + /// + + /// The dhcpOptions that contains an array of DNS servers available to VMs + /// deployed in the virtual network. + /// + + /// The FlowTimeout value (in minutes) for the Virtual Network + /// + + /// A list of subnets in a Virtual Network. + /// + + /// A list of peerings in a Virtual Network. + /// + + /// The resourceGuid property of the Virtual Network resource. + /// + + /// The provisioning state of the virtual network resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// 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. + /// + + /// Indicates if VM protection is enabled for all the subnets in the virtual + /// network. + /// + + /// The DDoS protection plan associated with the virtual network. + /// + + /// Bgp Communities sent over ExpressRoute with each route corresponding to a + /// prefix in this VNET. + /// + + /// Indicates if encryption is enabled on virtual network and if VM without + /// encryption is allowed in encrypted VNet. + /// + + /// Array of IpAllocation which reference this VNET. + /// + + /// A collection of references to flow log resources. + /// + public VirtualNetworkPropertiesFormat(AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), int? flowTimeoutInMinutes = default(int?), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkPeerings = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDdosProtection = default(bool?), bool? enableVMProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), VirtualNetworkBgpCommunities bgpCommunities = default(VirtualNetworkBgpCommunities), VirtualNetworkEncryption encryption = default(VirtualNetworkEncryption), System.Collections.Generic.IList ipAllocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList flowLogs = default(System.Collections.Generic.IList)) + + { + this.AddressSpace = addressSpace; + this.DhcpOptions = dhcpOptions; + this.FlowTimeoutInMinutes = flowTimeoutInMinutes; + this.Subnets = subnets; + this.VirtualNetworkPeerings = virtualNetworkPeerings; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.EnableDdosProtection = enableDdosProtection; + this.EnableVMProtection = enableVMProtection; + this.DdosProtectionPlan = ddosProtectionPlan; + this.BgpCommunities = bgpCommunities; + this.Encryption = encryption; + this.IPAllocations = ipAllocations; + this.FlowLogs = flowLogs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the AddressSpace that contains an array of IP address ranges + /// that can be used by subnets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressSpace")] + public AddressSpace AddressSpace {get; set; } + + /// + /// Gets or sets the dhcpOptions that contains an array of DNS servers + /// available to VMs deployed in the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dhcpOptions")] + public DhcpOptions DhcpOptions {get; set; } + + /// + /// Gets or sets the FlowTimeout value (in minutes) for the Virtual Network + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flowTimeoutInMinutes")] + public int? FlowTimeoutInMinutes {get; set; } + + /// + /// Gets or sets a list of subnets in a Virtual Network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnets")] + public System.Collections.Generic.IList Subnets {get; set; } + + /// + /// Gets or sets a list of peerings in a Virtual Network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkPeerings")] + public System.Collections.Generic.IList VirtualNetworkPeerings {get; set; } + + /// + /// Gets the resourceGuid property of the Virtual Network resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the virtual network resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableDdosProtection")] + public bool? EnableDdosProtection {get; set; } + + /// + /// Gets or sets indicates if VM protection is enabled for all the subnets in + /// the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableVmProtection")] + public bool? EnableVMProtection {get; set; } + + /// + /// Gets or sets the DDoS protection plan associated with the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ddosProtectionPlan")] + public SubResource DdosProtectionPlan {get; set; } + + /// + /// Gets or sets bgp Communities sent over ExpressRoute with each route + /// corresponding to a prefix in this VNET. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpCommunities")] + public VirtualNetworkBgpCommunities BgpCommunities {get; set; } + + /// + /// Gets or sets indicates if encryption is enabled on virtual network and if + /// VM without encryption is allowed in encrypted VNet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public VirtualNetworkEncryption Encryption {get; set; } + + /// + /// Gets or sets array of IpAllocation which reference this VNET. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAllocations")] + public System.Collections.Generic.IList IPAllocations {get; set; } + + /// + /// Gets a collection of references to flow log resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "flowLogs")] + public System.Collections.Generic.IList FlowLogs {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.VirtualNetworkPeerings != null) + { + foreach (var element in this.VirtualNetworkPeerings) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + if (this.BgpCommunities != null) + { + this.BgpCommunities.Validate(); + } + if (this.Encryption != null) + { + this.Encryption.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTap.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTap.cs index fae7eacd4bbb..4cb285a91172 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTap.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTap.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Virtual Network Tap resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkTap : Resource { /// @@ -34,39 +24,56 @@ public VirtualNetworkTap() /// /// Initializes a new instance of the VirtualNetworkTap class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Specifies the list - /// of resource IDs for the network interface IP configuration that - /// needs to be tapped. - /// The resource GUID property of the - /// virtual network tap resource. - /// The provisioning state of the - /// virtual network tap resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The - /// reference to the private IP Address of the collector nic that will - /// receive the tap. - /// The - /// reference to the private IP address on the internal Load Balancer - /// that will receive the tap. - /// The VXLAN destination port that will - /// receive the tapped traffic. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualNetworkTap(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList networkInterfaceTapConfigurations = default(IList), string resourceGuid = default(string), string provisioningState = default(string), NetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration = default(NetworkInterfaceIPConfiguration), FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration = default(FrontendIPConfiguration), int? destinationPort = default(int?), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the virtual network tap resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Specifies the list of resource IDs for the network interface IP + /// configuration that needs to be tapped. + /// + + /// The resource GUID property of the virtual network tap resource. + /// + + /// The reference to the private IP Address of the collector nic that will + /// receive the tap. + /// + + /// The reference to the private IP address on the internal Load Balancer that + /// will receive the tap. + /// + + /// The VXLAN destination port that will receive the tapped traffic. + /// + public VirtualNetworkTap(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), System.Collections.Generic.IList networkInterfaceTapConfigurations = default(System.Collections.Generic.IList), string resourceGuid = default(string), NetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration = default(NetworkInterfaceIPConfiguration), FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration = default(FrontendIPConfiguration), int? destinationPort = default(int?)) + + : base(id, name, type, location, tags) { - NetworkInterfaceTapConfigurations = networkInterfaceTapConfigurations; - ResourceGuid = resourceGuid; - ProvisioningState = provisioningState; - DestinationNetworkInterfaceIPConfiguration = destinationNetworkInterfaceIPConfiguration; - DestinationLoadBalancerFrontEndIPConfiguration = destinationLoadBalancerFrontEndIPConfiguration; - DestinationPort = destinationPort; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.NetworkInterfaceTapConfigurations = networkInterfaceTapConfigurations; + this.ResourceGuid = resourceGuid; + this.DestinationNetworkInterfaceIPConfiguration = destinationNetworkInterfaceIPConfiguration; + this.DestinationLoadBalancerFrontEndIPConfiguration = destinationLoadBalancerFrontEndIPConfiguration; + this.DestinationPort = destinationPort; CustomInit(); } @@ -75,55 +82,52 @@ public VirtualNetworkTap() /// partial void CustomInit(); + /// - /// Gets specifies the list of resource IDs for the network interface - /// IP configuration that needs to be tapped. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.networkInterfaceTapConfigurations")] - public IList NetworkInterfaceTapConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the resource GUID property of the virtual network tap - /// resource. + /// Gets the provisioning state of the virtual network tap resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the virtual network tap resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets specifies the list of resource IDs for the network interface IP + /// configuration that needs to be tapped. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaceTapConfigurations")] + public System.Collections.Generic.IList NetworkInterfaceTapConfigurations {get; private set; } /// - /// Gets or sets the reference to the private IP Address of the - /// collector nic that will receive the tap. + /// Gets the resource GUID property of the virtual network tap resource. /// - [JsonProperty(PropertyName = "properties.destinationNetworkInterfaceIPConfiguration")] - public NetworkInterfaceIPConfiguration DestinationNetworkInterfaceIPConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid {get; private set; } /// - /// Gets or sets the reference to the private IP address on the - /// internal Load Balancer that will receive the tap. + /// Gets or sets the reference to the private IP Address of the collector nic + /// that will receive the tap. /// - [JsonProperty(PropertyName = "properties.destinationLoadBalancerFrontEndIPConfiguration")] - public FrontendIPConfiguration DestinationLoadBalancerFrontEndIPConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationNetworkInterfaceIPConfiguration")] + public NetworkInterfaceIPConfiguration DestinationNetworkInterfaceIPConfiguration {get; set; } /// - /// Gets or sets the VXLAN destination port that will receive the - /// tapped traffic. + /// Gets or sets the reference to the private IP address on the internal Load + /// Balancer that will receive the tap. /// - [JsonProperty(PropertyName = "properties.destinationPort")] - public int? DestinationPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationLoadBalancerFrontEndIPConfiguration")] + public FrontendIPConfiguration DestinationLoadBalancerFrontEndIPConfiguration {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the VXLAN destination port that will receive the tapped + /// traffic. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPort")] + public int? DestinationPort {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTapPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTapPropertiesFormat.cs new file mode 100644 index 000000000000..5b3e50c02363 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkTapPropertiesFormat.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Virtual Network Tap properties. + /// + public partial class VirtualNetworkTapPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualNetworkTapPropertiesFormat class. + /// + public VirtualNetworkTapPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkTapPropertiesFormat class. + /// + + /// Specifies the list of resource IDs for the network interface IP + /// configuration that needs to be tapped. + /// + + /// The resource GUID property of the virtual network tap resource. + /// + + /// The provisioning state of the virtual network tap resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The reference to the private IP Address of the collector nic that will + /// receive the tap. + /// + + /// The reference to the private IP address on the internal Load Balancer that + /// will receive the tap. + /// + + /// The VXLAN destination port that will receive the tapped traffic. + /// + public VirtualNetworkTapPropertiesFormat(System.Collections.Generic.IList networkInterfaceTapConfigurations = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), NetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration = default(NetworkInterfaceIPConfiguration), FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration = default(FrontendIPConfiguration), int? destinationPort = default(int?)) + + { + this.NetworkInterfaceTapConfigurations = networkInterfaceTapConfigurations; + this.ResourceGuid = resourceGuid; + this.ProvisioningState = provisioningState; + this.DestinationNetworkInterfaceIPConfiguration = destinationNetworkInterfaceIPConfiguration; + this.DestinationLoadBalancerFrontEndIPConfiguration = destinationLoadBalancerFrontEndIPConfiguration; + this.DestinationPort = destinationPort; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets specifies the list of resource IDs for the network interface IP + /// configuration that needs to be tapped. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceTapConfigurations")] + public System.Collections.Generic.IList NetworkInterfaceTapConfigurations {get; private set; } + + /// + /// Gets the resource GUID property of the virtual network tap resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGuid")] + public string ResourceGuid {get; private set; } + + /// + /// Gets the provisioning state of the virtual network tap resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the reference to the private IP Address of the collector nic + /// that will receive the tap. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationNetworkInterfaceIPConfiguration")] + public NetworkInterfaceIPConfiguration DestinationNetworkInterfaceIPConfiguration {get; set; } + + /// + /// Gets or sets the reference to the private IP address on the internal Load + /// Balancer that will receive the tap. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationLoadBalancerFrontEndIPConfiguration")] + public FrontendIPConfiguration DestinationLoadBalancerFrontEndIPConfiguration {get; set; } + + /// + /// Gets or sets the VXLAN destination port that will receive the tapped + /// traffic. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPort")] + public int? DestinationPort {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsage.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsage.cs index e88768d009e4..ba16c0f40f3a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsage.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,29 @@ public VirtualNetworkUsage() /// /// Initializes a new instance of the VirtualNetworkUsage class. /// - /// Indicates number of IPs used from the - /// Subnet. - /// Subnet identifier. - /// Indicates the size of the subnet. - /// The name containing common and localized value - /// for usage. - /// Usage units. Returns 'Count'. + + /// Indicates number of IPs used from the Subnet. + /// + + /// Subnet identifier. + /// + + /// Indicates the size of the subnet. + /// + + /// The name containing common and localized value for usage. + /// + + /// Usage units. Returns 'Count'. + /// public VirtualNetworkUsage(double? currentValue = default(double?), string id = default(string), double? limit = default(double?), VirtualNetworkUsageName name = default(VirtualNetworkUsageName), string unit = default(string)) + { - CurrentValue = currentValue; - Id = id; - Limit = limit; - Name = name; - Unit = unit; + this.CurrentValue = currentValue; + this.Id = id; + this.Limit = limit; + this.Name = name; + this.Unit = unit; CustomInit(); } @@ -51,35 +54,35 @@ public VirtualNetworkUsage() /// partial void CustomInit(); + /// /// Gets indicates number of IPs used from the Subnet. /// - [JsonProperty(PropertyName = "currentValue")] - public double? CurrentValue { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + public double? CurrentValue {get; private set; } /// /// Gets subnet identifier. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets indicates the size of the subnet. /// - [JsonProperty(PropertyName = "limit")] - public double? Limit { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public double? Limit {get; private set; } /// /// Gets the name containing common and localized value for usage. /// - [JsonProperty(PropertyName = "name")] - public VirtualNetworkUsageName Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public VirtualNetworkUsageName Name {get; private set; } /// - /// Gets usage units. Returns 'Count'. + /// Gets usage units. Returns 'Count'. /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public string Unit {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsageName.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsageName.cs index 2d62eed72cb3..c73d6925429f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsageName.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkUsageName.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public VirtualNetworkUsageName() /// /// Initializes a new instance of the VirtualNetworkUsageName class. /// - /// Localized subnet size and usage - /// string. - /// Subnet size and usage string. + + /// Localized subnet size and usage string. + /// + + /// Subnet size and usage string. + /// public VirtualNetworkUsageName(string localizedValue = default(string), string value = default(string)) + { - LocalizedValue = localizedValue; - Value = value; + this.LocalizedValue = localizedValue; + this.Value = value; CustomInit(); } @@ -44,17 +42,17 @@ public VirtualNetworkUsageName() /// partial void CustomInit(); + /// /// Gets localized subnet size and usage string. /// - [JsonProperty(PropertyName = "localizedValue")] - public string LocalizedValue { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue {get; private set; } /// /// Gets subnet size and usage string. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouter.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouter.cs index e6a1b590c68a..5857f18301e9 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouter.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouter.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VirtualRouter Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualRouter : Resource { /// @@ -34,34 +24,53 @@ public VirtualRouter() /// /// Initializes a new instance of the VirtualRouter class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// VirtualRouter ASN. - /// VirtualRouter IPs. - /// The Subnet on which VirtualRouter is - /// hosted. - /// The Gateway on which VirtualRouter is - /// hosted. - /// List of references to - /// VirtualRouterPeerings. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualRouter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), SubResource hostedSubnet = default(SubResource), SubResource hostedGateway = default(SubResource), IList peerings = default(IList), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// VirtualRouter ASN. + /// + + /// VirtualRouter IPs. + /// + + /// The Subnet on which VirtualRouter is hosted. + /// + + /// The Gateway on which VirtualRouter is hosted. + /// + + /// List of references to VirtualRouterPeerings. + /// + public VirtualRouter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), long? virtualRouterAsn = default(long?), System.Collections.Generic.IList virtualRouterIps = default(System.Collections.Generic.IList), SubResource hostedSubnet = default(SubResource), SubResource hostedGateway = default(SubResource), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - VirtualRouterAsn = virtualRouterAsn; - VirtualRouterIps = virtualRouterIps; - HostedSubnet = hostedSubnet; - HostedGateway = hostedGateway; - Peerings = peerings; - ProvisioningState = provisioningState; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.VirtualRouterAsn = virtualRouterAsn; + this.VirtualRouterIps = virtualRouterIps; + this.HostedSubnet = hostedSubnet; + this.HostedGateway = hostedGateway; + this.Peerings = peerings; CustomInit(); } @@ -70,69 +79,74 @@ public VirtualRouter() /// partial void CustomInit(); + /// - /// Gets or sets virtualRouter ASN. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.virtualRouterAsn")] - public long? VirtualRouterAsn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets virtualRouter IPs. + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.virtualRouterIps")] - public IList VirtualRouterIps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the Subnet on which VirtualRouter is hosted. + /// Gets or sets virtualRouter ASN. /// - [JsonProperty(PropertyName = "properties.hostedSubnet")] - public SubResource HostedSubnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualRouterAsn")] + public long? VirtualRouterAsn {get; set; } /// - /// Gets or sets the Gateway on which VirtualRouter is hosted. + /// Gets or sets virtualRouter IPs. /// - [JsonProperty(PropertyName = "properties.hostedGateway")] - public SubResource HostedGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualRouterIps")] + public System.Collections.Generic.IList VirtualRouterIps {get; set; } /// - /// Gets list of references to VirtualRouterPeerings. + /// Gets or sets the Subnet on which VirtualRouter is hosted. /// - [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostedSubnet")] + public SubResource HostedSubnet {get; set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the Gateway on which VirtualRouter is hosted. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostedGateway")] + public SubResource HostedGateway {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets list of references to VirtualRouterPeerings. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] + public System.Collections.Generic.IList Peerings {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualRouterAsn != null) + + + if (this.VirtualRouterAsn != null) { - if (VirtualRouterAsn > 4294967295) + if (this.VirtualRouterAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); } - if (VirtualRouterAsn < 0) + if (this.VirtualRouterAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); } } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterAutoScaleConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterAutoScaleConfiguration.cs index 5ecc75729ce0..110f55733b20 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterAutoScaleConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterAutoScaleConfiguration.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualRouterAutoScaleConfiguration { /// - /// Initializes a new instance of the - /// VirtualRouterAutoScaleConfiguration class. + /// Initializes a new instance of the VirtualRouterAutoScaleConfiguration class. /// public VirtualRouterAutoScaleConfiguration() { @@ -29,14 +21,15 @@ public VirtualRouterAutoScaleConfiguration() } /// - /// Initializes a new instance of the - /// VirtualRouterAutoScaleConfiguration class. + /// Initializes a new instance of the VirtualRouterAutoScaleConfiguration class. /// - /// The minimum number of scale units for - /// VirtualHub Router. + + /// The minimum number of scale units for VirtualHub Router. + /// public VirtualRouterAutoScaleConfiguration(int? minCapacity = default(int?)) + { - MinCapacity = minCapacity; + this.MinCapacity = minCapacity; CustomInit(); } @@ -45,28 +38,27 @@ public VirtualRouterAutoScaleConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the minimum number of scale units for VirtualHub - /// Router. + /// Gets or sets the minimum number of scale units for VirtualHub Router. /// - [JsonProperty(PropertyName = "minCapacity")] - public int? MinCapacity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "minCapacity")] + public int? MinCapacity {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MinCapacity != null) + if (this.MinCapacity != null) { - if (MinCapacity < 0) + if (this.MinCapacity < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MinCapacity", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MinCapacity", 0); } } } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeering.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeering.cs index 35a8277064c2..1c48d7756f10 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeering.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeering.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Virtual Router Peering resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualRouterPeering : SubResource { /// @@ -32,26 +24,37 @@ public VirtualRouterPeering() /// /// Initializes a new instance of the VirtualRouterPeering class. /// - /// Resource ID. - /// Peer ASN. - /// Peer IP. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// Name of the virtual router peering that is - /// unique within a virtual router. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Peering type. - public VirtualRouterPeering(string id = default(string), long? peerAsn = default(long?), string peerIp = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// Name of the virtual router peering that is unique within a virtual router. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Peering type. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Peer ASN. + /// + + /// Peer IP. + /// + public VirtualRouterPeering(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), long? peerAsn = default(long?), string peerIP = default(string)) + + : base(id) { - PeerAsn = peerAsn; - PeerIp = peerIp; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PeerAsn = peerAsn; + this.PeerIP = peerIP; CustomInit(); } @@ -60,64 +63,68 @@ public VirtualRouterPeering() /// partial void CustomInit(); + /// - /// Gets or sets peer ASN. + /// Gets or sets name of the virtual router peering that is unique within a + /// virtual router. /// - [JsonProperty(PropertyName = "properties.peerAsn")] - public long? PeerAsn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets peer IP. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.peerIp")] - public string PeerIp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state of the resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets peering type. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets name of the virtual router peering that is unique - /// within a virtual router. + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets peer ASN. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerAsn")] + public long? PeerAsn {get; set; } /// - /// Gets peering type. + /// Gets or sets peer IP. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerIp")] + public string PeerIP {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PeerAsn != null) + + + + + if (this.PeerAsn != null) { - if (PeerAsn > 4294967295) + if (this.PeerAsn > 4294967295) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); } - if (PeerAsn < 0) + if (this.PeerAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 0); } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeeringProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeeringProperties.cs new file mode 100644 index 000000000000..f1057c50aee6 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPeeringProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the rule group. + /// + public partial class VirtualRouterPeeringProperties + { + /// + /// Initializes a new instance of the VirtualRouterPeeringProperties class. + /// + public VirtualRouterPeeringProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualRouterPeeringProperties class. + /// + + /// Peer ASN. + /// + + /// Peer IP. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VirtualRouterPeeringProperties(long? peerAsn = default(long?), string peerIP = default(string), string provisioningState = default(string)) + + { + this.PeerAsn = peerAsn; + this.PeerIP = peerIP; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets peer ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerAsn")] + public long? PeerAsn {get; set; } + + /// + /// Gets or sets peer IP. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerIp")] + public string PeerIP {get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PeerAsn != null) + { + if (this.PeerAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + } + if (this.PeerAsn < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PeerAsn", 0); + } + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPropertiesFormat.cs new file mode 100644 index 000000000000..5b384b06ce93 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualRouterPropertiesFormat.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Virtual Router definition. + /// + public partial class VirtualRouterPropertiesFormat + { + /// + /// Initializes a new instance of the VirtualRouterPropertiesFormat class. + /// + public VirtualRouterPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualRouterPropertiesFormat class. + /// + + /// VirtualRouter ASN. + /// + + /// VirtualRouter IPs. + /// + + /// The Subnet on which VirtualRouter is hosted. + /// + + /// The Gateway on which VirtualRouter is hosted. + /// + + /// List of references to VirtualRouterPeerings. + /// + + /// The provisioning state of the resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VirtualRouterPropertiesFormat(long? virtualRouterAsn = default(long?), System.Collections.Generic.IList virtualRouterIps = default(System.Collections.Generic.IList), SubResource hostedSubnet = default(SubResource), SubResource hostedGateway = default(SubResource), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.VirtualRouterAsn = virtualRouterAsn; + this.VirtualRouterIps = virtualRouterIps; + this.HostedSubnet = hostedSubnet; + this.HostedGateway = hostedGateway; + this.Peerings = peerings; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets virtualRouter ASN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualRouterAsn")] + public long? VirtualRouterAsn {get; set; } + + /// + /// Gets or sets virtualRouter IPs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualRouterIps")] + public System.Collections.Generic.IList VirtualRouterIps {get; set; } + + /// + /// Gets or sets the Subnet on which VirtualRouter is hosted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostedSubnet")] + public SubResource HostedSubnet {get; set; } + + /// + /// Gets or sets the Gateway on which VirtualRouter is hosted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostedGateway")] + public SubResource HostedGateway {get; set; } + + /// + /// Gets list of references to VirtualRouterPeerings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "peerings")] + public System.Collections.Generic.IList Peerings {get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.VirtualRouterAsn != null) + { + if (this.VirtualRouterAsn > 4294967295) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); + } + if (this.VirtualRouterAsn < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + } + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWAN.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWAN.cs index b19047b061d0..485de29a18f0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWAN.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWAN.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VirtualWAN Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualWAN : Resource { /// @@ -34,41 +24,61 @@ public VirtualWAN() /// /// Initializes a new instance of the VirtualWAN class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// Vpn encryption to be disabled or - /// not. - /// List of VirtualHubs in the - /// VirtualWAN. - /// List of VpnSites in the VirtualWAN. - /// True if branch to branch - /// traffic is allowed. - /// True if Vnet to Vnet traffic - /// is allowed. - /// The office local - /// breakout category. Possible values include: 'Optimize', - /// 'OptimizeAndAllow', 'All', 'None' - /// The provisioning state of the - /// virtual WAN resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// The type of the VirtualWAN. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VirtualWAN(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? disableVpnEncryption = default(bool?), IList virtualHubs = default(IList), IList vpnSites = default(IList), bool? allowBranchToBranchTraffic = default(bool?), bool? allowVnetToVnetTraffic = default(bool?), string office365LocalBreakoutCategory = default(string), string provisioningState = default(string), string virtualWANType = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the virtual WAN resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Vpn encryption to be disabled or not. + /// + + /// List of VirtualHubs in the VirtualWAN. + /// + + /// List of VpnSites in the VirtualWAN. + /// + + /// True if branch to branch traffic is allowed. + /// + + /// True if Vnet to Vnet traffic is allowed. + /// + + /// The office local breakout category. + /// Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + + /// The type of the VirtualWAN. + /// + public VirtualWAN(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string provisioningState = default(string), bool? disableVpnEncryption = default(bool?), System.Collections.Generic.IList virtualHubs = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnSites = default(System.Collections.Generic.IList), bool? allowBranchToBranchTraffic = default(bool?), bool? allowVnetToVnetTraffic = default(bool?), string office365LocalBreakoutCategory = default(string), string propertiesType = default(string)) + + : base(id, name, type, location, tags) { - DisableVpnEncryption = disableVpnEncryption; - VirtualHubs = virtualHubs; - VpnSites = vpnSites; - AllowBranchToBranchTraffic = allowBranchToBranchTraffic; - AllowVnetToVnetTraffic = allowVnetToVnetTraffic; - Office365LocalBreakoutCategory = office365LocalBreakoutCategory; - ProvisioningState = provisioningState; - VirtualWANType = virtualWANType; - Etag = etag; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.DisableVpnEncryption = disableVpnEncryption; + this.VirtualHubs = virtualHubs; + this.VpnSites = vpnSites; + this.AllowBranchToBranchTraffic = allowBranchToBranchTraffic; + this.AllowVnetToVnetTraffic = allowVnetToVnetTraffic; + this.Office365LocalBreakoutCategory = office365LocalBreakoutCategory; + this.PropertiesType = propertiesType; CustomInit(); } @@ -77,62 +87,60 @@ public VirtualWAN() /// partial void CustomInit(); + /// - /// Gets or sets vpn encryption to be disabled or not. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.disableVpnEncryption")] - public bool? DisableVpnEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets list of VirtualHubs in the VirtualWAN. + /// Gets the provisioning state of the virtual WAN resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.virtualHubs")] - public IList VirtualHubs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets list of VpnSites in the VirtualWAN. + /// Gets or sets vpn encryption to be disabled or not. /// - [JsonProperty(PropertyName = "properties.vpnSites")] - public IList VpnSites { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableVpnEncryption")] + public bool? DisableVpnEncryption {get; set; } /// - /// Gets or sets true if branch to branch traffic is allowed. + /// Gets list of VirtualHubs in the VirtualWAN. /// - [JsonProperty(PropertyName = "properties.allowBranchToBranchTraffic")] - public bool? AllowBranchToBranchTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHubs")] + public System.Collections.Generic.IList VirtualHubs {get; private set; } /// - /// Gets or sets true if Vnet to Vnet traffic is allowed. + /// Gets list of VpnSites in the VirtualWAN. /// - [JsonProperty(PropertyName = "properties.allowVnetToVnetTraffic")] - public bool? AllowVnetToVnetTraffic { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnSites")] + public System.Collections.Generic.IList VpnSites {get; private set; } /// - /// Gets or sets the office local breakout category. Possible values - /// include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + /// Gets or sets true if branch to branch traffic is allowed. /// - [JsonProperty(PropertyName = "properties.office365LocalBreakoutCategory")] - public string Office365LocalBreakoutCategory { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowBranchToBranchTraffic")] + public bool? AllowBranchToBranchTraffic {get; set; } /// - /// Gets the provisioning state of the virtual WAN resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets true if Vnet to Vnet traffic is allowed. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowVnetToVnetTraffic")] + public bool? AllowVnetToVnetTraffic {get; set; } /// - /// Gets or sets the type of the VirtualWAN. + /// Gets the office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualWANType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.office365LocalBreakoutCategory")] + public string Office365LocalBreakoutCategory {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the type of the VirtualWAN. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string PropertiesType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanProperties.cs new file mode 100644 index 000000000000..f2277ef80f1d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VirtualWAN. + /// + public partial class VirtualWanProperties + { + /// + /// Initializes a new instance of the VirtualWanProperties class. + /// + public VirtualWanProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualWanProperties class. + /// + + /// Vpn encryption to be disabled or not. + /// + + /// List of VirtualHubs in the VirtualWAN. + /// + + /// List of VpnSites in the VirtualWAN. + /// + + /// True if branch to branch traffic is allowed. + /// + + /// True if Vnet to Vnet traffic is allowed. + /// + + /// The office local breakout category. + /// Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + + /// The provisioning state of the virtual WAN resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of the VirtualWAN. + /// + public VirtualWanProperties(bool? disableVpnEncryption = default(bool?), System.Collections.Generic.IList virtualHubs = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnSites = default(System.Collections.Generic.IList), bool? allowBranchToBranchTraffic = default(bool?), bool? allowVnetToVnetTraffic = default(bool?), string office365LocalBreakoutCategory = default(string), string provisioningState = default(string), string type = default(string)) + + { + this.DisableVpnEncryption = disableVpnEncryption; + this.VirtualHubs = virtualHubs; + this.VpnSites = vpnSites; + this.AllowBranchToBranchTraffic = allowBranchToBranchTraffic; + this.AllowVnetToVnetTraffic = allowVnetToVnetTraffic; + this.Office365LocalBreakoutCategory = office365LocalBreakoutCategory; + this.ProvisioningState = provisioningState; + this.Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets vpn encryption to be disabled or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableVpnEncryption")] + public bool? DisableVpnEncryption {get; set; } + + /// + /// Gets list of VirtualHubs in the VirtualWAN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHubs")] + public System.Collections.Generic.IList VirtualHubs {get; private set; } + + /// + /// Gets list of VpnSites in the VirtualWAN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnSites")] + public System.Collections.Generic.IList VpnSites {get; private set; } + + /// + /// Gets or sets true if branch to branch traffic is allowed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowBranchToBranchTraffic")] + public bool? AllowBranchToBranchTraffic {get; set; } + + /// + /// Gets or sets true if Vnet to Vnet traffic is allowed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowVnetToVnetTraffic")] + public bool? AllowVnetToVnetTraffic {get; set; } + + /// + /// Gets the office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "office365LocalBreakoutCategory")] + public string Office365LocalBreakoutCategory {get; private set; } + + /// + /// Gets the provisioning state of the virtual WAN resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the type of the VirtualWAN. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProvider.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProvider.cs index ac038c8da686..bbfba2732cf4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProvider.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProvider.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public VirtualWanSecurityProvider() /// /// Initializes a new instance of the VirtualWanSecurityProvider class. /// - /// Name of the security provider. - /// Url of the security provider. - /// Name of the security provider. Possible values - /// include: 'External', 'Native' + + /// Name of the security provider. + /// + + /// Url of the security provider. + /// + + /// Name of the security provider. + /// Possible values include: 'External', 'Native' public VirtualWanSecurityProvider(string name = default(string), string url = default(string), string type = default(string)) + { - Name = name; - Url = url; - Type = type; + this.Name = name; + this.Url = url; + this.Type = type; CustomInit(); } @@ -46,24 +46,23 @@ public VirtualWanSecurityProvider() /// partial void CustomInit(); + /// /// Gets or sets name of the security provider. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets url of the security provider. /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "url")] + public string Url {get; set; } /// - /// Gets or sets name of the security provider. Possible values - /// include: 'External', 'Native' + /// Gets name of the security provider. Possible values include: 'External', 'Native' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviderType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviderType.cs index 2bf8865e0353..86d55ab0c430 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviderType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviderType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VirtualWanSecurityProviderType. /// + + public static class VirtualWanSecurityProviderType { public const string External = "External"; public const string Native = "Native"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviders.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviders.cs index 4922b5824446..8dbcc17fb677 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviders.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanSecurityProviders.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualWanSecurityProviders { /// - /// Initializes a new instance of the VirtualWanSecurityProviders - /// class. + /// Initializes a new instance of the VirtualWanSecurityProviders class. /// public VirtualWanSecurityProviders() { @@ -30,14 +21,15 @@ public VirtualWanSecurityProviders() } /// - /// Initializes a new instance of the VirtualWanSecurityProviders - /// class. + /// Initializes a new instance of the VirtualWanSecurityProviders class. /// - /// List of VirtualWAN security - /// providers. - public VirtualWanSecurityProviders(IList supportedProviders = default(IList)) + + /// List of VirtualWAN security providers. + /// + public VirtualWanSecurityProviders(System.Collections.Generic.IList supportedProviders = default(System.Collections.Generic.IList)) + { - SupportedProviders = supportedProviders; + this.SupportedProviders = supportedProviders; CustomInit(); } @@ -46,11 +38,11 @@ public VirtualWanSecurityProviders() /// partial void CustomInit(); + /// /// Gets or sets list of VirtualWAN security providers. /// - [JsonProperty(PropertyName = "supportedProviders")] - public IList SupportedProviders { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedProviders")] + public System.Collections.Generic.IList SupportedProviders {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanVpnProfileParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanVpnProfileParameters.cs index 997d5f9cf93f..32ae2b946634 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanVpnProfileParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VirtualWanVpnProfileParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VirtualWanVpnProfileParameters { /// - /// Initializes a new instance of the VirtualWanVpnProfileParameters - /// class. + /// Initializes a new instance of the VirtualWanVpnProfileParameters class. /// public VirtualWanVpnProfileParameters() { @@ -28,19 +21,20 @@ public VirtualWanVpnProfileParameters() } /// - /// Initializes a new instance of the VirtualWanVpnProfileParameters - /// class. + /// Initializes a new instance of the VirtualWanVpnProfileParameters class. /// - /// VpnServerConfiguration - /// partial resource uri with which VirtualWan is associated - /// to. - /// VPN client authentication - /// method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + + /// VpnServerConfiguration partial resource uri with which VirtualWan is + /// associated to. + /// + + /// VPN client authentication method. + /// Possible values include: 'EAPTLS', 'EAPMSCHAPv2' public VirtualWanVpnProfileParameters(string vpnServerConfigurationResourceId = default(string), string authenticationMethod = default(string)) + { - VpnServerConfigurationResourceId = vpnServerConfigurationResourceId; - AuthenticationMethod = authenticationMethod; + this.VpnServerConfigurationResourceId = vpnServerConfigurationResourceId; + this.AuthenticationMethod = authenticationMethod; CustomInit(); } @@ -49,19 +43,18 @@ public VirtualWanVpnProfileParameters() /// partial void CustomInit(); + /// /// Gets or sets vpnServerConfiguration partial resource uri with which /// VirtualWan is associated to. /// - [JsonProperty(PropertyName = "vpnServerConfigurationResourceId")] - public string VpnServerConfigurationResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnServerConfigurationResourceId")] + public string VpnServerConfigurationResourceId {get; set; } /// - /// Gets or sets VPN client authentication method. Possible values - /// include: 'EAPTLS', 'EAPMSCHAPv2' + /// Gets or sets vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' /// - [JsonProperty(PropertyName = "authenticationMethod")] - public string AuthenticationMethod { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationMethod")] + public string AuthenticationMethod {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VnetLocalRouteOverrideCriteria.cs b/src/Network/Network.Management.Sdk/Generated/Models/VnetLocalRouteOverrideCriteria.cs index 3626641b686e..7ade93059a6e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VnetLocalRouteOverrideCriteria.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VnetLocalRouteOverrideCriteria.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VnetLocalRouteOverrideCriteria. /// + + public static class VnetLocalRouteOverrideCriteria { public const string Contains = "Contains"; public const string Equal = "Equal"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VnetRoute.cs b/src/Network/Network.Management.Sdk/Generated/Models/VnetRoute.cs index c9098c98f963..95befa81de08 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VnetRoute.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VnetRoute.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// List of routes that control routing from VirtualHub into a virtual - /// network connection. + /// List of routes that control routing from VirtualHub into a virtual network + /// connection. /// public partial class VnetRoute { @@ -32,16 +24,21 @@ public VnetRoute() /// /// Initializes a new instance of the VnetRoute class. /// - /// Configuration for static routes on - /// this HubVnetConnection. - /// List of all Static Routes. - /// The list of references to - /// HubBgpConnection objects. - public VnetRoute(StaticRoutesConfig staticRoutesConfig = default(StaticRoutesConfig), IList staticRoutes = default(IList), IList bgpConnections = default(IList)) + + /// Configuration for static routes on this HubVnetConnection. + /// + + /// List of all Static Routes. + /// + + /// The list of references to HubBgpConnection objects. + /// + public VnetRoute(StaticRoutesConfig staticRoutesConfig = default(StaticRoutesConfig), System.Collections.Generic.IList staticRoutes = default(System.Collections.Generic.IList), System.Collections.Generic.IList bgpConnections = default(System.Collections.Generic.IList)) + { - StaticRoutesConfig = staticRoutesConfig; - StaticRoutes = staticRoutes; - BgpConnections = bgpConnections; + this.StaticRoutesConfig = staticRoutesConfig; + this.StaticRoutes = staticRoutes; + this.BgpConnections = bgpConnections; CustomInit(); } @@ -50,24 +47,23 @@ public VnetRoute() /// partial void CustomInit(); + /// - /// Gets or sets configuration for static routes on this - /// HubVnetConnection. + /// Gets or sets configuration for static routes on this HubVnetConnection. /// - [JsonProperty(PropertyName = "staticRoutesConfig")] - public StaticRoutesConfig StaticRoutesConfig { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "staticRoutesConfig")] + public StaticRoutesConfig StaticRoutesConfig {get; set; } /// /// Gets or sets list of all Static Routes. /// - [JsonProperty(PropertyName = "staticRoutes")] - public IList StaticRoutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "staticRoutes")] + public System.Collections.Generic.IList StaticRoutes {get; set; } /// /// Gets the list of references to HubBgpConnection objects. /// - [JsonProperty(PropertyName = "bgpConnections")] - public IList BgpConnections { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpConnections")] + public System.Collections.Generic.IList BgpConnections {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfiguration.cs index 9d875465e964..a84055521fd0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfiguration.cs @@ -1,32 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// A vpn client connection configuration for client connection - /// configuration. + /// A vpn client connection configuration for client connection configuration. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VngClientConnectionConfiguration : SubResource { /// - /// Initializes a new instance of the VngClientConnectionConfiguration - /// class. + /// Initializes a new instance of the VngClientConnectionConfiguration class. /// public VngClientConnectionConfiguration() { @@ -34,31 +22,37 @@ public VngClientConnectionConfiguration() } /// - /// Initializes a new instance of the VngClientConnectionConfiguration - /// class. + /// Initializes a new instance of the VngClientConnectionConfiguration class. /// - /// The reference to the address - /// space resource which represents Address space for P2S - /// VpnClient. - /// List of references - /// to virtualNetworkGatewayPolicyGroups - /// Resource ID. - /// The provisioning state of the - /// VngClientConnectionConfiguration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VngClientConnectionConfiguration(AddressSpace vpnClientAddressPool, IList virtualNetworkGatewayPolicyGroups, string id = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the VngClientConnectionConfiguration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The reference to the address space resource which represents Address space + /// for P2S VpnClient. + /// + + /// List of references to virtualNetworkGatewayPolicyGroups + /// + public VngClientConnectionConfiguration(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), AddressSpace vpnClientAddressPool = default(AddressSpace), System.Collections.Generic.IList virtualNetworkGatewayPolicyGroups = default(System.Collections.Generic.IList)) + + : base(id) { - VpnClientAddressPool = vpnClientAddressPool; - VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.VpnClientAddressPool = vpnClientAddressPool; + this.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; CustomInit(); } @@ -67,58 +61,39 @@ public VngClientConnectionConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets the reference to the address space resource which - /// represents Address space for P2S VpnClient. - /// - [JsonProperty(PropertyName = "properties.vpnClientAddressPool")] - public AddressSpace VpnClientAddressPool { get; set; } /// - /// Gets or sets list of references to - /// virtualNetworkGatewayPolicyGroups + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.virtualNetworkGatewayPolicyGroups")] - public IList VirtualNetworkGatewayPolicyGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the VngClientConnectionConfiguration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets the provisioning state of the VngClientConnectionConfiguration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the reference to the address space resource which represents + /// Address space for P2S VpnClient. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientAddressPool")] + public AddressSpace VpnClientAddressPool {get; set; } /// - /// Validate the object. + /// Gets or sets list of references to virtualNetworkGatewayPolicyGroups /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VpnClientAddressPool == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VpnClientAddressPool"); - } - if (VirtualNetworkGatewayPolicyGroups == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGatewayPolicyGroups"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGatewayPolicyGroups")] + public System.Collections.Generic.IList VirtualNetworkGatewayPolicyGroups {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfigurationProperties.cs new file mode 100644 index 000000000000..9e4fa2c6e389 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VngClientConnectionConfigurationProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of VngClientConnectionConfiguration. + /// + public partial class VngClientConnectionConfigurationProperties + { + /// + /// Initializes a new instance of the VngClientConnectionConfigurationProperties class. + /// + public VngClientConnectionConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VngClientConnectionConfigurationProperties class. + /// + + /// The reference to the address space resource which represents Address space + /// for P2S VpnClient. + /// + + /// List of references to virtualNetworkGatewayPolicyGroups + /// + + /// The provisioning state of the VngClientConnectionConfiguration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VngClientConnectionConfigurationProperties(AddressSpace vpnClientAddressPool, System.Collections.Generic.IList virtualNetworkGatewayPolicyGroups, string provisioningState = default(string)) + + { + this.VpnClientAddressPool = vpnClientAddressPool; + this.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the reference to the address space resource which represents + /// Address space for P2S VpnClient. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientAddressPool")] + public AddressSpace VpnClientAddressPool {get; set; } + + /// + /// Gets or sets list of references to virtualNetworkGatewayPolicyGroups + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkGatewayPolicyGroups")] + public System.Collections.Generic.IList VirtualNetworkGatewayPolicyGroups {get; set; } + + /// + /// Gets the provisioning state of the VngClientConnectionConfiguration + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.VpnClientAddressPool == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VpnClientAddressPool"); + } + if (this.VirtualNetworkGatewayPolicyGroups == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGatewayPolicyGroups"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnAuthenticationType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnAuthenticationType.cs index c956b43446bc..c046c1111e75 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnAuthenticationType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnAuthenticationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnAuthenticationType. /// + + public static class VpnAuthenticationType { public const string Certificate = "Certificate"; public const string Radius = "Radius"; public const string AAD = "AAD"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConfiguration.cs index 18f66fefeb01..b3e4b8067579 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,53 +23,68 @@ public VpnClientConfiguration() /// /// Initializes a new instance of the VpnClientConfiguration class. /// - /// The reference to the address - /// space resource which represents Address space for P2S - /// VpnClient. - /// VpnClientRootCertificate - /// for virtual network gateway. - /// VpnClientRevokedCertificate for - /// Virtual network gateway. - /// VpnClientProtocols for Virtual - /// network gateway. - /// VPN authentication types for - /// the virtual network gateway.. - /// VpnClientIpsecPolicies for - /// virtual network gateway P2S client. - /// The radius server address - /// property of the VirtualNetworkGateway resource for vpn client - /// connection. - /// The radius secret property of the - /// VirtualNetworkGateway resource for vpn client connection. - /// The radiusServers property for multiple - /// radius server configuration. - /// The AADTenant property of the - /// VirtualNetworkGateway resource for vpn client connection used for - /// AAD authentication. - /// The AADAudience property of the - /// VirtualNetworkGateway resource for vpn client connection used for - /// AAD authentication. - /// The AADIssuer property of the - /// VirtualNetworkGateway resource for vpn client connection used for - /// AAD authentication. - /// per ip address pool - /// connection policy for virtual network gateway P2S client. - public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList vpnClientProtocols = default(IList), IList vpnAuthenticationTypes = default(IList), IList vpnClientIpsecPolicies = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), IList radiusServers = default(IList), string aadTenant = default(string), string aadAudience = default(string), string aadIssuer = default(string), IList vngClientConnectionConfigurations = default(IList)) + + /// The reference to the address space resource which represents Address space + /// for P2S VpnClient. + /// + + /// VpnClientRootCertificate for virtual network gateway. + /// + + /// VpnClientRevokedCertificate for Virtual network gateway. + /// + + /// VpnClientProtocols for Virtual network gateway. + /// + + /// VPN authentication types for the virtual network gateway.. + /// + + /// VpnClientIpsecPolicies for virtual network gateway P2S client. + /// + + /// The radius server address property of the VirtualNetworkGateway resource + /// for vpn client connection. + /// + + /// The radius secret property of the VirtualNetworkGateway resource for vpn + /// client connection. + /// + + /// The radiusServers property for multiple radius server configuration. + /// + + /// The AADTenant property of the VirtualNetworkGateway resource for vpn client + /// connection used for AAD authentication. + /// + + /// The AADAudience property of the VirtualNetworkGateway resource for vpn + /// client connection used for AAD authentication. + /// + + /// The AADIssuer property of the VirtualNetworkGateway resource for vpn client + /// connection used for AAD authentication. + /// + + /// per ip address pool connection policy for virtual network gateway P2S + /// client. + /// + public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), System.Collections.Generic.IList vpnClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRevokedCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientProtocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnAuthenticationTypes = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientIpsecPolicies = default(System.Collections.Generic.IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), System.Collections.Generic.IList radiusServers = default(System.Collections.Generic.IList), string aadTenant = default(string), string aadAudience = default(string), string aadIssuer = default(string), System.Collections.Generic.IList vngClientConnectionConfigurations = default(System.Collections.Generic.IList)) + { - VpnClientAddressPool = vpnClientAddressPool; - VpnClientRootCertificates = vpnClientRootCertificates; - VpnClientRevokedCertificates = vpnClientRevokedCertificates; - VpnClientProtocols = vpnClientProtocols; - VpnAuthenticationTypes = vpnAuthenticationTypes; - VpnClientIpsecPolicies = vpnClientIpsecPolicies; - RadiusServerAddress = radiusServerAddress; - RadiusServerSecret = radiusServerSecret; - RadiusServers = radiusServers; - AadTenant = aadTenant; - AadAudience = aadAudience; - AadIssuer = aadIssuer; - VngClientConnectionConfigurations = vngClientConnectionConfigurations; + this.VpnClientAddressPool = vpnClientAddressPool; + this.VpnClientRootCertificates = vpnClientRootCertificates; + this.VpnClientRevokedCertificates = vpnClientRevokedCertificates; + this.VpnClientProtocols = vpnClientProtocols; + this.VpnAuthenticationTypes = vpnAuthenticationTypes; + this.VpnClientIpsecPolicies = vpnClientIpsecPolicies; + this.RadiusServerAddress = radiusServerAddress; + this.RadiusServerSecret = radiusServerSecret; + this.RadiusServers = radiusServers; + this.AadTenant = aadTenant; + this.AadAudience = aadAudience; + this.AadIssuer = aadIssuer; + this.VngClientConnectionConfigurations = vngClientConnectionConfigurations; CustomInit(); } @@ -86,94 +93,91 @@ public VpnClientConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the reference to the address space resource which - /// represents Address space for P2S VpnClient. + /// Gets or sets the reference to the address space resource which represents + /// Address space for P2S VpnClient. /// - [JsonProperty(PropertyName = "vpnClientAddressPool")] - public AddressSpace VpnClientAddressPool { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientAddressPool")] + public AddressSpace VpnClientAddressPool {get; set; } /// /// Gets or sets vpnClientRootCertificate for virtual network gateway. /// - [JsonProperty(PropertyName = "vpnClientRootCertificates")] - public IList VpnClientRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRootCertificates")] + public System.Collections.Generic.IList VpnClientRootCertificates {get; set; } /// - /// Gets or sets vpnClientRevokedCertificate for Virtual network - /// gateway. + /// Gets or sets vpnClientRevokedCertificate for Virtual network gateway. /// - [JsonProperty(PropertyName = "vpnClientRevokedCertificates")] - public IList VpnClientRevokedCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRevokedCertificates")] + public System.Collections.Generic.IList VpnClientRevokedCertificates {get; set; } /// /// Gets or sets vpnClientProtocols for Virtual network gateway. /// - [JsonProperty(PropertyName = "vpnClientProtocols")] - public IList VpnClientProtocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientProtocols")] + public System.Collections.Generic.IList VpnClientProtocols {get; set; } /// - /// Gets or sets VPN authentication types for the virtual network - /// gateway.. + /// Gets or sets vPN authentication types for the virtual network gateway.. /// - [JsonProperty(PropertyName = "vpnAuthenticationTypes")] - public IList VpnAuthenticationTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnAuthenticationTypes")] + public System.Collections.Generic.IList VpnAuthenticationTypes {get; set; } /// - /// Gets or sets vpnClientIpsecPolicies for virtual network gateway P2S - /// client. + /// Gets or sets vpnClientIpsecPolicies for virtual network gateway P2S client. /// - [JsonProperty(PropertyName = "vpnClientIpsecPolicies")] - public IList VpnClientIpsecPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientIpsecPolicies")] + public System.Collections.Generic.IList VpnClientIpsecPolicies {get; set; } /// /// Gets or sets the radius server address property of the /// VirtualNetworkGateway resource for vpn client connection. /// - [JsonProperty(PropertyName = "radiusServerAddress")] - public string RadiusServerAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerAddress")] + public string RadiusServerAddress {get; set; } /// - /// Gets or sets the radius secret property of the - /// VirtualNetworkGateway resource for vpn client connection. + /// Gets or sets the radius secret property of the VirtualNetworkGateway + /// resource for vpn client connection. /// - [JsonProperty(PropertyName = "radiusServerSecret")] - public string RadiusServerSecret { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerSecret")] + public string RadiusServerSecret {get; set; } /// /// Gets or sets the radiusServers property for multiple radius server /// configuration. /// - [JsonProperty(PropertyName = "radiusServers")] - public IList RadiusServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServers")] + public System.Collections.Generic.IList RadiusServers {get; set; } /// - /// Gets or sets the AADTenant property of the VirtualNetworkGateway - /// resource for vpn client connection used for AAD authentication. + /// Gets or sets the AADTenant property of the VirtualNetworkGateway resource + /// for vpn client connection used for AAD authentication. /// - [JsonProperty(PropertyName = "aadTenant")] - public string AadTenant { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aadTenant")] + public string AadTenant {get; set; } /// - /// Gets or sets the AADAudience property of the VirtualNetworkGateway - /// resource for vpn client connection used for AAD authentication. + /// Gets or sets the AADAudience property of the VirtualNetworkGateway resource + /// for vpn client connection used for AAD authentication. /// - [JsonProperty(PropertyName = "aadAudience")] - public string AadAudience { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aadAudience")] + public string AadAudience {get; set; } /// - /// Gets or sets the AADIssuer property of the VirtualNetworkGateway - /// resource for vpn client connection used for AAD authentication. + /// Gets or sets the AADIssuer property of the VirtualNetworkGateway resource + /// for vpn client connection used for AAD authentication. /// - [JsonProperty(PropertyName = "aadIssuer")] - public string AadIssuer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aadIssuer")] + public string AadIssuer {get; set; } /// - /// Gets or sets per ip address pool connection policy for virtual - /// network gateway P2S client. + /// Gets or sets per ip address pool connection policy for virtual network + /// gateway P2S client. /// - [JsonProperty(PropertyName = "vngClientConnectionConfigurations")] - public IList VngClientConnectionConfigurations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vngClientConnectionConfigurations")] + public System.Collections.Generic.IList VngClientConnectionConfigurations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealth.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealth.cs index 165c4a67ea0c..2a269105dda8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealth.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealth.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,20 +23,25 @@ public VpnClientConnectionHealth() /// /// Initializes a new instance of the VpnClientConnectionHealth class. /// - /// Total of the Ingress - /// Bytes Transferred in this P2S Vpn connection. - /// Total of the Egress Bytes - /// Transferred in this connection. - /// The total of p2s vpn - /// clients connected at this time to this P2SVpnGateway. - /// List of allocated ip addresses - /// to the connected p2s vpn clients. - public VpnClientConnectionHealth(long? totalIngressBytesTransferred = default(long?), long? totalEgressBytesTransferred = default(long?), int? vpnClientConnectionsCount = default(int?), IList allocatedIpAddresses = default(IList)) + + /// Total of the Ingress Bytes Transferred in this P2S Vpn connection. + /// + + /// Total of the Egress Bytes Transferred in this connection. + /// + + /// The total of p2s vpn clients connected at this time to this P2SVpnGateway. + /// + + /// List of allocated ip addresses to the connected p2s vpn clients. + /// + public VpnClientConnectionHealth(long? totalIngressBytesTransferred = default(long?), long? totalEgressBytesTransferred = default(long?), int? vpnClientConnectionsCount = default(int?), System.Collections.Generic.IList allocatedIPAddresses = default(System.Collections.Generic.IList)) + { - TotalIngressBytesTransferred = totalIngressBytesTransferred; - TotalEgressBytesTransferred = totalEgressBytesTransferred; - VpnClientConnectionsCount = vpnClientConnectionsCount; - AllocatedIpAddresses = allocatedIpAddresses; + this.TotalIngressBytesTransferred = totalIngressBytesTransferred; + this.TotalEgressBytesTransferred = totalEgressBytesTransferred; + this.VpnClientConnectionsCount = vpnClientConnectionsCount; + this.AllocatedIPAddresses = allocatedIPAddresses; CustomInit(); } @@ -53,32 +50,31 @@ public VpnClientConnectionHealth() /// partial void CustomInit(); + /// - /// Gets total of the Ingress Bytes Transferred in this P2S Vpn - /// connection. + /// Gets total of the Ingress Bytes Transferred in this P2S Vpn connection. /// - [JsonProperty(PropertyName = "totalIngressBytesTransferred")] - public long? TotalIngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "totalIngressBytesTransferred")] + public long? TotalIngressBytesTransferred {get; private set; } /// /// Gets total of the Egress Bytes Transferred in this connection. /// - [JsonProperty(PropertyName = "totalEgressBytesTransferred")] - public long? TotalEgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "totalEgressBytesTransferred")] + public long? TotalEgressBytesTransferred {get; private set; } /// - /// Gets or sets the total of p2s vpn clients connected at this time to - /// this P2SVpnGateway. + /// Gets or sets the total of p2s vpn clients connected at this time to this + /// P2SVpnGateway. /// - [JsonProperty(PropertyName = "vpnClientConnectionsCount")] - public int? VpnClientConnectionsCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientConnectionsCount")] + public int? VpnClientConnectionsCount {get; set; } /// - /// Gets or sets list of allocated ip addresses to the connected p2s - /// vpn clients. + /// Gets or sets list of allocated ip addresses to the connected p2s vpn + /// clients. /// - [JsonProperty(PropertyName = "allocatedIpAddresses")] - public IList AllocatedIpAddresses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allocatedIpAddresses")] + public System.Collections.Generic.IList AllocatedIPAddresses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetail.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetail.cs index 2c17f0df60d4..709c40d5463f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetail.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetail.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnClientConnectionHealthDetail { /// - /// Initializes a new instance of the VpnClientConnectionHealthDetail - /// class. + /// Initializes a new instance of the VpnClientConnectionHealthDetail class. /// public VpnClientConnectionHealthDetail() { @@ -28,45 +21,59 @@ public VpnClientConnectionHealthDetail() } /// - /// Initializes a new instance of the VpnClientConnectionHealthDetail - /// class. + /// Initializes a new instance of the VpnClientConnectionHealthDetail class. /// - /// The vpn client Id. - /// The duration time of a - /// connected vpn client. - /// The start time of a connected vpn - /// client. - /// The public Ip of a connected vpn - /// client. - /// The assigned private Ip of a - /// connected vpn client. - /// The user name of a connected vpn - /// client. - /// The max band width. - /// The egress packets per - /// second. - /// The egress bytes per - /// second. - /// The ingress packets per - /// second. - /// The ingress bytes per - /// second. - /// The max packets transferred per - /// second. - public VpnClientConnectionHealthDetail(string vpnConnectionId = default(string), long? vpnConnectionDuration = default(long?), string vpnConnectionTime = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string vpnUserName = default(string), long? maxBandwidth = default(long?), long? egressPacketsTransferred = default(long?), long? egressBytesTransferred = default(long?), long? ingressPacketsTransferred = default(long?), long? ingressBytesTransferred = default(long?), long? maxPacketsPerSecond = default(long?)) + + /// The vpn client Id. + /// + + /// The duration time of a connected vpn client. + /// + + /// The start time of a connected vpn client. + /// + + /// The public Ip of a connected vpn client. + /// + + /// The assigned private Ip of a connected vpn client. + /// + + /// The user name of a connected vpn client. + /// + + /// The max band width. + /// + + /// The egress packets per second. + /// + + /// The egress bytes per second. + /// + + /// The ingress packets per second. + /// + + /// The ingress bytes per second. + /// + + /// The max packets transferred per second. + /// + public VpnClientConnectionHealthDetail(string vpnConnectionId = default(string), long? vpnConnectionDuration = default(long?), string vpnConnectionTime = default(string), string publicIPAddress = default(string), string privateIPAddress = default(string), string vpnUserName = default(string), long? maxBandwidth = default(long?), long? egressPacketsTransferred = default(long?), long? egressBytesTransferred = default(long?), long? ingressPacketsTransferred = default(long?), long? ingressBytesTransferred = default(long?), long? maxPacketsPerSecond = default(long?)) + { - VpnConnectionId = vpnConnectionId; - VpnConnectionDuration = vpnConnectionDuration; - VpnConnectionTime = vpnConnectionTime; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; - VpnUserName = vpnUserName; - MaxBandwidth = maxBandwidth; - EgressPacketsTransferred = egressPacketsTransferred; - EgressBytesTransferred = egressBytesTransferred; - IngressPacketsTransferred = ingressPacketsTransferred; - IngressBytesTransferred = ingressBytesTransferred; - MaxPacketsPerSecond = maxPacketsPerSecond; + this.VpnConnectionId = vpnConnectionId; + this.VpnConnectionDuration = vpnConnectionDuration; + this.VpnConnectionTime = vpnConnectionTime; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; + this.VpnUserName = vpnUserName; + this.MaxBandwidth = maxBandwidth; + this.EgressPacketsTransferred = egressPacketsTransferred; + this.EgressBytesTransferred = egressBytesTransferred; + this.IngressPacketsTransferred = ingressPacketsTransferred; + this.IngressBytesTransferred = ingressBytesTransferred; + this.MaxPacketsPerSecond = maxPacketsPerSecond; CustomInit(); } @@ -75,77 +82,77 @@ public VpnClientConnectionHealthDetail() /// partial void CustomInit(); + /// /// Gets the vpn client Id. /// - [JsonProperty(PropertyName = "vpnConnectionId")] - public string VpnConnectionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnConnectionId")] + public string VpnConnectionId {get; private set; } /// /// Gets the duration time of a connected vpn client. /// - [JsonProperty(PropertyName = "vpnConnectionDuration")] - public long? VpnConnectionDuration { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnConnectionDuration")] + public long? VpnConnectionDuration {get; private set; } /// /// Gets the start time of a connected vpn client. /// - [JsonProperty(PropertyName = "vpnConnectionTime")] - public string VpnConnectionTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnConnectionTime")] + public string VpnConnectionTime {get; private set; } /// /// Gets the public Ip of a connected vpn client. /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIPAddress {get; private set; } /// /// Gets the assigned private Ip of a connected vpn client. /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIPAddress {get; private set; } /// /// Gets the user name of a connected vpn client. /// - [JsonProperty(PropertyName = "vpnUserName")] - public string VpnUserName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnUserName")] + public string VpnUserName {get; private set; } /// /// Gets the max band width. /// - [JsonProperty(PropertyName = "maxBandwidth")] - public long? MaxBandwidth { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxBandwidth")] + public long? MaxBandwidth {get; private set; } /// /// Gets the egress packets per second. /// - [JsonProperty(PropertyName = "egressPacketsTransferred")] - public long? EgressPacketsTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "egressPacketsTransferred")] + public long? EgressPacketsTransferred {get; private set; } /// /// Gets the egress bytes per second. /// - [JsonProperty(PropertyName = "egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } /// /// Gets the ingress packets per second. /// - [JsonProperty(PropertyName = "ingressPacketsTransferred")] - public long? IngressPacketsTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressPacketsTransferred")] + public long? IngressPacketsTransferred {get; private set; } /// /// Gets the ingress bytes per second. /// - [JsonProperty(PropertyName = "ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } /// /// Gets the max packets transferred per second. /// - [JsonProperty(PropertyName = "maxPacketsPerSecond")] - public long? MaxPacketsPerSecond { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maxPacketsPerSecond")] + public long? MaxPacketsPerSecond {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetailListResult.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetailListResult.cs index e6a687949d72..84f08eda3297 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetailListResult.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientConnectionHealthDetailListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnClientConnectionHealthDetailListResult { /// - /// Initializes a new instance of the - /// VpnClientConnectionHealthDetailListResult class. + /// Initializes a new instance of the VpnClientConnectionHealthDetailListResult class. /// public VpnClientConnectionHealthDetailListResult() { @@ -30,13 +21,15 @@ public VpnClientConnectionHealthDetailListResult() } /// - /// Initializes a new instance of the - /// VpnClientConnectionHealthDetailListResult class. + /// Initializes a new instance of the VpnClientConnectionHealthDetailListResult class. /// - /// List of vpn client connection health. - public VpnClientConnectionHealthDetailListResult(IList value = default(IList)) + + /// List of vpn client connection health. + /// + public VpnClientConnectionHealthDetailListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -45,11 +38,11 @@ public VpnClientConnectionHealthDetailListResult() /// partial void CustomInit(); + /// /// Gets or sets list of vpn client connection health. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientIPsecParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientIPsecParameters.cs index afd483a44d75..9c8f03391944 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientIPsecParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientIPsecParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,40 +23,49 @@ public VpnClientIPsecParameters() /// /// Initializes a new instance of the VpnClientIPsecParameters class. /// - /// The IPSec Security Association - /// (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S - /// client. - /// The IPSec Security Association - /// (also called Quick Mode or Phase 2 SA) payload size in KB for P2S - /// client.. - /// The IPSec encryption algorithm (IKE - /// phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', - /// 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - /// The IPSec integrity algorithm (IKE - /// phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - /// 'GCMAES128', 'GCMAES192', 'GCMAES256' - /// The IKE encryption algorithm (IKE phase - /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256', 'GCMAES256', 'GCMAES128' - /// The IKE integrity algorithm (IKE phase - /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', - /// 'GCMAES256', 'GCMAES128' - /// The DH Group used in IKE Phase 1 for initial - /// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - /// The Pfs Group used in IKE Phase 2 for new - /// child SA. Possible values include: 'None', 'PFS1', 'PFS2', - /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + + /// The IPSec Security Association (also called Quick Mode or Phase 2 SA) + /// lifetime in seconds for P2S client. + /// + + /// The IPSec Security Association (also called Quick Mode or Phase 2 SA) + /// payload size in KB for P2S client.. + /// + + /// The IPSec encryption algorithm (IKE phase 1). + /// Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + /// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + + /// The IPSec integrity algorithm (IKE phase 1). + /// Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', + /// 'GCMAES256' + + /// The IKE encryption algorithm (IKE phase 2). + /// Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + /// 'GCMAES256', 'GCMAES128' + + /// The IKE integrity algorithm (IKE phase 2). + /// Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + /// 'GCMAES128' + + /// The DH Group used in IKE Phase 1 for initial SA. + /// Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + /// 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + + /// The Pfs Group used in IKE Phase 2 for new child SA. + /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', + /// 'ECP384', 'PFS24', 'PFS14', 'PFSMM' public VpnClientIPsecParameters(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup) + { - SaLifeTimeSeconds = saLifeTimeSeconds; - SaDataSizeKilobytes = saDataSizeKilobytes; - IpsecEncryption = ipsecEncryption; - IpsecIntegrity = ipsecIntegrity; - IkeEncryption = ikeEncryption; - IkeIntegrity = ikeIntegrity; - DhGroup = dhGroup; - PfsGroup = pfsGroup; + this.SaLifeTimeSeconds = saLifeTimeSeconds; + this.SaDataSizeKilobytes = saDataSizeKilobytes; + this.IpsecEncryption = ipsecEncryption; + this.IpsecIntegrity = ipsecIntegrity; + this.IkeEncryption = ikeEncryption; + this.IkeIntegrity = ikeIntegrity; + this.DhGroup = dhGroup; + this.PfsGroup = pfsGroup; CustomInit(); } @@ -72,100 +74,94 @@ public VpnClientIPsecParameters(int saLifeTimeSeconds, int saDataSizeKilobytes, /// partial void CustomInit(); + /// - /// Gets or sets the IPSec Security Association (also called Quick Mode - /// or Phase 2 SA) lifetime in seconds for P2S client. + /// Gets or sets the IPSec Security Association (also called Quick Mode or + /// Phase 2 SA) lifetime in seconds for P2S client. /// - [JsonProperty(PropertyName = "saLifeTimeSeconds")] - public int SaLifeTimeSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "saLifeTimeSeconds")] + public int SaLifeTimeSeconds {get; set; } /// - /// Gets or sets the IPSec Security Association (also called Quick Mode - /// or Phase 2 SA) payload size in KB for P2S client.. + /// Gets or sets the IPSec Security Association (also called Quick Mode or + /// Phase 2 SA) payload size in KB for P2S client.. /// - [JsonProperty(PropertyName = "saDataSizeKilobytes")] - public int SaDataSizeKilobytes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "saDataSizeKilobytes")] + public int SaDataSizeKilobytes {get; set; } /// - /// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible - /// values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' /// - [JsonProperty(PropertyName = "ipsecEncryption")] - public string IpsecEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecEncryption")] + public string IpsecEncryption {get; set; } /// - /// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible - /// values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', - /// 'GCMAES256' + /// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' /// - [JsonProperty(PropertyName = "ipsecIntegrity")] - public string IpsecIntegrity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecIntegrity")] + public string IpsecIntegrity {get; set; } /// - /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible - /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', - /// 'GCMAES256', 'GCMAES128' + /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' /// - [JsonProperty(PropertyName = "ikeEncryption")] - public string IkeEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ikeEncryption")] + public string IkeEncryption {get; set; } /// - /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible - /// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', - /// 'GCMAES128' + /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128' /// - [JsonProperty(PropertyName = "ikeIntegrity")] - public string IkeIntegrity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ikeIntegrity")] + public string IkeIntegrity {get; set; } /// - /// Gets or sets the DH Group used in IKE Phase 1 for initial SA. - /// Possible values include: 'None', 'DHGroup1', 'DHGroup2', - /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + /// Gets or sets the DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' /// - [JsonProperty(PropertyName = "dhGroup")] - public string DhGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dhGroup")] + public string DhGroup {get; set; } /// - /// Gets or sets the Pfs Group used in IKE Phase 2 for new child SA. - /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', - /// 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + /// Gets or sets the Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' /// - [JsonProperty(PropertyName = "pfsGroup")] - public string PfsGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "pfsGroup")] + public string PfsGroup {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (IpsecEncryption == null) + if (this.IpsecEncryption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpsecEncryption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpsecEncryption"); } - if (IpsecIntegrity == null) + if (this.IpsecIntegrity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpsecIntegrity"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpsecIntegrity"); } - if (IkeEncryption == null) + if (this.IkeEncryption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IkeEncryption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IkeEncryption"); } - if (IkeIntegrity == null) + if (this.IkeIntegrity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IkeIntegrity"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IkeIntegrity"); } - if (DhGroup == null) + if (this.DhGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DhGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DhGroup"); } - if (PfsGroup == null) + if (this.PfsGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PfsGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PfsGroup"); } + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientParameters.cs index a0c37cc6978d..5b1fa06004bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientParameters.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,24 +23,29 @@ public VpnClientParameters() /// /// Initializes a new instance of the VpnClientParameters class. /// - /// VPN client Processor - /// Architecture. Possible values include: 'Amd64', 'X86' - /// VPN client authentication - /// method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - /// 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. - /// A list of client root - /// certificates public certificate data encoded as Base-64 strings. - /// Optional parameter for external radius based authentication with - /// EAPTLS. - public VpnClientParameters(string processorArchitecture = default(string), string authenticationMethod = default(string), string radiusServerAuthCertificate = default(string), IList clientRootCertificates = default(IList)) + + /// VPN client Processor Architecture. + /// Possible values include: 'Amd64', 'X86' + + /// VPN client authentication method. + /// Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + + /// 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. + /// + + /// A list of client root certificates public certificate data encoded as + /// Base-64 strings. Optional parameter for external radius based + /// authentication with EAPTLS. + /// + public VpnClientParameters(string processorArchitecture = default(string), string authenticationMethod = default(string), string radiusServerAuthCertificate = default(string), System.Collections.Generic.IList clientRootCertificates = default(System.Collections.Generic.IList)) + { - ProcessorArchitecture = processorArchitecture; - AuthenticationMethod = authenticationMethod; - RadiusServerAuthCertificate = radiusServerAuthCertificate; - ClientRootCertificates = clientRootCertificates; + this.ProcessorArchitecture = processorArchitecture; + this.AuthenticationMethod = authenticationMethod; + this.RadiusServerAuthCertificate = radiusServerAuthCertificate; + this.ClientRootCertificates = clientRootCertificates; CustomInit(); } @@ -57,36 +54,34 @@ public VpnClientParameters() /// partial void CustomInit(); + /// - /// Gets or sets VPN client Processor Architecture. Possible values - /// include: 'Amd64', 'X86' + /// Gets or sets vPN client Processor Architecture. Possible values include: 'Amd64', 'X86' /// - [JsonProperty(PropertyName = "processorArchitecture")] - public string ProcessorArchitecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "processorArchitecture")] + public string ProcessorArchitecture {get; set; } /// - /// Gets or sets VPN client authentication method. Possible values - /// include: 'EAPTLS', 'EAPMSCHAPv2' + /// Gets or sets vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' /// - [JsonProperty(PropertyName = "authenticationMethod")] - public string AuthenticationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationMethod")] + public string AuthenticationMethod {get; set; } /// /// Gets or sets 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. + /// authentication certificate as a Base-64 encoded string. Required only if + /// external radius authentication has been configured with EAPTLS + /// authentication. /// - [JsonProperty(PropertyName = "radiusServerAuthCertificate")] - public string RadiusServerAuthCertificate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerAuthCertificate")] + public string RadiusServerAuthCertificate {get; set; } /// - /// Gets or sets a list of client root certificates public certificate - /// data encoded as Base-64 strings. Optional parameter for external - /// radius based authentication with EAPTLS. + /// Gets or sets a list of client root certificates public certificate data + /// encoded as Base-64 strings. Optional parameter for external radius based + /// authentication with EAPTLS. /// - [JsonProperty(PropertyName = "clientRootCertificates")] - public IList ClientRootCertificates { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientRootCertificates")] + public System.Collections.Generic.IList ClientRootCertificates {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientProtocol.cs index 1396cc92cc4a..61c8a50d8b17 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnClientProtocol. /// + + public static class VpnClientProtocol { public const string IkeV2 = "IkeV2"; - public const string SSTP = "SSTP"; + public const string Sstp = "SSTP"; public const string OpenVPN = "OpenVPN"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificate.cs index 164801fbae20..51618957fa7a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// VPN client revoked certificate of virtual network gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnClientRevokedCertificate : SubResource { /// - /// Initializes a new instance of the VpnClientRevokedCertificate - /// class. + /// Initializes a new instance of the VpnClientRevokedCertificate class. /// public VpnClientRevokedCertificate() { @@ -31,27 +22,32 @@ public VpnClientRevokedCertificate() } /// - /// Initializes a new instance of the VpnClientRevokedCertificate - /// class. + /// Initializes a new instance of the VpnClientRevokedCertificate class. /// - /// Resource ID. - /// The revoked VPN client certificate - /// thumbprint. - /// The provisioning state of the VPN - /// client revoked certificate resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VpnClientRevokedCertificate(string id = default(string), string thumbprint = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the VPN client revoked certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The revoked VPN client certificate thumbprint. + /// + public VpnClientRevokedCertificate(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), string thumbprint = default(string)) + + : base(id) { - Thumbprint = thumbprint; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.Thumbprint = thumbprint; CustomInit(); } @@ -60,33 +56,31 @@ public VpnClientRevokedCertificate() /// partial void CustomInit(); + /// - /// Gets or sets the revoked VPN client certificate thumbprint. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.thumbprint")] - public string Thumbprint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the VPN client revoked certificate - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets the provisioning state of the VPN client revoked certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the revoked VPN client certificate thumbprint. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.thumbprint")] + public string Thumbprint {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificatePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificatePropertiesFormat.cs new file mode 100644 index 000000000000..840f5323b98b --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRevokedCertificatePropertiesFormat.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of the revoked VPN client certificate of virtual network + /// gateway. + /// + public partial class VpnClientRevokedCertificatePropertiesFormat + { + /// + /// Initializes a new instance of the VpnClientRevokedCertificatePropertiesFormat class. + /// + public VpnClientRevokedCertificatePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnClientRevokedCertificatePropertiesFormat class. + /// + + /// The revoked VPN client certificate thumbprint. + /// + + /// The provisioning state of the VPN client revoked certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VpnClientRevokedCertificatePropertiesFormat(string thumbprint = default(string), string provisioningState = default(string)) + + { + this.Thumbprint = thumbprint; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the revoked VPN client certificate thumbprint. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint {get; set; } + + /// + /// Gets the provisioning state of the VPN client revoked certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificate.cs index bd91a86fb1a5..e5749b3a7599 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificate.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// VPN client root certificate of virtual network gateway. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnClientRootCertificate : SubResource { /// @@ -32,23 +24,30 @@ public VpnClientRootCertificate() /// /// Initializes a new instance of the VpnClientRootCertificate class. /// - /// The certificate public data. - /// Resource ID. - /// The provisioning state of the VPN - /// client root certificate resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VpnClientRootCertificate(string publicCertData, string id = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the VPN client root certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The certificate public data. + /// + public VpnClientRootCertificate(string publicCertData, string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string)) + + : base(id) { - PublicCertData = publicCertData; - ProvisioningState = provisioningState; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.PublicCertData = publicCertData; CustomInit(); } @@ -57,46 +56,48 @@ public VpnClientRootCertificate() /// partial void CustomInit(); + /// - /// Gets or sets the certificate public data. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.publicCertData")] - public string PublicCertData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets the provisioning state of the VPN client root certificate - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets the provisioning state of the VPN client root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the certificate public data. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicCertData")] + public string PublicCertData {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PublicCertData == null) + if (this.PublicCertData == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicCertData"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicCertData"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificatePropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificatePropertiesFormat.cs new file mode 100644 index 000000000000..8d2590c3a958 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnClientRootCertificatePropertiesFormat.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Properties of SSL certificates of application gateway. + /// + public partial class VpnClientRootCertificatePropertiesFormat + { + /// + /// Initializes a new instance of the VpnClientRootCertificatePropertiesFormat class. + /// + public VpnClientRootCertificatePropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnClientRootCertificatePropertiesFormat class. + /// + + /// The certificate public data. + /// + + /// The provisioning state of the VPN client root certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VpnClientRootCertificatePropertiesFormat(string publicCertData, string provisioningState = default(string)) + + { + this.PublicCertData = publicCertData; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the certificate public data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicCertData")] + public string PublicCertData {get; set; } + + /// + /// Gets the provisioning state of the VPN client root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PublicCertData == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicCertData"); + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnection.cs index 77a44f936d70..5966b396f511 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnection.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnConnection Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnConnection : SubResource { /// @@ -34,74 +24,100 @@ public VpnConnection() /// /// Initializes a new instance of the VpnConnection class. /// - /// Resource ID. - /// Id of the connected vpn site. - /// Routing weight for vpn - /// connection. - /// DPD timeout in seconds for vpn - /// connection. - /// The connection status. Possible - /// values include: 'Unknown', 'Connecting', 'Connected', - /// 'NotConnected' - /// Connection protocol used - /// for this connection. Possible values include: 'IKEv2', - /// 'IKEv1' - /// Ingress bytes - /// transferred. - /// Egress bytes - /// transferred. - /// Expected bandwidth in - /// MBPS. - /// SharedKey for the vpn connection. - /// EnableBgp flag. - /// Enable policy-based - /// traffic selectors. - /// The IPSec Policies to be considered by - /// this connection. - /// The Traffic Selector Policies - /// to be considered by this connection. - /// EnableBgp flag. - /// Enable internet - /// security. - /// Use local azure ip to initiate - /// connection. - /// The provisioning state of the VPN - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// List of all vpn site link - /// connections to the gateway. - /// The Routing Configuration - /// indicating the associated and propagated route tables on this - /// connection. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VpnConnection(string id = default(string), SubResource remoteVpnSite = default(SubResource), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionStatus = default(string), string vpnConnectionProtocolType = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), int? connectionBandwidth = default(int?), string sharedKey = default(string), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), IList trafficSelectorPolicies = default(IList), bool? enableRateLimiting = default(bool?), bool? enableInternetSecurity = default(bool?), bool? useLocalAzureIpAddress = default(bool?), string provisioningState = default(string), IList vpnLinkConnections = default(IList), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), string name = default(string), string etag = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The provisioning state of the VPN connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + + /// Id of the connected vpn site. + /// + + /// Routing weight for vpn connection. + /// + + /// DPD timeout in seconds for vpn connection. + /// + + /// The connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// Ingress bytes transferred. + /// + + /// Egress bytes transferred. + /// + + /// Expected bandwidth in MBPS. + /// + + /// SharedKey for the vpn connection. + /// + + /// EnableBgp flag. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// The Traffic Selector Policies to be considered by this connection. + /// + + /// EnableBgp flag. + /// + + /// Enable internet security. + /// + + /// Use local azure ip to initiate connection. + /// + + /// List of all vpn site link connections to the gateway. + /// + public VpnConnection(string id = default(string), string name = default(string), string etag = default(string), string provisioningState = default(string), RoutingConfiguration routingConfiguration = default(RoutingConfiguration), SubResource remoteVpnSite = default(SubResource), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionStatus = default(string), string vpnConnectionProtocolType = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), int? connectionBandwidth = default(int?), string sharedKey = default(string), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList trafficSelectorPolicies = default(System.Collections.Generic.IList), bool? enableRateLimiting = default(bool?), bool? enableInternetSecurity = default(bool?), bool? useLocalAzureIPAddress = default(bool?), System.Collections.Generic.IList vpnLinkConnections = default(System.Collections.Generic.IList)) + + : base(id) { - RemoteVpnSite = remoteVpnSite; - RoutingWeight = routingWeight; - DpdTimeoutSeconds = dpdTimeoutSeconds; - ConnectionStatus = connectionStatus; - VpnConnectionProtocolType = vpnConnectionProtocolType; - IngressBytesTransferred = ingressBytesTransferred; - EgressBytesTransferred = egressBytesTransferred; - ConnectionBandwidth = connectionBandwidth; - SharedKey = sharedKey; - EnableBgp = enableBgp; - UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; - IpsecPolicies = ipsecPolicies; - TrafficSelectorPolicies = trafficSelectorPolicies; - EnableRateLimiting = enableRateLimiting; - EnableInternetSecurity = enableInternetSecurity; - UseLocalAzureIpAddress = useLocalAzureIpAddress; - ProvisioningState = provisioningState; - VpnLinkConnections = vpnLinkConnections; - RoutingConfiguration = routingConfiguration; - Name = name; - Etag = etag; + this.Name = name; + this.Etag = etag; + this.ProvisioningState = provisioningState; + this.RoutingConfiguration = routingConfiguration; + this.RemoteVpnSite = remoteVpnSite; + this.RoutingWeight = routingWeight; + this.DpdTimeoutSeconds = dpdTimeoutSeconds; + this.ConnectionStatus = connectionStatus; + this.VpnConnectionProtocolType = vpnConnectionProtocolType; + this.IngressBytesTransferred = ingressBytesTransferred; + this.EgressBytesTransferred = egressBytesTransferred; + this.ConnectionBandwidth = connectionBandwidth; + this.SharedKey = sharedKey; + this.EnableBgp = enableBgp; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.TrafficSelectorPolicies = trafficSelectorPolicies; + this.EnableRateLimiting = enableRateLimiting; + this.EnableInternetSecurity = enableInternetSecurity; + this.UseLocalAzureIPAddress = useLocalAzureIPAddress; + this.VpnLinkConnections = vpnLinkConnections; CustomInit(); } @@ -110,140 +126,135 @@ public VpnConnection() /// partial void CustomInit(); + + /// + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets the provisioning state of the VPN connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } + /// /// Gets or sets id of the connected vpn site. /// - [JsonProperty(PropertyName = "properties.remoteVpnSite")] - public SubResource RemoteVpnSite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVpnSite")] + public SubResource RemoteVpnSite {get; set; } /// /// Gets or sets routing weight for vpn connection. /// - [JsonProperty(PropertyName = "properties.routingWeight")] - public int? RoutingWeight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] + public int? RoutingWeight {get; set; } /// - /// Gets or sets DPD timeout in seconds for vpn connection. + /// Gets or sets dPD timeout in seconds for vpn connection. /// - [JsonProperty(PropertyName = "properties.dpdTimeoutSeconds")] - public int? DpdTimeoutSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dpdTimeoutSeconds")] + public int? DpdTimeoutSeconds {get; set; } /// - /// Gets or sets the connection status. Possible values include: - /// 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] + public string ConnectionStatus {get; private set; } /// - /// Gets or sets connection protocol used for this connection. Possible - /// values include: 'IKEv2', 'IKEv1' + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' /// - [JsonProperty(PropertyName = "properties.vpnConnectionProtocolType")] - public string VpnConnectionProtocolType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnConnectionProtocolType")] + public string VpnConnectionProtocolType {get; set; } /// /// Gets ingress bytes transferred. /// - [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } /// /// Gets egress bytes transferred. /// - [JsonProperty(PropertyName = "properties.egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } /// /// Gets or sets expected bandwidth in MBPS. /// - [JsonProperty(PropertyName = "properties.connectionBandwidth")] - public int? ConnectionBandwidth { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionBandwidth")] + public int? ConnectionBandwidth {get; set; } /// /// Gets or sets sharedKey for the vpn connection. /// - [JsonProperty(PropertyName = "properties.sharedKey")] - public string SharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey {get; set; } /// /// Gets or sets enableBgp flag. /// - [JsonProperty(PropertyName = "properties.enableBgp")] - public bool? EnableBgp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + public bool? EnableBgp {get; set; } /// /// Gets or sets enable policy-based traffic selectors. /// - [JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] - public bool? UsePolicyBasedTrafficSelectors { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } /// - /// Gets or sets the IPSec Policies to be considered by this - /// connection. + /// Gets or sets the IPSec Policies to be considered by this connection. /// - [JsonProperty(PropertyName = "properties.ipsecPolicies")] - public IList IpsecPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } /// /// Gets or sets the Traffic Selector Policies to be considered by this /// connection. /// - [JsonProperty(PropertyName = "properties.trafficSelectorPolicies")] - public IList TrafficSelectorPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.trafficSelectorPolicies")] + public System.Collections.Generic.IList TrafficSelectorPolicies {get; set; } /// /// Gets or sets enableBgp flag. /// - [JsonProperty(PropertyName = "properties.enableRateLimiting")] - public bool? EnableRateLimiting { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableRateLimiting")] + public bool? EnableRateLimiting {get; set; } /// /// Gets or sets enable internet security. /// - [JsonProperty(PropertyName = "properties.enableInternetSecurity")] - public bool? EnableInternetSecurity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } /// /// Gets or sets use local azure ip to initiate connection. /// - [JsonProperty(PropertyName = "properties.useLocalAzureIpAddress")] - public bool? UseLocalAzureIpAddress { get; set; } - - /// - /// Gets the provisioning state of the VPN connection resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useLocalAzureIpAddress")] + public bool? UseLocalAzureIPAddress {get; set; } /// /// Gets or sets list of all vpn site link connections to the gateway. /// - [JsonProperty(PropertyName = "properties.vpnLinkConnections")] - public IList VpnLinkConnections { get; set; } - - /// - /// Gets or sets the Routing Configuration indicating the associated - /// and propagated route tables on this connection. - /// - [JsonProperty(PropertyName = "properties.routingConfiguration")] - public RoutingConfiguration RoutingConfiguration { get; set; } - - /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnLinkConnections")] + public System.Collections.Generic.IList VpnLinkConnections {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStartParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStartParameters.cs index 4ed8ee034b34..f9305f15ed9e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStartParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStartParameters.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Vpn Connection packet capture parameters supplied to start packet - /// capture on gateway connection. + /// Vpn Connection packet capture parameters supplied to start packet capture + /// on gateway connection. /// public partial class VpnConnectionPacketCaptureStartParameters { /// - /// Initializes a new instance of the - /// VpnConnectionPacketCaptureStartParameters class. + /// Initializes a new instance of the VpnConnectionPacketCaptureStartParameters class. /// public VpnConnectionPacketCaptureStartParameters() { @@ -31,17 +22,19 @@ public VpnConnectionPacketCaptureStartParameters() } /// - /// Initializes a new instance of the - /// VpnConnectionPacketCaptureStartParameters class. + /// Initializes a new instance of the VpnConnectionPacketCaptureStartParameters class. /// - /// Start Packet capture parameters on vpn - /// connection. - /// List of site link connection - /// names. - public VpnConnectionPacketCaptureStartParameters(string filterData = default(string), IList linkConnectionNames = default(IList)) + + /// Start Packet capture parameters on vpn connection. + /// + + /// List of site link connection names. + /// + public VpnConnectionPacketCaptureStartParameters(string filterData = default(string), System.Collections.Generic.IList linkConnectionNames = default(System.Collections.Generic.IList)) + { - FilterData = filterData; - LinkConnectionNames = linkConnectionNames; + this.FilterData = filterData; + this.LinkConnectionNames = linkConnectionNames; CustomInit(); } @@ -50,17 +43,17 @@ public VpnConnectionPacketCaptureStartParameters() /// partial void CustomInit(); + /// /// Gets or sets start Packet capture parameters on vpn connection. /// - [JsonProperty(PropertyName = "filterData")] - public string FilterData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "filterData")] + public string FilterData {get; set; } /// /// Gets or sets list of site link connection names. /// - [JsonProperty(PropertyName = "linkConnectionNames")] - public IList LinkConnectionNames { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linkConnectionNames")] + public System.Collections.Generic.IList LinkConnectionNames {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStopParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStopParameters.cs index 7781b7eceeb8..ba29f63cf60c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStopParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionPacketCaptureStopParameters.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Vpn Connection packet capture parameters supplied to stop packet - /// capture on gateway connection. + /// Vpn Connection packet capture parameters supplied to stop packet capture on + /// gateway connection. /// public partial class VpnConnectionPacketCaptureStopParameters { /// - /// Initializes a new instance of the - /// VpnConnectionPacketCaptureStopParameters class. + /// Initializes a new instance of the VpnConnectionPacketCaptureStopParameters class. /// public VpnConnectionPacketCaptureStopParameters() { @@ -31,17 +22,19 @@ public VpnConnectionPacketCaptureStopParameters() } /// - /// Initializes a new instance of the - /// VpnConnectionPacketCaptureStopParameters class. + /// Initializes a new instance of the VpnConnectionPacketCaptureStopParameters class. /// - /// SAS url for packet capture on vpn - /// connection. - /// List of site link connection - /// names. - public VpnConnectionPacketCaptureStopParameters(string sasUrl = default(string), IList linkConnectionNames = default(IList)) + + /// SAS url for packet capture on vpn connection. + /// + + /// List of site link connection names. + /// + public VpnConnectionPacketCaptureStopParameters(string sasUrl = default(string), System.Collections.Generic.IList linkConnectionNames = default(System.Collections.Generic.IList)) + { - SasUrl = sasUrl; - LinkConnectionNames = linkConnectionNames; + this.SasUrl = sasUrl; + this.LinkConnectionNames = linkConnectionNames; CustomInit(); } @@ -50,17 +43,17 @@ public VpnConnectionPacketCaptureStopParameters() /// partial void CustomInit(); + /// - /// Gets or sets SAS url for packet capture on vpn connection. + /// Gets or sets sAS url for packet capture on vpn connection. /// - [JsonProperty(PropertyName = "sasUrl")] - public string SasUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sasUrl")] + public string SasUrl {get; set; } /// /// Gets or sets list of site link connection names. /// - [JsonProperty(PropertyName = "linkConnectionNames")] - public IList LinkConnectionNames { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linkConnectionNames")] + public System.Collections.Generic.IList LinkConnectionNames {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionProperties.cs new file mode 100644 index 000000000000..5d882f58ddc6 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionProperties.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnConnection. + /// + public partial class VpnConnectionProperties + { + /// + /// Initializes a new instance of the VpnConnectionProperties class. + /// + public VpnConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnConnectionProperties class. + /// + + /// Id of the connected vpn site. + /// + + /// Routing weight for vpn connection. + /// + + /// DPD timeout in seconds for vpn connection. + /// + + /// The connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// Ingress bytes transferred. + /// + + /// Egress bytes transferred. + /// + + /// Expected bandwidth in MBPS. + /// + + /// SharedKey for the vpn connection. + /// + + /// EnableBgp flag. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// The Traffic Selector Policies to be considered by this connection. + /// + + /// EnableBgp flag. + /// + + /// Enable internet security. + /// + + /// Use local azure ip to initiate connection. + /// + + /// The provisioning state of the VPN connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of all vpn site link connections to the gateway. + /// + + /// The Routing Configuration indicating the associated and propagated route + /// tables on this connection. + /// + public VpnConnectionProperties(SubResource remoteVpnSite = default(SubResource), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionStatus = default(string), string vpnConnectionProtocolType = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), int? connectionBandwidth = default(int?), string sharedKey = default(string), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList trafficSelectorPolicies = default(System.Collections.Generic.IList), bool? enableRateLimiting = default(bool?), bool? enableInternetSecurity = default(bool?), bool? useLocalAzureIPAddress = default(bool?), string provisioningState = default(string), System.Collections.Generic.IList vpnLinkConnections = default(System.Collections.Generic.IList), RoutingConfiguration routingConfiguration = default(RoutingConfiguration)) + + { + this.RemoteVpnSite = remoteVpnSite; + this.RoutingWeight = routingWeight; + this.DpdTimeoutSeconds = dpdTimeoutSeconds; + this.ConnectionStatus = connectionStatus; + this.VpnConnectionProtocolType = vpnConnectionProtocolType; + this.IngressBytesTransferred = ingressBytesTransferred; + this.EgressBytesTransferred = egressBytesTransferred; + this.ConnectionBandwidth = connectionBandwidth; + this.SharedKey = sharedKey; + this.EnableBgp = enableBgp; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.TrafficSelectorPolicies = trafficSelectorPolicies; + this.EnableRateLimiting = enableRateLimiting; + this.EnableInternetSecurity = enableInternetSecurity; + this.UseLocalAzureIPAddress = useLocalAzureIPAddress; + this.ProvisioningState = provisioningState; + this.VpnLinkConnections = vpnLinkConnections; + this.RoutingConfiguration = routingConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets id of the connected vpn site. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVpnSite")] + public SubResource RemoteVpnSite {get; set; } + + /// + /// Gets or sets routing weight for vpn connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingWeight")] + public int? RoutingWeight {get; set; } + + /// + /// Gets or sets dPD timeout in seconds for vpn connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dpdTimeoutSeconds")] + public int? DpdTimeoutSeconds {get; set; } + + /// + /// Gets the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } + + /// + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnConnectionProtocolType")] + public string VpnConnectionProtocolType {get; set; } + + /// + /// Gets ingress bytes transferred. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } + + /// + /// Gets egress bytes transferred. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } + + /// + /// Gets or sets expected bandwidth in MBPS. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionBandwidth")] + public int? ConnectionBandwidth {get; set; } + + /// + /// Gets or sets sharedKey for the vpn connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedKey")] + public string SharedKey {get; set; } + + /// + /// Gets or sets enableBgp flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgp")] + public bool? EnableBgp {get; set; } + + /// + /// Gets or sets enable policy-based traffic selectors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } + + /// + /// Gets or sets the IPSec Policies to be considered by this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } + + /// + /// Gets or sets the Traffic Selector Policies to be considered by this + /// connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "trafficSelectorPolicies")] + public System.Collections.Generic.IList TrafficSelectorPolicies {get; set; } + + /// + /// Gets or sets enableBgp flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableRateLimiting")] + public bool? EnableRateLimiting {get; set; } + + /// + /// Gets or sets enable internet security. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableInternetSecurity")] + public bool? EnableInternetSecurity {get; set; } + + /// + /// Gets or sets use local azure ip to initiate connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "useLocalAzureIpAddress")] + public bool? UseLocalAzureIPAddress {get; set; } + + /// + /// Gets the provisioning state of the VPN connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets list of all vpn site link connections to the gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnLinkConnections")] + public System.Collections.Generic.IList VpnLinkConnections {get; set; } + + /// + /// Gets or sets the Routing Configuration indicating the associated and + /// propagated route tables on this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")] + public RoutingConfiguration RoutingConfiguration {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionStatus.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionStatus.cs index 1a0afdf098dd..6628b2e8a682 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionStatus.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnConnectionStatus. /// + + public static class VpnConnectionStatus { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class VpnConnectionStatus public const string Connected = "Connected"; public const string NotConnected = "NotConnected"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnDeviceScriptParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnDeviceScriptParameters.cs index 5b22f85cd13f..fe91e63cdd0e 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnDeviceScriptParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnDeviceScriptParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public VpnDeviceScriptParameters() /// /// Initializes a new instance of the VpnDeviceScriptParameters class. /// - /// The vendor for the vpn device. - /// The device family for the vpn - /// device. - /// The firmware version for the vpn - /// device. + + /// The vendor for the vpn device. + /// + + /// The device family for the vpn device. + /// + + /// The firmware version for the vpn device. + /// public VpnDeviceScriptParameters(string vendor = default(string), string deviceFamily = default(string), string firmwareVersion = default(string)) + { - Vendor = vendor; - DeviceFamily = deviceFamily; - FirmwareVersion = firmwareVersion; + this.Vendor = vendor; + this.DeviceFamily = deviceFamily; + this.FirmwareVersion = firmwareVersion; CustomInit(); } @@ -47,23 +46,23 @@ public VpnDeviceScriptParameters() /// partial void CustomInit(); + /// /// Gets or sets the vendor for the vpn device. /// - [JsonProperty(PropertyName = "vendor")] - public string Vendor { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vendor")] + public string Vendor {get; set; } /// /// Gets or sets the device family for the vpn device. /// - [JsonProperty(PropertyName = "deviceFamily")] - public string DeviceFamily { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deviceFamily")] + public string DeviceFamily {get; set; } /// /// Gets or sets the firmware version for the vpn device. /// - [JsonProperty(PropertyName = "firmwareVersion")] - public string FirmwareVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "firmwareVersion")] + public string FirmwareVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGateway.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGateway.cs index 18475785e6db..3ad613233173 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGateway.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGateway.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnGateway Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnGateway : Resource { /// @@ -34,45 +24,66 @@ public VpnGateway() /// /// Initializes a new instance of the VpnGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The VirtualHub to which the gateway - /// belongs. - /// List of all vpn connections to the - /// gateway. - /// Local network gateway's BGP speaker - /// settings. - /// The provisioning state of the VPN - /// gateway resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The scale unit for this vpn - /// gateway. - /// List of all IPs configured on the - /// gateway. - /// Enable BGP routes - /// translation for NAT on this VpnGateway. - /// Enable Routing Preference - /// property for the Public IP Interface of the VpnGateway. - /// List of all the nat Rules associated with - /// the gateway. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VpnGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualHub = default(SubResource), IList connections = default(IList), BgpSettings bgpSettings = default(BgpSettings), string provisioningState = default(string), int? vpnGatewayScaleUnit = default(int?), IList ipConfigurations = default(IList), bool? enableBgpRouteTranslationForNat = default(bool?), bool? isRoutingPreferenceInternet = default(bool?), IList natRules = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Local network gateway's BGP speaker settings. + /// + + /// The provisioning state of the VPN gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The VirtualHub to which the gateway belongs. + /// + + /// List of all vpn connections to the gateway. + /// + + /// The scale unit for this vpn gateway. + /// + + /// List of all IPs configured on the gateway. + /// + + /// Enable BGP routes translation for NAT on this VpnGateway. + /// + + /// Enable Routing Preference property for the Public IP Interface of the + /// VpnGateway. + /// + + /// List of all the nat Rules associated with the gateway. + /// + public VpnGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), BgpSettings bgpSettings = default(BgpSettings), string provisioningState = default(string), SubResource virtualHub = default(SubResource), System.Collections.Generic.IList connections = default(System.Collections.Generic.IList), int? vpnGatewayScaleUnit = default(int?), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), bool? enableBgpRouteTranslationForNat = default(bool?), bool? isRoutingPreferenceInternet = default(bool?), System.Collections.Generic.IList natRules = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - VirtualHub = virtualHub; - Connections = connections; - BgpSettings = bgpSettings; - ProvisioningState = provisioningState; - VpnGatewayScaleUnit = vpnGatewayScaleUnit; - IpConfigurations = ipConfigurations; - EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; - IsRoutingPreferenceInternet = isRoutingPreferenceInternet; - NatRules = natRules; - Etag = etag; + this.Etag = etag; + this.BgpSettings = bgpSettings; + this.ProvisioningState = provisioningState; + this.VirtualHub = virtualHub; + this.Connections = connections; + this.VpnGatewayScaleUnit = vpnGatewayScaleUnit; + this.IPConfigurations = ipConfigurations; + this.EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + this.IsRoutingPreferenceInternet = isRoutingPreferenceInternet; + this.NatRules = natRules; CustomInit(); } @@ -81,82 +92,86 @@ public VpnGateway() /// partial void CustomInit(); + /// - /// Gets or sets the VirtualHub to which the gateway belongs. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.virtualHub")] - public SubResource VirtualHub { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets list of all vpn connections to the gateway. + /// Gets or sets local network gateway's BGP speaker settings. /// - [JsonProperty(PropertyName = "properties.connections")] - public IList Connections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] + public BgpSettings BgpSettings {get; set; } /// - /// Gets or sets local network gateway's BGP speaker settings. + /// Gets the provisioning state of the VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.bgpSettings")] - public BgpSettings BgpSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the VPN gateway resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the VirtualHub to which the gateway belongs. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualHub")] + public SubResource VirtualHub {get; set; } /// - /// Gets or sets the scale unit for this vpn gateway. + /// Gets or sets list of all vpn connections to the gateway. /// - [JsonProperty(PropertyName = "properties.vpnGatewayScaleUnit")] - public int? VpnGatewayScaleUnit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connections")] + public System.Collections.Generic.IList Connections {get; set; } /// - /// Gets list of all IPs configured on the gateway. + /// Gets or sets the scale unit for this vpn gateway. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnGatewayScaleUnit")] + public int? VpnGatewayScaleUnit {get; set; } /// - /// Gets or sets enable BGP routes translation for NAT on this - /// VpnGateway. + /// Gets list of all IPs configured on the gateway. /// - [JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] - public bool? EnableBgpRouteTranslationForNat { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } /// - /// Gets or sets enable Routing Preference property for the Public IP - /// Interface of the VpnGateway. + /// Gets or sets enable BGP routes translation for NAT on this VpnGateway. /// - [JsonProperty(PropertyName = "properties.isRoutingPreferenceInternet")] - public bool? IsRoutingPreferenceInternet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] + public bool? EnableBgpRouteTranslationForNat {get; set; } /// - /// Gets or sets list of all the nat Rules associated with the gateway. + /// Gets or sets enable Routing Preference property for the Public IP Interface + /// of the VpnGateway. /// - [JsonProperty(PropertyName = "properties.natRules")] - public IList NatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isRoutingPreferenceInternet")] + public bool? IsRoutingPreferenceInternet {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets list of all the nat Rules associated with the gateway. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.natRules")] + public System.Collections.Generic.IList NatRules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BgpSettings != null) + + if (this.BgpSettings != null) { - BgpSettings.Validate(); + this.BgpSettings.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayGeneration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayGeneration.cs index 41c936248d6e..0408d0ba9669 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayGeneration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayGeneration.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnGatewayGeneration. /// + + public static class VpnGatewayGeneration { public const string None = "None"; public const string Generation1 = "Generation1"; public const string Generation2 = "Generation2"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayIpConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayIpConfiguration.cs index 2faef676d43b..d444b970e356 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayIpConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayIpConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public VpnGatewayIpConfiguration() /// /// Initializes a new instance of the VpnGatewayIpConfiguration class. /// - /// The identifier of the IP configuration for a VPN - /// Gateway. - /// The public IP address of this IP - /// configuration. - /// The private IP address of this IP - /// configuration. - public VpnGatewayIpConfiguration(string id = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string)) + + /// The identifier of the IP configuration for a VPN Gateway. + /// + + /// The public IP address of this IP configuration. + /// + + /// The private IP address of this IP configuration. + /// + public VpnGatewayIpConfiguration(string id = default(string), string publicIPAddress = default(string), string privateIPAddress = default(string)) + { - Id = id; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; + this.Id = id; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; CustomInit(); } @@ -48,24 +46,23 @@ public VpnGatewayIpConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the identifier of the IP configuration for a VPN - /// Gateway. + /// Gets or sets the identifier of the IP configuration for a VPN Gateway. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the public IP address of this IP configuration. /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIPAddress {get; set; } /// /// Gets or sets the private IP address of this IP configuration. /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIPAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRule.cs index 207d7858c6e9..5e3c4c9a5ffc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnGatewayNatRule Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnGatewayNatRule : SubResource { /// @@ -34,44 +24,58 @@ public VpnGatewayNatRule() /// /// Initializes a new instance of the VpnGatewayNatRule class. /// - /// Resource ID. - /// The provisioning state of the NAT - /// Rule resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The type of NAT rule - /// for VPN NAT. Possible values include: 'Static', 'Dynamic' - /// The Source NAT direction of a VPN NAT. Possible - /// values include: 'EgressSnat', 'IngressSnat' - /// The private IP address internal - /// mapping for NAT. - /// The private IP address external - /// mapping for NAT. - /// The IP Configuration ID this NAT - /// rule applies to. - /// List of egress - /// VpnSiteLinkConnections. - /// List of ingress - /// VpnSiteLinkConnections. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public VpnGatewayNatRule(string id = default(string), string provisioningState = default(string), string vpnGatewayNatRulePropertiesType = default(string), string mode = default(string), IList internalMappings = default(IList), IList externalMappings = default(IList), string ipConfigurationId = default(string), IList egressVpnSiteLinkConnections = default(IList), IList ingressVpnSiteLinkConnections = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the NAT Rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of NAT rule for VPN NAT. + /// Possible values include: 'Static', 'Dynamic' + + /// The Source NAT direction of a VPN NAT. + /// Possible values include: 'EgressSnat', 'IngressSnat' + + /// The private IP address internal mapping for NAT. + /// + + /// The private IP address external mapping for NAT. + /// + + /// The IP Configuration ID this NAT rule applies to. + /// + + /// List of egress VpnSiteLinkConnections. + /// + + /// List of ingress VpnSiteLinkConnections. + /// + public VpnGatewayNatRule(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), string propertiesType = default(string), string mode = default(string), System.Collections.Generic.IList internalMappings = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalMappings = default(System.Collections.Generic.IList), string ipConfigurationId = default(string), System.Collections.Generic.IList egressVpnSiteLinkConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList ingressVpnSiteLinkConnections = default(System.Collections.Generic.IList)) + + : base(id) { - ProvisioningState = provisioningState; - VpnGatewayNatRulePropertiesType = vpnGatewayNatRulePropertiesType; - Mode = mode; - InternalMappings = internalMappings; - ExternalMappings = externalMappings; - IpConfigurationId = ipConfigurationId; - EgressVpnSiteLinkConnections = egressVpnSiteLinkConnections; - IngressVpnSiteLinkConnections = ingressVpnSiteLinkConnections; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.PropertiesType = propertiesType; + this.Mode = mode; + this.InternalMappings = internalMappings; + this.ExternalMappings = externalMappings; + this.IPConfigurationId = ipConfigurationId; + this.EgressVpnSiteLinkConnections = egressVpnSiteLinkConnections; + this.IngressVpnSiteLinkConnections = ingressVpnSiteLinkConnections; CustomInit(); } @@ -80,76 +84,73 @@ public VpnGatewayNatRule() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the NAT Rule resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the type of NAT rule for VPN NAT. Possible values - /// include: 'Static', 'Dynamic' + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.type")] - public string VpnGatewayNatRulePropertiesType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the Source NAT direction of a VPN NAT. Possible values - /// include: 'EgressSnat', 'IngressSnat' + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the private IP address internal mapping for NAT. + /// Gets the provisioning state of the NAT Rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.internalMappings")] - public IList InternalMappings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the private IP address external mapping for NAT. + /// Gets or sets the type of NAT rule for VPN NAT. Possible values include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.externalMappings")] - public IList ExternalMappings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string PropertiesType {get; set; } /// - /// Gets or sets the IP Configuration ID this NAT rule applies to. + /// Gets or sets the Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' /// - [JsonProperty(PropertyName = "properties.ipConfigurationId")] - public string IpConfigurationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mode")] + public string Mode {get; set; } /// - /// Gets list of egress VpnSiteLinkConnections. + /// Gets or sets the private IP address internal mapping for NAT. /// - [JsonProperty(PropertyName = "properties.egressVpnSiteLinkConnections")] - public IList EgressVpnSiteLinkConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.internalMappings")] + public System.Collections.Generic.IList InternalMappings {get; set; } /// - /// Gets list of ingress VpnSiteLinkConnections. + /// Gets or sets the private IP address external mapping for NAT. /// - [JsonProperty(PropertyName = "properties.ingressVpnSiteLinkConnections")] - public IList IngressVpnSiteLinkConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalMappings")] + public System.Collections.Generic.IList ExternalMappings {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets the IP Configuration ID this NAT rule applies to. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurationId")] + public string IPConfigurationId {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets list of egress VpnSiteLinkConnections. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressVpnSiteLinkConnections")] + public System.Collections.Generic.IList EgressVpnSiteLinkConnections {get; private set; } /// - /// Gets resource type. + /// Gets list of ingress VpnSiteLinkConnections. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressVpnSiteLinkConnections")] + public System.Collections.Generic.IList IngressVpnSiteLinkConnections {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRuleProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRuleProperties.cs new file mode 100644 index 000000000000..f94b9debbf57 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayNatRuleProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnGatewayNatRule. + /// + public partial class VpnGatewayNatRuleProperties + { + /// + /// Initializes a new instance of the VpnGatewayNatRuleProperties class. + /// + public VpnGatewayNatRuleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnGatewayNatRuleProperties class. + /// + + /// The provisioning state of the NAT Rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The type of NAT rule for VPN NAT. + /// Possible values include: 'Static', 'Dynamic' + + /// The Source NAT direction of a VPN NAT. + /// Possible values include: 'EgressSnat', 'IngressSnat' + + /// The private IP address internal mapping for NAT. + /// + + /// The private IP address external mapping for NAT. + /// + + /// The IP Configuration ID this NAT rule applies to. + /// + + /// List of egress VpnSiteLinkConnections. + /// + + /// List of ingress VpnSiteLinkConnections. + /// + public VpnGatewayNatRuleProperties(string provisioningState = default(string), string type = default(string), string mode = default(string), System.Collections.Generic.IList internalMappings = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalMappings = default(System.Collections.Generic.IList), string ipConfigurationId = default(string), System.Collections.Generic.IList egressVpnSiteLinkConnections = default(System.Collections.Generic.IList), System.Collections.Generic.IList ingressVpnSiteLinkConnections = default(System.Collections.Generic.IList)) + + { + this.ProvisioningState = provisioningState; + this.Type = type; + this.Mode = mode; + this.InternalMappings = internalMappings; + this.ExternalMappings = externalMappings; + this.IPConfigurationId = ipConfigurationId; + this.EgressVpnSiteLinkConnections = egressVpnSiteLinkConnections; + this.IngressVpnSiteLinkConnections = ingressVpnSiteLinkConnections; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the NAT Rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the type of NAT rule for VPN NAT. Possible values include: 'Static', 'Dynamic' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets the Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } + + /// + /// Gets or sets the private IP address internal mapping for NAT. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "internalMappings")] + public System.Collections.Generic.IList InternalMappings {get; set; } + + /// + /// Gets or sets the private IP address external mapping for NAT. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalMappings")] + public System.Collections.Generic.IList ExternalMappings {get; set; } + + /// + /// Gets or sets the IP Configuration ID this NAT rule applies to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurationId")] + public string IPConfigurationId {get; set; } + + /// + /// Gets list of egress VpnSiteLinkConnections. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressVpnSiteLinkConnections")] + public System.Collections.Generic.IList EgressVpnSiteLinkConnections {get; private set; } + + /// + /// Gets list of ingress VpnSiteLinkConnections. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressVpnSiteLinkConnections")] + public System.Collections.Generic.IList IngressVpnSiteLinkConnections {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStartParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStartParameters.cs index 84f09fab1130..c7df2317faa7 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStartParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStartParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnGatewayPacketCaptureStartParameters { /// - /// Initializes a new instance of the - /// VpnGatewayPacketCaptureStartParameters class. + /// Initializes a new instance of the VpnGatewayPacketCaptureStartParameters class. /// public VpnGatewayPacketCaptureStartParameters() { @@ -28,14 +21,15 @@ public VpnGatewayPacketCaptureStartParameters() } /// - /// Initializes a new instance of the - /// VpnGatewayPacketCaptureStartParameters class. + /// Initializes a new instance of the VpnGatewayPacketCaptureStartParameters class. /// - /// Start Packet capture parameters on vpn - /// gateway. + + /// Start Packet capture parameters on vpn gateway. + /// public VpnGatewayPacketCaptureStartParameters(string filterData = default(string)) + { - FilterData = filterData; + this.FilterData = filterData; CustomInit(); } @@ -44,11 +38,11 @@ public VpnGatewayPacketCaptureStartParameters() /// partial void CustomInit(); + /// /// Gets or sets start Packet capture parameters on vpn gateway. /// - [JsonProperty(PropertyName = "filterData")] - public string FilterData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filterData")] + public string FilterData {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStopParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStopParameters.cs index d49f2bc05515..01eb85bbd5d0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStopParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayPacketCaptureStopParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnGatewayPacketCaptureStopParameters { /// - /// Initializes a new instance of the - /// VpnGatewayPacketCaptureStopParameters class. + /// Initializes a new instance of the VpnGatewayPacketCaptureStopParameters class. /// public VpnGatewayPacketCaptureStopParameters() { @@ -28,14 +21,15 @@ public VpnGatewayPacketCaptureStopParameters() } /// - /// Initializes a new instance of the - /// VpnGatewayPacketCaptureStopParameters class. + /// Initializes a new instance of the VpnGatewayPacketCaptureStopParameters class. /// - /// SAS url for packet capture on vpn - /// gateway. + + /// SAS url for packet capture on vpn gateway. + /// public VpnGatewayPacketCaptureStopParameters(string sasUrl = default(string)) + { - SasUrl = sasUrl; + this.SasUrl = sasUrl; CustomInit(); } @@ -44,11 +38,11 @@ public VpnGatewayPacketCaptureStopParameters() /// partial void CustomInit(); + /// - /// Gets or sets SAS url for packet capture on vpn gateway. + /// Gets or sets sAS url for packet capture on vpn gateway. /// - [JsonProperty(PropertyName = "sasUrl")] - public string SasUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sasUrl")] + public string SasUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayProperties.cs new file mode 100644 index 000000000000..ba76281dd093 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayProperties.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnGateway. + /// + public partial class VpnGatewayProperties + { + /// + /// Initializes a new instance of the VpnGatewayProperties class. + /// + public VpnGatewayProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnGatewayProperties class. + /// + + /// The VirtualHub to which the gateway belongs. + /// + + /// List of all vpn connections to the gateway. + /// + + /// Local network gateway's BGP speaker settings. + /// + + /// The provisioning state of the VPN gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The scale unit for this vpn gateway. + /// + + /// List of all IPs configured on the gateway. + /// + + /// Enable BGP routes translation for NAT on this VpnGateway. + /// + + /// Enable Routing Preference property for the Public IP Interface of the + /// VpnGateway. + /// + + /// List of all the nat Rules associated with the gateway. + /// + public VpnGatewayProperties(SubResource virtualHub = default(SubResource), System.Collections.Generic.IList connections = default(System.Collections.Generic.IList), BgpSettings bgpSettings = default(BgpSettings), string provisioningState = default(string), int? vpnGatewayScaleUnit = default(int?), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), bool? enableBgpRouteTranslationForNat = default(bool?), bool? isRoutingPreferenceInternet = default(bool?), System.Collections.Generic.IList natRules = default(System.Collections.Generic.IList)) + + { + this.VirtualHub = virtualHub; + this.Connections = connections; + this.BgpSettings = bgpSettings; + this.ProvisioningState = provisioningState; + this.VpnGatewayScaleUnit = vpnGatewayScaleUnit; + this.IPConfigurations = ipConfigurations; + this.EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + this.IsRoutingPreferenceInternet = isRoutingPreferenceInternet; + this.NatRules = natRules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the VirtualHub to which the gateway belongs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualHub")] + public SubResource VirtualHub {get; set; } + + /// + /// Gets or sets list of all vpn connections to the gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connections")] + public System.Collections.Generic.IList Connections {get; set; } + + /// + /// Gets or sets local network gateway's BGP speaker settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpSettings")] + public BgpSettings BgpSettings {get; set; } + + /// + /// Gets the provisioning state of the VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the scale unit for this vpn gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnGatewayScaleUnit")] + public int? VpnGatewayScaleUnit {get; set; } + + /// + /// Gets list of all IPs configured on the gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IPConfigurations {get; private set; } + + /// + /// Gets or sets enable BGP routes translation for NAT on this VpnGateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgpRouteTranslationForNat")] + public bool? EnableBgpRouteTranslationForNat {get; set; } + + /// + /// Gets or sets enable Routing Preference property for the Public IP Interface + /// of the VpnGateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isRoutingPreferenceInternet")] + public bool? IsRoutingPreferenceInternet {get; set; } + + /// + /// Gets or sets list of all the nat Rules associated with the gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "natRules")] + public System.Collections.Generic.IList NatRules {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.BgpSettings != null) + { + this.BgpSettings.Validate(); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayTunnelingProtocol.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayTunnelingProtocol.cs index 16ada0177b5e..39c1e93cea9a 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayTunnelingProtocol.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnGatewayTunnelingProtocol.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnGatewayTunnelingProtocol. /// + + public static class VpnGatewayTunnelingProtocol { public const string IkeV2 = "IkeV2"; public const string OpenVPN = "OpenVPN"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkBgpSettings.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkBgpSettings.cs index 7fc16bde0d2b..9bf09383e188 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkBgpSettings.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkBgpSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public VpnLinkBgpSettings() /// /// Initializes a new instance of the VpnLinkBgpSettings class. /// - /// The BGP speaker's ASN. - /// The BGP peering address and BGP - /// identifier of this BGP speaker. + + /// The BGP speaker's ASN. + /// + + /// The BGP peering address and BGP identifier of this BGP speaker. + /// public VpnLinkBgpSettings(long? asn = default(long?), string bgpPeeringAddress = default(string)) + { - Asn = asn; - BgpPeeringAddress = bgpPeeringAddress; + this.Asn = asn; + this.BgpPeeringAddress = bgpPeeringAddress; CustomInit(); } @@ -44,18 +42,18 @@ public VpnLinkBgpSettings() /// partial void CustomInit(); + /// - /// Gets or sets the BGP speaker's ASN. + /// Gets or sets the BGP speaker's ASN. /// - [JsonProperty(PropertyName = "asn")] - public long? Asn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + public long? Asn {get; set; } /// /// Gets or sets the BGP peering address and BGP identifier of this BGP /// speaker. /// - [JsonProperty(PropertyName = "bgpPeeringAddress")] - public string BgpPeeringAddress { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpPeeringAddress")] + public string BgpPeeringAddress {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkConnectionMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkConnectionMode.cs index f2e10a8fc341..40a8c45bb898 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkConnectionMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkConnectionMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnLinkConnectionMode. /// + + public static class VpnLinkConnectionMode { public const string Default = "Default"; public const string ResponderOnly = "ResponderOnly"; public const string InitiatorOnly = "InitiatorOnly"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkProviderProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkProviderProperties.cs index dd703d25c537..8800e7e3348d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkProviderProperties.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnLinkProviderProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public VpnLinkProviderProperties() /// /// Initializes a new instance of the VpnLinkProviderProperties class. /// - /// Name of the link provider. - /// Link speed. + + /// Name of the link provider. + /// + + /// Link speed. + /// public VpnLinkProviderProperties(string linkProviderName = default(string), int? linkSpeedInMbps = default(int?)) + { - LinkProviderName = linkProviderName; - LinkSpeedInMbps = linkSpeedInMbps; + this.LinkProviderName = linkProviderName; + this.LinkSpeedInMbps = linkSpeedInMbps; CustomInit(); } @@ -43,17 +42,17 @@ public VpnLinkProviderProperties() /// partial void CustomInit(); + /// /// Gets or sets name of the link provider. /// - [JsonProperty(PropertyName = "linkProviderName")] - public string LinkProviderName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "linkProviderName")] + public string LinkProviderName {get; set; } /// /// Gets or sets link speed. /// - [JsonProperty(PropertyName = "linkSpeedInMbps")] - public int? LinkSpeedInMbps { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linkSpeedInMbps")] + public int? LinkSpeedInMbps {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMapping.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMapping.cs index b98593e6408a..2dae22d7fd94 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMapping.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMapping.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public VpnNatRuleMapping() /// /// Initializes a new instance of the VpnNatRuleMapping class. /// - /// Address space for Vpn NatRule - /// mapping. - /// Port range for Vpn NatRule mapping. + + /// Address space for Vpn NatRule mapping. + /// + + /// Port range for Vpn NatRule mapping. + /// public VpnNatRuleMapping(string addressSpace = default(string), string portRange = default(string)) + { - AddressSpace = addressSpace; - PortRange = portRange; + this.AddressSpace = addressSpace; + this.PortRange = portRange; CustomInit(); } @@ -44,17 +42,17 @@ public VpnNatRuleMapping() /// partial void CustomInit(); + /// /// Gets or sets address space for Vpn NatRule mapping. /// - [JsonProperty(PropertyName = "addressSpace")] - public string AddressSpace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressSpace")] + public string AddressSpace {get; set; } /// /// Gets or sets port range for Vpn NatRule mapping. /// - [JsonProperty(PropertyName = "portRange")] - public string PortRange { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "portRange")] + public string PortRange {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMode.cs index faa59fd6a3d5..74025671f430 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnNatRuleMode. /// + + public static class VpnNatRuleMode { public const string EgressSnat = "EgressSnat"; public const string IngressSnat = "IngressSnat"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleType.cs index 2dddca76e778..bb355288e706 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnNatRuleType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnNatRuleType. /// + + public static class VpnNatRuleType { public const string Static = "Static"; public const string Dynamic = "Dynamic"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStartParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStartParameters.cs index 221c5b4923f3..f368b288711c 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStartParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStartParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnPacketCaptureStartParameters { /// - /// Initializes a new instance of the VpnPacketCaptureStartParameters - /// class. + /// Initializes a new instance of the VpnPacketCaptureStartParameters class. /// public VpnPacketCaptureStartParameters() { @@ -28,13 +21,15 @@ public VpnPacketCaptureStartParameters() } /// - /// Initializes a new instance of the VpnPacketCaptureStartParameters - /// class. + /// Initializes a new instance of the VpnPacketCaptureStartParameters class. /// - /// Start Packet capture parameters. + + /// Start Packet capture parameters. + /// public VpnPacketCaptureStartParameters(string filterData = default(string)) + { - FilterData = filterData; + this.FilterData = filterData; CustomInit(); } @@ -43,11 +38,11 @@ public VpnPacketCaptureStartParameters() /// partial void CustomInit(); + /// /// Gets or sets start Packet capture parameters. /// - [JsonProperty(PropertyName = "filterData")] - public string FilterData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filterData")] + public string FilterData {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStopParameters.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStopParameters.cs index 60200a13431f..ef0377d27745 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStopParameters.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnPacketCaptureStopParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnPacketCaptureStopParameters { /// - /// Initializes a new instance of the VpnPacketCaptureStopParameters - /// class. + /// Initializes a new instance of the VpnPacketCaptureStopParameters class. /// public VpnPacketCaptureStopParameters() { @@ -28,14 +21,15 @@ public VpnPacketCaptureStopParameters() } /// - /// Initializes a new instance of the VpnPacketCaptureStopParameters - /// class. + /// Initializes a new instance of the VpnPacketCaptureStopParameters class. /// - /// SAS url for packet capture on virtual network - /// gateway. + + /// SAS url for packet capture on virtual network gateway. + /// public VpnPacketCaptureStopParameters(string sasUrl = default(string)) + { - SasUrl = sasUrl; + this.SasUrl = sasUrl; CustomInit(); } @@ -44,11 +38,11 @@ public VpnPacketCaptureStopParameters() /// partial void CustomInit(); + /// - /// Gets or sets SAS url for packet capture on virtual network gateway. + /// Gets or sets sAS url for packet capture on virtual network gateway. /// - [JsonProperty(PropertyName = "sasUrl")] - public string SasUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sasUrl")] + public string SasUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnPolicyMemberAttributeType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnPolicyMemberAttributeType.cs index 9e260623ee1f..8f94a0fe40b0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnPolicyMemberAttributeType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnPolicyMemberAttributeType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnPolicyMemberAttributeType. /// + + public static class VpnPolicyMemberAttributeType { public const string CertificateGroupId = "CertificateGroupId"; public const string AADGroupId = "AADGroupId"; public const string RadiusAzureGroupId = "RadiusAzureGroupId"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnProfileResponse.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnProfileResponse.cs index 5d2b6746d7f9..7eb00a34eb24 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnProfileResponse.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnProfileResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public VpnProfileResponse() /// /// Initializes a new instance of the VpnProfileResponse class. /// - /// URL to the VPN profile. + + /// URL to the VPN profile. + /// public VpnProfileResponse(string profileUrl = default(string)) + { - ProfileUrl = profileUrl; + this.ProfileUrl = profileUrl; CustomInit(); } @@ -41,11 +38,11 @@ public VpnProfileResponse() /// partial void CustomInit(); + /// - /// Gets or sets URL to the VPN profile. + /// Gets or sets uRL to the VPN profile. /// - [JsonProperty(PropertyName = "profileUrl")] - public string ProfileUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "profileUrl")] + public string ProfileUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusClientRootCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusClientRootCertificate.cs index b2f52c317f49..42595e592061 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusClientRootCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusClientRootCertificate.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Properties of the Radius client root certificate of - /// VpnServerConfiguration. + /// Properties of the Radius client root certificate of VpnServerConfiguration. /// public partial class VpnServerConfigRadiusClientRootCertificate { /// - /// Initializes a new instance of the - /// VpnServerConfigRadiusClientRootCertificate class. + /// Initializes a new instance of the VpnServerConfigRadiusClientRootCertificate class. /// public VpnServerConfigRadiusClientRootCertificate() { @@ -29,16 +21,19 @@ public VpnServerConfigRadiusClientRootCertificate() } /// - /// Initializes a new instance of the - /// VpnServerConfigRadiusClientRootCertificate class. + /// Initializes a new instance of the VpnServerConfigRadiusClientRootCertificate class. /// - /// The certificate name. - /// The Radius client root certificate - /// thumbprint. + + /// The certificate name. + /// + + /// The Radius client root certificate thumbprint. + /// public VpnServerConfigRadiusClientRootCertificate(string name = default(string), string thumbprint = default(string)) + { - Name = name; - Thumbprint = thumbprint; + this.Name = name; + this.Thumbprint = thumbprint; CustomInit(); } @@ -47,17 +42,17 @@ public VpnServerConfigRadiusClientRootCertificate() /// partial void CustomInit(); + /// /// Gets or sets the certificate name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the Radius client root certificate thumbprint. /// - [JsonProperty(PropertyName = "thumbprint")] - public string Thumbprint { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusServerRootCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusServerRootCertificate.cs index 0069381805aa..8966c61c3bc6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusServerRootCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigRadiusServerRootCertificate.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnServerConfigRadiusServerRootCertificate { /// - /// Initializes a new instance of the - /// VpnServerConfigRadiusServerRootCertificate class. + /// Initializes a new instance of the VpnServerConfigRadiusServerRootCertificate class. /// public VpnServerConfigRadiusServerRootCertificate() { @@ -28,15 +21,19 @@ public VpnServerConfigRadiusServerRootCertificate() } /// - /// Initializes a new instance of the - /// VpnServerConfigRadiusServerRootCertificate class. + /// Initializes a new instance of the VpnServerConfigRadiusServerRootCertificate class. /// - /// The certificate name. - /// The certificate public data. + + /// The certificate name. + /// + + /// The certificate public data. + /// public VpnServerConfigRadiusServerRootCertificate(string name = default(string), string publicCertData = default(string)) + { - Name = name; - PublicCertData = publicCertData; + this.Name = name; + this.PublicCertData = publicCertData; CustomInit(); } @@ -45,17 +42,17 @@ public VpnServerConfigRadiusServerRootCertificate() /// partial void CustomInit(); + /// /// Gets or sets the certificate name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the certificate public data. /// - [JsonProperty(PropertyName = "publicCertData")] - public string PublicCertData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "publicCertData")] + public string PublicCertData {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRevokedCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRevokedCertificate.cs index 8903e59a3c67..2370e1060540 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRevokedCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRevokedCertificate.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Properties of the revoked VPN client certificate of - /// VpnServerConfiguration. + /// Properties of the revoked VPN client certificate of VpnServerConfiguration. /// public partial class VpnServerConfigVpnClientRevokedCertificate { /// - /// Initializes a new instance of the - /// VpnServerConfigVpnClientRevokedCertificate class. + /// Initializes a new instance of the VpnServerConfigVpnClientRevokedCertificate class. /// public VpnServerConfigVpnClientRevokedCertificate() { @@ -29,16 +21,19 @@ public VpnServerConfigVpnClientRevokedCertificate() } /// - /// Initializes a new instance of the - /// VpnServerConfigVpnClientRevokedCertificate class. + /// Initializes a new instance of the VpnServerConfigVpnClientRevokedCertificate class. /// - /// The certificate name. - /// The revoked VPN client certificate - /// thumbprint. + + /// The certificate name. + /// + + /// The revoked VPN client certificate thumbprint. + /// public VpnServerConfigVpnClientRevokedCertificate(string name = default(string), string thumbprint = default(string)) + { - Name = name; - Thumbprint = thumbprint; + this.Name = name; + this.Thumbprint = thumbprint; CustomInit(); } @@ -47,17 +42,17 @@ public VpnServerConfigVpnClientRevokedCertificate() /// partial void CustomInit(); + /// /// Gets or sets the certificate name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the revoked VPN client certificate thumbprint. /// - [JsonProperty(PropertyName = "thumbprint")] - public string Thumbprint { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRootCertificate.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRootCertificate.cs index bf0c63ac9cb6..0a50d1a6b6aa 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRootCertificate.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigVpnClientRootCertificate.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnServerConfigVpnClientRootCertificate { /// - /// Initializes a new instance of the - /// VpnServerConfigVpnClientRootCertificate class. + /// Initializes a new instance of the VpnServerConfigVpnClientRootCertificate class. /// public VpnServerConfigVpnClientRootCertificate() { @@ -28,15 +21,19 @@ public VpnServerConfigVpnClientRootCertificate() } /// - /// Initializes a new instance of the - /// VpnServerConfigVpnClientRootCertificate class. + /// Initializes a new instance of the VpnServerConfigVpnClientRootCertificate class. /// - /// The certificate name. - /// The certificate public data. + + /// The certificate name. + /// + + /// The certificate public data. + /// public VpnServerConfigVpnClientRootCertificate(string name = default(string), string publicCertData = default(string)) + { - Name = name; - PublicCertData = publicCertData; + this.Name = name; + this.PublicCertData = publicCertData; CustomInit(); } @@ -45,17 +42,17 @@ public VpnServerConfigVpnClientRootCertificate() /// partial void CustomInit(); + /// /// Gets or sets the certificate name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the certificate public data. /// - [JsonProperty(PropertyName = "publicCertData")] - public string PublicCertData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "publicCertData")] + public string PublicCertData {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfiguration.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfiguration.cs index 3c08e9381def..6baf3ae186a0 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfiguration.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfiguration.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnServerConfiguration Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnServerConfiguration : Resource { /// @@ -34,70 +24,97 @@ public VpnServerConfiguration() /// /// Initializes a new instance of the VpnServerConfiguration class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The name of the - /// VpnServerConfiguration that is unique within a resource - /// group. - /// VPN protocols for the - /// VpnServerConfiguration. - /// VPN authentication types for - /// the VpnServerConfiguration. - /// VPN client root certificate - /// of VpnServerConfiguration. - /// VPN client revoked - /// certificate of VpnServerConfiguration. - /// Radius Server root - /// certificate of VpnServerConfiguration. - /// Radius client root - /// certificate of VpnServerConfiguration. - /// VpnClientIpsecPolicies for - /// VpnServerConfiguration. - /// The radius server address - /// property of the VpnServerConfiguration resource for point to site - /// client connection. - /// The radius secret property of the - /// VpnServerConfiguration resource for point to site client - /// connection. - /// Multiple Radius Server configuration - /// for VpnServerConfiguration. - /// The set of aad vpn - /// authentication parameters. - /// The provisioning state of the - /// VpnServerConfiguration resource. Possible values are: 'Updating', - /// 'Deleting', and 'Failed'. - /// List of references to - /// P2SVpnGateways. - /// List of all - /// VpnServerConfigurationPolicyGroups. - /// A unique - /// read-only string that changes whenever the resource is - /// updated. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VpnServerConfiguration(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string vpnServerConfigurationName = default(string), IList vpnProtocols = default(IList), IList vpnAuthenticationTypes = default(IList), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList radiusServerRootCertificates = default(IList), IList radiusClientRootCertificates = default(IList), IList vpnClientIpsecPolicies = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), IList radiusServers = default(IList), AadAuthenticationParameters aadAuthenticationParameters = default(AadAuthenticationParameters), string provisioningState = default(string), IList p2SVpnGateways = default(IList), IList configurationPolicyGroups = default(IList), string vpnServerConfigurationPropertiesEtag = default(string), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The name of the VpnServerConfiguration that is unique within a resource + /// group. + /// + + /// VPN protocols for the VpnServerConfiguration. + /// + + /// VPN authentication types for the VpnServerConfiguration. + /// + + /// VPN client root certificate of VpnServerConfiguration. + /// + + /// VPN client revoked certificate of VpnServerConfiguration. + /// + + /// Radius Server root certificate of VpnServerConfiguration. + /// + + /// Radius client root certificate of VpnServerConfiguration. + /// + + /// VpnClientIpsecPolicies for VpnServerConfiguration. + /// + + /// The radius server address property of the VpnServerConfiguration resource + /// for point to site client connection. + /// + + /// The radius secret property of the VpnServerConfiguration resource for point + /// to site client connection. + /// + + /// Multiple Radius Server configuration for VpnServerConfiguration. + /// + + /// The set of aad vpn authentication parameters. + /// + + /// The provisioning state of the VpnServerConfiguration resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. + /// + + /// List of references to P2SVpnGateways. + /// + + /// List of all VpnServerConfigurationPolicyGroups. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + public VpnServerConfiguration(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string propertiesName = default(string), System.Collections.Generic.IList vpnProtocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnAuthenticationTypes = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRevokedCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList radiusServerRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList radiusClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientIpsecPolicies = default(System.Collections.Generic.IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), System.Collections.Generic.IList radiusServers = default(System.Collections.Generic.IList), AadAuthenticationParameters aadAuthenticationParameters = default(AadAuthenticationParameters), string provisioningState = default(string), System.Collections.Generic.IList p2SVpnGateways = default(System.Collections.Generic.IList), System.Collections.Generic.IList configurationPolicyGroups = default(System.Collections.Generic.IList), string propertiesEtag = default(string)) + + : base(id, name, type, location, tags) { - VpnServerConfigurationName = vpnServerConfigurationName; - VpnProtocols = vpnProtocols; - VpnAuthenticationTypes = vpnAuthenticationTypes; - VpnClientRootCertificates = vpnClientRootCertificates; - VpnClientRevokedCertificates = vpnClientRevokedCertificates; - RadiusServerRootCertificates = radiusServerRootCertificates; - RadiusClientRootCertificates = radiusClientRootCertificates; - VpnClientIpsecPolicies = vpnClientIpsecPolicies; - RadiusServerAddress = radiusServerAddress; - RadiusServerSecret = radiusServerSecret; - RadiusServers = radiusServers; - AadAuthenticationParameters = aadAuthenticationParameters; - ProvisioningState = provisioningState; - P2SVpnGateways = p2SVpnGateways; - ConfigurationPolicyGroups = configurationPolicyGroups; - VpnServerConfigurationPropertiesEtag = vpnServerConfigurationPropertiesEtag; - Etag = etag; + this.Etag = etag; + this.PropertiesName = propertiesName; + this.VpnProtocols = vpnProtocols; + this.VpnAuthenticationTypes = vpnAuthenticationTypes; + this.VpnClientRootCertificates = vpnClientRootCertificates; + this.VpnClientRevokedCertificates = vpnClientRevokedCertificates; + this.RadiusServerRootCertificates = radiusServerRootCertificates; + this.RadiusClientRootCertificates = radiusClientRootCertificates; + this.VpnClientIpsecPolicies = vpnClientIpsecPolicies; + this.RadiusServerAddress = radiusServerAddress; + this.RadiusServerSecret = radiusServerSecret; + this.RadiusServers = radiusServers; + this.AadAuthenticationParameters = aadAuthenticationParameters; + this.ProvisioningState = provisioningState; + this.P2SVpnGateways = p2SVpnGateways; + this.ConfigurationPolicyGroups = configurationPolicyGroups; + this.PropertiesEtag = propertiesEtag; CustomInit(); } @@ -106,120 +123,114 @@ public VpnServerConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the name of the VpnServerConfiguration that is unique - /// within a resource group. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.name")] - public string VpnServerConfigurationName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets VPN protocols for the VpnServerConfiguration. + /// Gets or sets the name of the VpnServerConfiguration that is unique within a + /// resource group. /// - [JsonProperty(PropertyName = "properties.vpnProtocols")] - public IList VpnProtocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + public string PropertiesName {get; set; } /// - /// Gets or sets VPN authentication types for the - /// VpnServerConfiguration. + /// Gets or sets vPN protocols for the VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnAuthenticationTypes")] - public IList VpnAuthenticationTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnProtocols")] + public System.Collections.Generic.IList VpnProtocols {get; set; } /// - /// Gets or sets VPN client root certificate of VpnServerConfiguration. + /// Gets or sets vPN authentication types for the VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnClientRootCertificates")] - public IList VpnClientRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnAuthenticationTypes")] + public System.Collections.Generic.IList VpnAuthenticationTypes {get; set; } /// - /// Gets or sets VPN client revoked certificate of - /// VpnServerConfiguration. + /// Gets or sets vPN client root certificate of VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnClientRevokedCertificates")] - public IList VpnClientRevokedCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientRootCertificates")] + public System.Collections.Generic.IList VpnClientRootCertificates {get; set; } /// - /// Gets or sets radius Server root certificate of - /// VpnServerConfiguration. + /// Gets or sets vPN client revoked certificate of VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.radiusServerRootCertificates")] - public IList RadiusServerRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientRevokedCertificates")] + public System.Collections.Generic.IList VpnClientRevokedCertificates {get; set; } /// - /// Gets or sets radius client root certificate of - /// VpnServerConfiguration. + /// Gets or sets radius Server root certificate of VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.radiusServerRootCertificates")] + public System.Collections.Generic.IList RadiusServerRootCertificates {get; set; } + + /// + /// Gets or sets radius client root certificate of VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.radiusClientRootCertificates")] - public IList RadiusClientRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.radiusClientRootCertificates")] + public System.Collections.Generic.IList RadiusClientRootCertificates {get; set; } /// /// Gets or sets vpnClientIpsecPolicies for VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnClientIpsecPolicies")] - public IList VpnClientIpsecPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientIpsecPolicies")] + public System.Collections.Generic.IList VpnClientIpsecPolicies {get; set; } /// /// Gets or sets the radius server address property of the - /// VpnServerConfiguration resource for point to site client - /// connection. + /// VpnServerConfiguration resource for point to site client connection. /// - [JsonProperty(PropertyName = "properties.radiusServerAddress")] - public string RadiusServerAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.radiusServerAddress")] + public string RadiusServerAddress {get; set; } /// - /// Gets or sets the radius secret property of the - /// VpnServerConfiguration resource for point to site client - /// connection. + /// Gets or sets the radius secret property of the VpnServerConfiguration + /// resource for point to site client connection. /// - [JsonProperty(PropertyName = "properties.radiusServerSecret")] - public string RadiusServerSecret { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.radiusServerSecret")] + public string RadiusServerSecret {get; set; } /// /// Gets or sets multiple Radius Server configuration for /// VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.radiusServers")] - public IList RadiusServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.radiusServers")] + public System.Collections.Generic.IList RadiusServers {get; set; } /// /// Gets or sets the set of aad vpn authentication parameters. /// - [JsonProperty(PropertyName = "properties.aadAuthenticationParameters")] - public AadAuthenticationParameters AadAuthenticationParameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.aadAuthenticationParameters")] + public AadAuthenticationParameters AadAuthenticationParameters {get; set; } /// /// Gets the provisioning state of the VpnServerConfiguration resource. - /// Possible values are: 'Updating', 'Deleting', and 'Failed'. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets list of references to P2SVpnGateways. /// - [JsonProperty(PropertyName = "properties.p2SVpnGateways")] - public IList P2SVpnGateways { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.p2SVpnGateways")] + public System.Collections.Generic.IList P2SVpnGateways {get; private set; } /// /// Gets or sets list of all VpnServerConfigurationPolicyGroups. /// - [JsonProperty(PropertyName = "properties.configurationPolicyGroups")] - public IList ConfigurationPolicyGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.configurationPolicyGroups")] + public System.Collections.Generic.IList ConfigurationPolicyGroups {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.etag")] - public string VpnServerConfigurationPropertiesEtag { get; private set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.etag")] + public string PropertiesEtag {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroup.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroup.cs index 6ee7e033a366..bc467503efdb 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroup.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroup.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnServerConfigurationPolicyGroup Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnServerConfigurationPolicyGroup : SubResource { /// - /// Initializes a new instance of the VpnServerConfigurationPolicyGroup - /// class. + /// Initializes a new instance of the VpnServerConfigurationPolicyGroup class. /// public VpnServerConfigurationPolicyGroup() { @@ -33,38 +22,48 @@ public VpnServerConfigurationPolicyGroup() } /// - /// Initializes a new instance of the VpnServerConfigurationPolicyGroup - /// class. + /// Initializes a new instance of the VpnServerConfigurationPolicyGroup class. /// - /// Resource ID. - /// Shows if this is a Default - /// VpnServerConfigurationPolicyGroup or not. - /// Priority for - /// VpnServerConfigurationPolicyGroup. - /// Multiple PolicyMembers for - /// VpnServerConfigurationPolicyGroup. - /// List of references to - /// P2SConnectionConfigurations. - /// The provisioning state of the - /// VpnServerConfigurationPolicyGroup resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// Resource type. - public VpnServerConfigurationPolicyGroup(string id = default(string), bool? isDefault = default(bool?), int? priority = default(int?), IList policyMembers = default(IList), IList p2SConnectionConfigurations = default(IList), string provisioningState = default(string), string etag = default(string), string name = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// Resource type. + /// + + /// The provisioning state of the VpnServerConfigurationPolicyGroup resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + /// + + /// Priority for VpnServerConfigurationPolicyGroup. + /// + + /// Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + /// + + /// List of references to P2SConnectionConfigurations. + /// + public VpnServerConfigurationPolicyGroup(string id = default(string), string etag = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), bool? isDefault = default(bool?), int? priority = default(int?), System.Collections.Generic.IList policyMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList p2SConnectionConfigurations = default(System.Collections.Generic.IList)) + + : base(id) { - IsDefault = isDefault; - Priority = priority; - PolicyMembers = policyMembers; - P2SConnectionConfigurations = p2SConnectionConfigurations; - ProvisioningState = provisioningState; - Etag = etag; - Name = name; - Type = type; + this.Etag = etag; + this.Name = name; + this.Type = type; + this.ProvisioningState = provisioningState; + this.IsDefault = isDefault; + this.Priority = priority; + this.PolicyMembers = policyMembers; + this.P2SConnectionConfigurations = p2SConnectionConfigurations; CustomInit(); } @@ -73,59 +72,57 @@ public VpnServerConfigurationPolicyGroup() /// partial void CustomInit(); + /// - /// Gets or sets shows if this is a Default - /// VpnServerConfigurationPolicyGroup or not. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.isDefault")] - public bool? IsDefault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets priority for VpnServerConfigurationPolicyGroup. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.priority")] - public int? Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets multiple PolicyMembers for - /// VpnServerConfigurationPolicyGroup. + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.policyMembers")] - public IList PolicyMembers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets list of references to P2SConnectionConfigurations. + /// Gets the provisioning state of the VpnServerConfigurationPolicyGroup + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.p2SConnectionConfigurations")] - public IList P2SConnectionConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the - /// VpnServerConfigurationPolicyGroup resource. Possible values - /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets shows if this is a Default VpnServerConfigurationPolicyGroup + /// or not. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDefault")] + public bool? IsDefault {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets priority for VpnServerConfigurationPolicyGroup. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public int? Priority {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets multiple PolicyMembers for VpnServerConfigurationPolicyGroup. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.policyMembers")] + public System.Collections.Generic.IList PolicyMembers {get; set; } /// - /// Gets resource type. + /// Gets list of references to P2SConnectionConfigurations. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.p2SConnectionConfigurations")] + public System.Collections.Generic.IList P2SConnectionConfigurations {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupMember.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupMember.cs index 68b47b30282c..ba713764ac8f 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupMember.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupMember.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnServerConfigurationPolicyGroupMember { /// - /// Initializes a new instance of the - /// VpnServerConfigurationPolicyGroupMember class. + /// Initializes a new instance of the VpnServerConfigurationPolicyGroupMember class. /// public VpnServerConfigurationPolicyGroupMember() { @@ -28,21 +21,25 @@ public VpnServerConfigurationPolicyGroupMember() } /// - /// Initializes a new instance of the - /// VpnServerConfigurationPolicyGroupMember class. + /// Initializes a new instance of the VpnServerConfigurationPolicyGroupMember class. /// - /// Name of the - /// VpnServerConfigurationPolicyGroupMember. + + /// Name of the VpnServerConfigurationPolicyGroupMember. + /// + /// The Vpn Policy member attribute type. - /// Possible values include: 'CertificateGroupId', 'AADGroupId', - /// 'RadiusAzureGroupId' + /// Possible values include: 'CertificateGroupId', 'AADGroupId', + /// 'RadiusAzureGroupId' + /// The value of Attribute used for this - /// VpnServerConfigurationPolicyGroupMember. + /// VpnServerConfigurationPolicyGroupMember. + /// public VpnServerConfigurationPolicyGroupMember(string name = default(string), string attributeType = default(string), string attributeValue = default(string)) + { - Name = name; - AttributeType = attributeType; - AttributeValue = attributeValue; + this.Name = name; + this.AttributeType = attributeType; + this.AttributeValue = attributeValue; CustomInit(); } @@ -51,25 +48,24 @@ public VpnServerConfigurationPolicyGroupMember() /// partial void CustomInit(); + /// /// Gets or sets name of the VpnServerConfigurationPolicyGroupMember. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the Vpn Policy member attribute type. Possible values - /// include: 'CertificateGroupId', 'AADGroupId', 'RadiusAzureGroupId' + /// Gets or sets the Vpn Policy member attribute type. Possible values include: 'CertificateGroupId', 'AADGroupId', 'RadiusAzureGroupId' /// - [JsonProperty(PropertyName = "attributeType")] - public string AttributeType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "attributeType")] + public string AttributeType {get; set; } /// /// Gets or sets the value of Attribute used for this /// VpnServerConfigurationPolicyGroupMember. /// - [JsonProperty(PropertyName = "attributeValue")] - public string AttributeValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "attributeValue")] + public string AttributeValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupProperties.cs new file mode 100644 index 000000000000..972a68aeb98d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationPolicyGroupProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnServerConfigurationPolicyGroup. + /// + public partial class VpnServerConfigurationPolicyGroupProperties + { + /// + /// Initializes a new instance of the VpnServerConfigurationPolicyGroupProperties class. + /// + public VpnServerConfigurationPolicyGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnServerConfigurationPolicyGroupProperties class. + /// + + /// Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + /// + + /// Priority for VpnServerConfigurationPolicyGroup. + /// + + /// Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + /// + + /// List of references to P2SConnectionConfigurations. + /// + + /// The provisioning state of the VpnServerConfigurationPolicyGroup resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VpnServerConfigurationPolicyGroupProperties(bool? isDefault = default(bool?), int? priority = default(int?), System.Collections.Generic.IList policyMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList p2SConnectionConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string)) + + { + this.IsDefault = isDefault; + this.Priority = priority; + this.PolicyMembers = policyMembers; + this.P2SConnectionConfigurations = p2SConnectionConfigurations; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets shows if this is a Default VpnServerConfigurationPolicyGroup + /// or not. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDefault")] + public bool? IsDefault {get; set; } + + /// + /// Gets or sets priority for VpnServerConfigurationPolicyGroup. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int? Priority {get; set; } + + /// + /// Gets or sets multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "policyMembers")] + public System.Collections.Generic.IList PolicyMembers {get; set; } + + /// + /// Gets list of references to P2SConnectionConfigurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "p2SConnectionConfigurations")] + public System.Collections.Generic.IList P2SConnectionConfigurations {get; private set; } + + /// + /// Gets the provisioning state of the VpnServerConfigurationPolicyGroup + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationProperties.cs new file mode 100644 index 000000000000..483a06173d37 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationProperties.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnServerConfiguration. + /// + public partial class VpnServerConfigurationProperties + { + /// + /// Initializes a new instance of the VpnServerConfigurationProperties class. + /// + public VpnServerConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnServerConfigurationProperties class. + /// + + /// The name of the VpnServerConfiguration that is unique within a resource + /// group. + /// + + /// VPN protocols for the VpnServerConfiguration. + /// + + /// VPN authentication types for the VpnServerConfiguration. + /// + + /// VPN client root certificate of VpnServerConfiguration. + /// + + /// VPN client revoked certificate of VpnServerConfiguration. + /// + + /// Radius Server root certificate of VpnServerConfiguration. + /// + + /// Radius client root certificate of VpnServerConfiguration. + /// + + /// VpnClientIpsecPolicies for VpnServerConfiguration. + /// + + /// The radius server address property of the VpnServerConfiguration resource + /// for point to site client connection. + /// + + /// The radius secret property of the VpnServerConfiguration resource for point + /// to site client connection. + /// + + /// Multiple Radius Server configuration for VpnServerConfiguration. + /// + + /// The set of aad vpn authentication parameters. + /// + + /// The provisioning state of the VpnServerConfiguration resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. + /// + + /// List of references to P2SVpnGateways. + /// + + /// List of all VpnServerConfigurationPolicyGroups. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + public VpnServerConfigurationProperties(string name = default(string), System.Collections.Generic.IList vpnProtocols = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnAuthenticationTypes = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRevokedCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList radiusServerRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList radiusClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientIpsecPolicies = default(System.Collections.Generic.IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), System.Collections.Generic.IList radiusServers = default(System.Collections.Generic.IList), AadAuthenticationParameters aadAuthenticationParameters = default(AadAuthenticationParameters), string provisioningState = default(string), System.Collections.Generic.IList p2SVpnGateways = default(System.Collections.Generic.IList), System.Collections.Generic.IList configurationPolicyGroups = default(System.Collections.Generic.IList), string etag = default(string)) + + { + this.Name = name; + this.VpnProtocols = vpnProtocols; + this.VpnAuthenticationTypes = vpnAuthenticationTypes; + this.VpnClientRootCertificates = vpnClientRootCertificates; + this.VpnClientRevokedCertificates = vpnClientRevokedCertificates; + this.RadiusServerRootCertificates = radiusServerRootCertificates; + this.RadiusClientRootCertificates = radiusClientRootCertificates; + this.VpnClientIpsecPolicies = vpnClientIpsecPolicies; + this.RadiusServerAddress = radiusServerAddress; + this.RadiusServerSecret = radiusServerSecret; + this.RadiusServers = radiusServers; + this.AadAuthenticationParameters = aadAuthenticationParameters; + this.ProvisioningState = provisioningState; + this.P2SVpnGateways = p2SVpnGateways; + this.ConfigurationPolicyGroups = configurationPolicyGroups; + this.Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the name of the VpnServerConfiguration that is unique within a + /// resource group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets vPN protocols for the VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnProtocols")] + public System.Collections.Generic.IList VpnProtocols {get; set; } + + /// + /// Gets or sets vPN authentication types for the VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnAuthenticationTypes")] + public System.Collections.Generic.IList VpnAuthenticationTypes {get; set; } + + /// + /// Gets or sets vPN client root certificate of VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRootCertificates")] + public System.Collections.Generic.IList VpnClientRootCertificates {get; set; } + + /// + /// Gets or sets vPN client revoked certificate of VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRevokedCertificates")] + public System.Collections.Generic.IList VpnClientRevokedCertificates {get; set; } + + /// + /// Gets or sets radius Server root certificate of VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerRootCertificates")] + public System.Collections.Generic.IList RadiusServerRootCertificates {get; set; } + + /// + /// Gets or sets radius client root certificate of VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusClientRootCertificates")] + public System.Collections.Generic.IList RadiusClientRootCertificates {get; set; } + + /// + /// Gets or sets vpnClientIpsecPolicies for VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientIpsecPolicies")] + public System.Collections.Generic.IList VpnClientIpsecPolicies {get; set; } + + /// + /// Gets or sets the radius server address property of the + /// VpnServerConfiguration resource for point to site client connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerAddress")] + public string RadiusServerAddress {get; set; } + + /// + /// Gets or sets the radius secret property of the VpnServerConfiguration + /// resource for point to site client connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServerSecret")] + public string RadiusServerSecret {get; set; } + + /// + /// Gets or sets multiple Radius Server configuration for + /// VpnServerConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "radiusServers")] + public System.Collections.Generic.IList RadiusServers {get; set; } + + /// + /// Gets or sets the set of aad vpn authentication parameters. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "aadAuthenticationParameters")] + public AadAuthenticationParameters AadAuthenticationParameters {get; set; } + + /// + /// Gets the provisioning state of the VpnServerConfiguration resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets list of references to P2SVpnGateways. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "p2SVpnGateways")] + public System.Collections.Generic.IList P2SVpnGateways {get; private set; } + + /// + /// Gets or sets list of all VpnServerConfigurationPolicyGroups. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationPolicyGroups")] + public System.Collections.Generic.IList ConfigurationPolicyGroups {get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource is + /// updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationsResponse.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationsResponse.cs index 1e1dd698bb29..8b2184821269 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationsResponse.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnServerConfigurationsResponse.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class VpnServerConfigurationsResponse { /// - /// Initializes a new instance of the VpnServerConfigurationsResponse - /// class. + /// Initializes a new instance of the VpnServerConfigurationsResponse class. /// public VpnServerConfigurationsResponse() { @@ -30,14 +21,15 @@ public VpnServerConfigurationsResponse() } /// - /// Initializes a new instance of the VpnServerConfigurationsResponse - /// class. + /// Initializes a new instance of the VpnServerConfigurationsResponse class. /// - /// List of - /// VpnServerConfigurations associated with VirtualWan. - public VpnServerConfigurationsResponse(IList vpnServerConfigurationResourceIds = default(IList)) + + /// List of VpnServerConfigurations associated with VirtualWan. + /// + public VpnServerConfigurationsResponse(System.Collections.Generic.IList vpnServerConfigurationResourceIds = default(System.Collections.Generic.IList)) + { - VpnServerConfigurationResourceIds = vpnServerConfigurationResourceIds; + this.VpnServerConfigurationResourceIds = vpnServerConfigurationResourceIds; CustomInit(); } @@ -46,12 +38,11 @@ public VpnServerConfigurationsResponse() /// partial void CustomInit(); + /// - /// Gets or sets list of VpnServerConfigurations associated with - /// VirtualWan. + /// Gets or sets list of VpnServerConfigurations associated with VirtualWan. /// - [JsonProperty(PropertyName = "vpnServerConfigurationResourceIds")] - public IList VpnServerConfigurationResourceIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnServerConfigurationResourceIds")] + public System.Collections.Generic.IList VpnServerConfigurationResourceIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSite.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSite.cs index 31f9661aa11e..c6c70da837f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnSite.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSite.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnSite Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnSite : Resource { /// @@ -34,42 +24,69 @@ public VpnSite() /// /// Initializes a new instance of the VpnSite class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The VirtualWAN to which the vpnSite - /// belongs. - /// The device properties. - /// The ip-address for the vpn-site. - /// The key for vpn-site that can be used for - /// connections. - /// The AddressSpace that contains an array - /// of IP address ranges. - /// The set of bgp properties. - /// The provisioning state of the VPN - /// site resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// IsSecuritySite flag. - /// List of all vpn site links. - /// Office365 Policy. - /// A unique read-only string that changes whenever - /// the resource is updated. - public VpnSite(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualWan = default(SubResource), DeviceProperties deviceProperties = default(DeviceProperties), string ipAddress = default(string), string siteKey = default(string), AddressSpace addressSpace = default(AddressSpace), BgpSettings bgpProperties = default(BgpSettings), string provisioningState = default(string), bool? isSecuritySite = default(bool?), IList vpnSiteLinks = default(IList), O365PolicyProperties o365Policy = default(O365PolicyProperties), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The device properties. + /// + + /// The AddressSpace that contains an array of IP address ranges. + /// + + /// The provisioning state of the VPN site resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The VirtualWAN to which the vpnSite belongs. + /// + + /// The ip-address for the vpn-site. + /// + + /// The key for vpn-site that can be used for connections. + /// + + /// The set of bgp properties. + /// + + /// IsSecuritySite flag. + /// + + /// List of all vpn site links. + /// + + /// Office365 Policy. + /// + public VpnSite(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), DeviceProperties deviceProperties = default(DeviceProperties), AddressSpace addressSpace = default(AddressSpace), string provisioningState = default(string), SubResource virtualWan = default(SubResource), string ipAddress = default(string), string siteKey = default(string), BgpSettings bgpProperties = default(BgpSettings), bool? isSecuritySite = default(bool?), System.Collections.Generic.IList vpnSiteLinks = default(System.Collections.Generic.IList), O365PolicyProperties o365Policy = default(O365PolicyProperties)) + + : base(id, name, type, location, tags) { - VirtualWan = virtualWan; - DeviceProperties = deviceProperties; - IpAddress = ipAddress; - SiteKey = siteKey; - AddressSpace = addressSpace; - BgpProperties = bgpProperties; - ProvisioningState = provisioningState; - IsSecuritySite = isSecuritySite; - VpnSiteLinks = vpnSiteLinks; - O365Policy = o365Policy; - Etag = etag; + this.Etag = etag; + this.DeviceProperties = deviceProperties; + this.AddressSpace = addressSpace; + this.ProvisioningState = provisioningState; + this.VirtualWan = virtualWan; + this.IPAddress = ipAddress; + this.SiteKey = siteKey; + this.BgpProperties = bgpProperties; + this.IsSecuritySite = isSecuritySite; + this.VpnSiteLinks = vpnSiteLinks; + this.O365Policy = o365Policy; CustomInit(); } @@ -78,87 +95,94 @@ public VpnSite() /// partial void CustomInit(); + /// - /// Gets or sets the VirtualWAN to which the vpnSite belongs. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.virtualWan")] - public SubResource VirtualWan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Gets or sets the device properties. /// - [JsonProperty(PropertyName = "properties.deviceProperties")] - public DeviceProperties DeviceProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deviceProperties")] + public DeviceProperties DeviceProperties {get; set; } /// - /// Gets or sets the ip-address for the vpn-site. + /// Gets or sets the AddressSpace that contains an array of IP address ranges. /// - [JsonProperty(PropertyName = "properties.ipAddress")] - public string IpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressSpace")] + public AddressSpace AddressSpace {get; set; } /// - /// Gets or sets the key for vpn-site that can be used for connections. + /// Gets the provisioning state of the VPN site resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.siteKey")] - public string SiteKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the AddressSpace that contains an array of IP address - /// ranges. + /// Gets or sets the VirtualWAN to which the vpnSite belongs. /// - [JsonProperty(PropertyName = "properties.addressSpace")] - public AddressSpace AddressSpace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualWan")] + public SubResource VirtualWan {get; set; } /// - /// Gets or sets the set of bgp properties. + /// Gets or sets the ip-address for the vpn-site. /// - [JsonProperty(PropertyName = "properties.bgpProperties")] - public BgpSettings BgpProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] + public string IPAddress {get; set; } /// - /// Gets the provisioning state of the VPN site resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the key for vpn-site that can be used for connections. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.siteKey")] + public string SiteKey {get; set; } + + /// + /// Gets or sets the set of bgp properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpProperties")] + public BgpSettings BgpProperties {get; set; } /// /// Gets or sets isSecuritySite flag. /// - [JsonProperty(PropertyName = "properties.isSecuritySite")] - public bool? IsSecuritySite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isSecuritySite")] + public bool? IsSecuritySite {get; set; } /// /// Gets or sets list of all vpn site links. /// - [JsonProperty(PropertyName = "properties.vpnSiteLinks")] - public IList VpnSiteLinks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnSiteLinks")] + public System.Collections.Generic.IList VpnSiteLinks {get; set; } /// /// Gets or sets office365 Policy. /// - [JsonProperty(PropertyName = "properties.o365Policy")] - public O365PolicyProperties O365Policy { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.o365Policy")] + public O365PolicyProperties O365Policy {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BgpProperties != null) + + + + + + + + if (this.BgpProperties != null) { - BgpProperties.Validate(); + this.BgpProperties.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteId.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteId.cs index 7a6913db794f..4635f15fd368 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteId.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteId.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public VpnSiteId() /// /// Initializes a new instance of the VpnSiteId class. /// - /// The resource-uri of the vpn-site for which - /// config is to be fetched. + + /// The resource-uri of the vpn-site for which config is to be fetched. + /// public VpnSiteId(string vpnSite = default(string)) + { - VpnSite = vpnSite; + this.VpnSite = vpnSite; CustomInit(); } @@ -42,12 +38,11 @@ public VpnSiteId() /// partial void CustomInit(); + /// - /// Gets the resource-uri of the vpn-site for which config is to be - /// fetched. + /// Gets the resource-uri of the vpn-site for which config is to be fetched. /// - [JsonProperty(PropertyName = "vpnSite")] - public string VpnSite { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnSite")] + public string VpnSite {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLink.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLink.cs index a6df4b58e46c..f8b0df054506 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLink.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLink.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// VpnSiteLink Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnSiteLink : SubResource { /// @@ -32,32 +24,46 @@ public VpnSiteLink() /// /// Initializes a new instance of the VpnSiteLink class. /// - /// Resource ID. - /// The link provider properties. - /// The ip-address for the - /// vpn-site-link. - /// FQDN of vpn-site-link. - /// The set of bgp properties. - /// The provisioning state of the VPN - /// site link resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// Resource type. - public VpnSiteLink(string id = default(string), VpnLinkProviderProperties linkProperties = default(VpnLinkProviderProperties), string ipAddress = default(string), string fqdn = default(string), VpnLinkBgpSettings bgpProperties = default(VpnLinkBgpSettings), string provisioningState = default(string), string etag = default(string), string name = default(string), string type = default(string)) - : base(id) + + /// Resource ID. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// Resource type. + /// + + /// The provisioning state of the VPN site link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The link provider properties. + /// + + /// The ip-address for the vpn-site-link. + /// + + /// FQDN of vpn-site-link. + /// + + /// The set of bgp properties. + /// + public VpnSiteLink(string id = default(string), string etag = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), VpnLinkProviderProperties linkProperties = default(VpnLinkProviderProperties), string ipAddress = default(string), string fqdn = default(string), VpnLinkBgpSettings bgpProperties = default(VpnLinkBgpSettings)) + + : base(id) { - LinkProperties = linkProperties; - IpAddress = ipAddress; - Fqdn = fqdn; - BgpProperties = bgpProperties; - ProvisioningState = provisioningState; - Etag = etag; - Name = name; - Type = type; + this.Etag = etag; + this.Name = name; + this.Type = type; + this.ProvisioningState = provisioningState; + this.LinkProperties = linkProperties; + this.IPAddress = ipAddress; + this.Fqdn = fqdn; + this.BgpProperties = bgpProperties; CustomInit(); } @@ -66,56 +72,55 @@ public VpnSiteLink() /// partial void CustomInit(); + /// - /// Gets or sets the link provider properties. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.linkProperties")] - public VpnLinkProviderProperties LinkProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets the ip-address for the vpn-site-link. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.ipAddress")] - public string IpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets FQDN of vpn-site-link. + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the set of bgp properties. + /// Gets the provisioning state of the VPN site link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.bgpProperties")] - public VpnLinkBgpSettings BgpProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the provisioning state of the VPN site link resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets or sets the link provider properties. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkProperties")] + public VpnLinkProviderProperties LinkProperties {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets the ip-address for the vpn-site-link. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] + public string IPAddress {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets fQDN of vpn-site-link. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdn")] + public string Fqdn {get; set; } /// - /// Gets resource type. + /// Gets or sets the set of bgp properties. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpProperties")] + public VpnLinkBgpSettings BgpProperties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnection.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnection.cs index 8724aba1b671..3061790253f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnection.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnection.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// VpnSiteLinkConnection Resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnSiteLinkConnection : SubResource { /// @@ -34,73 +24,99 @@ public VpnSiteLinkConnection() /// /// Initializes a new instance of the VpnSiteLinkConnection class. /// - /// Resource ID. - /// Id of the connected vpn site - /// link. - /// Routing weight for vpn - /// connection. + + /// Resource ID. + /// + + /// The name of the resource that is unique within a resource group. This name + /// can be used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Resource type. + /// + + /// The provisioning state of the VPN site link connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Id of the connected vpn site link. + /// + + /// Routing weight for vpn connection. + /// + /// Vpn link connection mode. - /// Possible values include: 'Default', 'ResponderOnly', - /// 'InitiatorOnly' - /// The connection status. Possible - /// values include: 'Unknown', 'Connecting', 'Connected', - /// 'NotConnected' - /// Connection protocol used - /// for this connection. Possible values include: 'IKEv2', - /// 'IKEv1' - /// Ingress bytes - /// transferred. - /// Egress bytes - /// transferred. - /// Expected bandwidth in - /// MBPS. - /// SharedKey for the vpn connection. - /// EnableBgp flag. - /// vpnGatewayCustomBgpAddresses - /// used by this connection. - /// Enable policy-based - /// traffic selectors. - /// The IPSec Policies to be considered by - /// this connection. - /// EnableBgp flag. - /// Use local azure ip to initiate - /// connection. - /// The provisioning state of the VPN - /// site link connection resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// List of ingress NatRules. - /// List of egress NatRules. - /// The name of the resource that is unique within a - /// resource group. This name can be used to access the - /// resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Resource type. - public VpnSiteLinkConnection(string id = default(string), SubResource vpnSiteLink = default(SubResource), int? routingWeight = default(int?), string vpnLinkConnectionMode = default(string), string connectionStatus = default(string), string vpnConnectionProtocolType = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), int? connectionBandwidth = default(int?), string sharedKey = default(string), bool? enableBgp = default(bool?), IList vpnGatewayCustomBgpAddresses = default(IList), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), bool? enableRateLimiting = default(bool?), bool? useLocalAzureIpAddress = default(bool?), string provisioningState = default(string), IList ingressNatRules = default(IList), IList egressNatRules = default(IList), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) + /// Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + + /// The connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// Ingress bytes transferred. + /// + + /// Egress bytes transferred. + /// + + /// Expected bandwidth in MBPS. + /// + + /// SharedKey for the vpn connection. + /// + + /// EnableBgp flag. + /// + + /// vpnGatewayCustomBgpAddresses used by this connection. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// EnableBgp flag. + /// + + /// Use local azure ip to initiate connection. + /// + + /// List of ingress NatRules. + /// + + /// List of egress NatRules. + /// + public VpnSiteLinkConnection(string id = default(string), string name = default(string), string etag = default(string), string type = default(string), string provisioningState = default(string), SubResource vpnSiteLink = default(SubResource), int? routingWeight = default(int?), string vpnLinkConnectionMode = default(string), string connectionStatus = default(string), string vpnConnectionProtocolType = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), int? connectionBandwidth = default(int?), string sharedKey = default(string), bool? enableBgp = default(bool?), System.Collections.Generic.IList vpnGatewayCustomBgpAddresses = default(System.Collections.Generic.IList), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), bool? enableRateLimiting = default(bool?), bool? useLocalAzureIPAddress = default(bool?), System.Collections.Generic.IList ingressNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList egressNatRules = default(System.Collections.Generic.IList)) + + : base(id) { - VpnSiteLink = vpnSiteLink; - RoutingWeight = routingWeight; - VpnLinkConnectionMode = vpnLinkConnectionMode; - ConnectionStatus = connectionStatus; - VpnConnectionProtocolType = vpnConnectionProtocolType; - IngressBytesTransferred = ingressBytesTransferred; - EgressBytesTransferred = egressBytesTransferred; - ConnectionBandwidth = connectionBandwidth; - SharedKey = sharedKey; - EnableBgp = enableBgp; - VpnGatewayCustomBgpAddresses = vpnGatewayCustomBgpAddresses; - UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; - IpsecPolicies = ipsecPolicies; - EnableRateLimiting = enableRateLimiting; - UseLocalAzureIpAddress = useLocalAzureIpAddress; - ProvisioningState = provisioningState; - IngressNatRules = ingressNatRules; - EgressNatRules = egressNatRules; - Name = name; - Etag = etag; - Type = type; + this.Name = name; + this.Etag = etag; + this.Type = type; + this.ProvisioningState = provisioningState; + this.VpnSiteLink = vpnSiteLink; + this.RoutingWeight = routingWeight; + this.VpnLinkConnectionMode = vpnLinkConnectionMode; + this.ConnectionStatus = connectionStatus; + this.VpnConnectionProtocolType = vpnConnectionProtocolType; + this.IngressBytesTransferred = ingressBytesTransferred; + this.EgressBytesTransferred = egressBytesTransferred; + this.ConnectionBandwidth = connectionBandwidth; + this.SharedKey = sharedKey; + this.EnableBgp = enableBgp; + this.VpnGatewayCustomBgpAddresses = vpnGatewayCustomBgpAddresses; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.EnableRateLimiting = enableRateLimiting; + this.UseLocalAzureIPAddress = useLocalAzureIPAddress; + this.IngressNatRules = ingressNatRules; + this.EgressNatRules = egressNatRules; CustomInit(); } @@ -109,139 +125,133 @@ public VpnSiteLinkConnection() /// partial void CustomInit(); + /// - /// Gets or sets id of the connected vpn site link. + /// Gets or sets the name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "properties.vpnSiteLink")] - public SubResource VpnSiteLink { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets routing weight for vpn connection. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.routingWeight")] - public int? RoutingWeight { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets vpn link connection mode. Possible values include: - /// 'Default', 'ResponderOnly', 'InitiatorOnly' + /// Gets resource type. /// - [JsonProperty(PropertyName = "properties.vpnLinkConnectionMode")] - public string VpnLinkConnectionMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets the connection status. Possible values include: - /// 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets the provisioning state of the VPN site link connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets connection protocol used for this connection. Possible - /// values include: 'IKEv2', 'IKEv1' + /// Gets or sets id of the connected vpn site link. /// - [JsonProperty(PropertyName = "properties.vpnConnectionProtocolType")] - public string VpnConnectionProtocolType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnSiteLink")] + public SubResource VpnSiteLink {get; set; } /// - /// Gets ingress bytes transferred. + /// Gets or sets routing weight for vpn connection. /// - [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] + public int? RoutingWeight {get; set; } /// - /// Gets egress bytes transferred. + /// Gets or sets vpn link connection mode. Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' /// - [JsonProperty(PropertyName = "properties.egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnLinkConnectionMode")] + public string VpnLinkConnectionMode {get; set; } /// - /// Gets or sets expected bandwidth in MBPS. + /// Gets the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "properties.connectionBandwidth")] - public int? ConnectionBandwidth { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] + public string ConnectionStatus {get; private set; } /// - /// Gets or sets sharedKey for the vpn connection. + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' /// - [JsonProperty(PropertyName = "properties.sharedKey")] - public string SharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnConnectionProtocolType")] + public string VpnConnectionProtocolType {get; set; } /// - /// Gets or sets enableBgp flag. + /// Gets ingress bytes transferred. /// - [JsonProperty(PropertyName = "properties.enableBgp")] - public bool? EnableBgp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } /// - /// Gets or sets vpnGatewayCustomBgpAddresses used by this connection. + /// Gets egress bytes transferred. /// - [JsonProperty(PropertyName = "properties.vpnGatewayCustomBgpAddresses")] - public IList VpnGatewayCustomBgpAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } /// - /// Gets or sets enable policy-based traffic selectors. + /// Gets or sets expected bandwidth in MBPS. /// - [JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] - public bool? UsePolicyBasedTrafficSelectors { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionBandwidth")] + public int? ConnectionBandwidth {get; set; } /// - /// Gets or sets the IPSec Policies to be considered by this - /// connection. + /// Gets or sets sharedKey for the vpn connection. /// - [JsonProperty(PropertyName = "properties.ipsecPolicies")] - public IList IpsecPolicies { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey {get; set; } /// /// Gets or sets enableBgp flag. /// - [JsonProperty(PropertyName = "properties.enableRateLimiting")] - public bool? EnableRateLimiting { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + public bool? EnableBgp {get; set; } /// - /// Gets or sets use local azure ip to initiate connection. + /// Gets or sets vpnGatewayCustomBgpAddresses used by this connection. /// - [JsonProperty(PropertyName = "properties.useLocalAzureIpAddress")] - public bool? UseLocalAzureIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnGatewayCustomBgpAddresses")] + public System.Collections.Generic.IList VpnGatewayCustomBgpAddresses {get; set; } /// - /// Gets the provisioning state of the VPN site link connection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets or sets enable policy-based traffic selectors. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } /// - /// Gets or sets list of ingress NatRules. + /// Gets or sets the IPSec Policies to be considered by this connection. /// - [JsonProperty(PropertyName = "properties.ingressNatRules")] - public IList IngressNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } /// - /// Gets or sets list of egress NatRules. + /// Gets or sets enableBgp flag. /// - [JsonProperty(PropertyName = "properties.egressNatRules")] - public IList EgressNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableRateLimiting")] + public bool? EnableRateLimiting {get; set; } /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. + /// Gets or sets use local azure ip to initiate connection. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useLocalAzureIpAddress")] + public bool? UseLocalAzureIPAddress {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets or sets list of ingress NatRules. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressNatRules")] + public System.Collections.Generic.IList IngressNatRules {get; set; } /// - /// Gets resource type. + /// Gets or sets list of egress NatRules. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressNatRules")] + public System.Collections.Generic.IList EgressNatRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnectionProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnectionProperties.cs new file mode 100644 index 000000000000..8d390097be7d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkConnectionProperties.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnConnection. + /// + public partial class VpnSiteLinkConnectionProperties + { + /// + /// Initializes a new instance of the VpnSiteLinkConnectionProperties class. + /// + public VpnSiteLinkConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnSiteLinkConnectionProperties class. + /// + + /// Id of the connected vpn site link. + /// + + /// Routing weight for vpn connection. + /// + + /// Vpn link connection mode. + /// Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + + /// The connection status. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' + + /// Connection protocol used for this connection. + /// Possible values include: 'IKEv2', 'IKEv1' + + /// Ingress bytes transferred. + /// + + /// Egress bytes transferred. + /// + + /// Expected bandwidth in MBPS. + /// + + /// SharedKey for the vpn connection. + /// + + /// EnableBgp flag. + /// + + /// vpnGatewayCustomBgpAddresses used by this connection. + /// + + /// Enable policy-based traffic selectors. + /// + + /// The IPSec Policies to be considered by this connection. + /// + + /// EnableBgp flag. + /// + + /// Use local azure ip to initiate connection. + /// + + /// The provisioning state of the VPN site link connection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// List of ingress NatRules. + /// + + /// List of egress NatRules. + /// + public VpnSiteLinkConnectionProperties(SubResource vpnSiteLink = default(SubResource), int? routingWeight = default(int?), string vpnLinkConnectionMode = default(string), string connectionStatus = default(string), string vpnConnectionProtocolType = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), int? connectionBandwidth = default(int?), string sharedKey = default(string), bool? enableBgp = default(bool?), System.Collections.Generic.IList vpnGatewayCustomBgpAddresses = default(System.Collections.Generic.IList), bool? usePolicyBasedTrafficSelectors = default(bool?), System.Collections.Generic.IList ipsecPolicies = default(System.Collections.Generic.IList), bool? enableRateLimiting = default(bool?), bool? useLocalAzureIPAddress = default(bool?), string provisioningState = default(string), System.Collections.Generic.IList ingressNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList egressNatRules = default(System.Collections.Generic.IList)) + + { + this.VpnSiteLink = vpnSiteLink; + this.RoutingWeight = routingWeight; + this.VpnLinkConnectionMode = vpnLinkConnectionMode; + this.ConnectionStatus = connectionStatus; + this.VpnConnectionProtocolType = vpnConnectionProtocolType; + this.IngressBytesTransferred = ingressBytesTransferred; + this.EgressBytesTransferred = egressBytesTransferred; + this.ConnectionBandwidth = connectionBandwidth; + this.SharedKey = sharedKey; + this.EnableBgp = enableBgp; + this.VpnGatewayCustomBgpAddresses = vpnGatewayCustomBgpAddresses; + this.UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + this.IpsecPolicies = ipsecPolicies; + this.EnableRateLimiting = enableRateLimiting; + this.UseLocalAzureIPAddress = useLocalAzureIPAddress; + this.ProvisioningState = provisioningState; + this.IngressNatRules = ingressNatRules; + this.EgressNatRules = egressNatRules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets id of the connected vpn site link. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnSiteLink")] + public SubResource VpnSiteLink {get; set; } + + /// + /// Gets or sets routing weight for vpn connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "routingWeight")] + public int? RoutingWeight {get; set; } + + /// + /// Gets or sets vpn link connection mode. Possible values include: 'Default', 'ResponderOnly', 'InitiatorOnly' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnLinkConnectionMode")] + public string VpnLinkConnectionMode {get; set; } + + /// + /// Gets the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus {get; private set; } + + /// + /// Gets or sets connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnConnectionProtocolType")] + public string VpnConnectionProtocolType {get; set; } + + /// + /// Gets ingress bytes transferred. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred {get; private set; } + + /// + /// Gets egress bytes transferred. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred {get; private set; } + + /// + /// Gets or sets expected bandwidth in MBPS. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionBandwidth")] + public int? ConnectionBandwidth {get; set; } + + /// + /// Gets or sets sharedKey for the vpn connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedKey")] + public string SharedKey {get; set; } + + /// + /// Gets or sets enableBgp flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBgp")] + public bool? EnableBgp {get; set; } + + /// + /// Gets or sets vpnGatewayCustomBgpAddresses used by this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnGatewayCustomBgpAddresses")] + public System.Collections.Generic.IList VpnGatewayCustomBgpAddresses {get; set; } + + /// + /// Gets or sets enable policy-based traffic selectors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usePolicyBasedTrafficSelectors")] + public bool? UsePolicyBasedTrafficSelectors {get; set; } + + /// + /// Gets or sets the IPSec Policies to be considered by this connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipsecPolicies")] + public System.Collections.Generic.IList IpsecPolicies {get; set; } + + /// + /// Gets or sets enableBgp flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableRateLimiting")] + public bool? EnableRateLimiting {get; set; } + + /// + /// Gets or sets use local azure ip to initiate connection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "useLocalAzureIpAddress")] + public bool? UseLocalAzureIPAddress {get; set; } + + /// + /// Gets the provisioning state of the VPN site link connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets list of ingress NatRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressNatRules")] + public System.Collections.Generic.IList IngressNatRules {get; set; } + + /// + /// Gets or sets list of egress NatRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "egressNatRules")] + public System.Collections.Generic.IList EgressNatRules {get; set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkProperties.cs new file mode 100644 index 000000000000..2163c15d4154 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteLinkProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnSite. + /// + public partial class VpnSiteLinkProperties + { + /// + /// Initializes a new instance of the VpnSiteLinkProperties class. + /// + public VpnSiteLinkProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnSiteLinkProperties class. + /// + + /// The link provider properties. + /// + + /// The ip-address for the vpn-site-link. + /// + + /// FQDN of vpn-site-link. + /// + + /// The set of bgp properties. + /// + + /// The provisioning state of the VPN site link resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + public VpnSiteLinkProperties(VpnLinkProviderProperties linkProperties = default(VpnLinkProviderProperties), string ipAddress = default(string), string fqdn = default(string), VpnLinkBgpSettings bgpProperties = default(VpnLinkBgpSettings), string provisioningState = default(string)) + + { + this.LinkProperties = linkProperties; + this.IPAddress = ipAddress; + this.Fqdn = fqdn; + this.BgpProperties = bgpProperties; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the link provider properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "linkProperties")] + public VpnLinkProviderProperties LinkProperties {get; set; } + + /// + /// Gets or sets the ip-address for the vpn-site-link. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } + + /// + /// Gets or sets fQDN of vpn-site-link. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } + + /// + /// Gets or sets the set of bgp properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpProperties")] + public VpnLinkBgpSettings BgpProperties {get; set; } + + /// + /// Gets the provisioning state of the VPN site link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteProperties.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteProperties.cs new file mode 100644 index 000000000000..2cfb493b3c81 --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnSiteProperties.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Parameters for VpnSite. + /// + public partial class VpnSiteProperties + { + /// + /// Initializes a new instance of the VpnSiteProperties class. + /// + public VpnSiteProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnSiteProperties class. + /// + + /// The VirtualWAN to which the vpnSite belongs. + /// + + /// The device properties. + /// + + /// The ip-address for the vpn-site. + /// + + /// The key for vpn-site that can be used for connections. + /// + + /// The AddressSpace that contains an array of IP address ranges. + /// + + /// The set of bgp properties. + /// + + /// The provisioning state of the VPN site resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// IsSecuritySite flag. + /// + + /// List of all vpn site links. + /// + + /// Office365 Policy. + /// + public VpnSiteProperties(SubResource virtualWan = default(SubResource), DeviceProperties deviceProperties = default(DeviceProperties), string ipAddress = default(string), string siteKey = default(string), AddressSpace addressSpace = default(AddressSpace), BgpSettings bgpProperties = default(BgpSettings), string provisioningState = default(string), bool? isSecuritySite = default(bool?), System.Collections.Generic.IList vpnSiteLinks = default(System.Collections.Generic.IList), O365PolicyProperties o365Policy = default(O365PolicyProperties)) + + { + this.VirtualWan = virtualWan; + this.DeviceProperties = deviceProperties; + this.IPAddress = ipAddress; + this.SiteKey = siteKey; + this.AddressSpace = addressSpace; + this.BgpProperties = bgpProperties; + this.ProvisioningState = provisioningState; + this.IsSecuritySite = isSecuritySite; + this.VpnSiteLinks = vpnSiteLinks; + this.O365Policy = o365Policy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the VirtualWAN to which the vpnSite belongs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualWan")] + public SubResource VirtualWan {get; set; } + + /// + /// Gets or sets the device properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deviceProperties")] + public DeviceProperties DeviceProperties {get; set; } + + /// + /// Gets or sets the ip-address for the vpn-site. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; set; } + + /// + /// Gets or sets the key for vpn-site that can be used for connections. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "siteKey")] + public string SiteKey {get; set; } + + /// + /// Gets or sets the AddressSpace that contains an array of IP address ranges. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "addressSpace")] + public AddressSpace AddressSpace {get; set; } + + /// + /// Gets or sets the set of bgp properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpProperties")] + public BgpSettings BgpProperties {get; set; } + + /// + /// Gets the provisioning state of the VPN site resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets isSecuritySite flag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isSecuritySite")] + public bool? IsSecuritySite {get; set; } + + /// + /// Gets or sets list of all vpn site links. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnSiteLinks")] + public System.Collections.Generic.IList VpnSiteLinks {get; set; } + + /// + /// Gets or sets office365 Policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "o365Policy")] + public O365PolicyProperties O365Policy {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + if (this.BgpProperties != null) + { + this.BgpProperties.Validate(); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/VpnType.cs b/src/Network/Network.Management.Sdk/Generated/Models/VpnType.cs index dfe32ab8f4f8..3ae9f7bd6727 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/VpnType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/VpnType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for VpnType. /// + + public static class VpnType { public const string PolicyBased = "PolicyBased"; public const string RouteBased = "RouteBased"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallAction.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallAction.cs index a0455bc3b61a..a30968b6ae62 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallAction.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallAction.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallAction. /// + + public static class WebApplicationFirewallAction { public const string Allow = "Allow"; @@ -21,4 +18,4 @@ public static class WebApplicationFirewallAction public const string Log = "Log"; public const string JSChallenge = "JSChallenge"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallCustomRule.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallCustomRule.cs index 9dd14bcbf1e1..006cf162e840 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallCustomRule.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallCustomRule.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class WebApplicationFirewallCustomRule { /// - /// Initializes a new instance of the WebApplicationFirewallCustomRule - /// class. + /// Initializes a new instance of the WebApplicationFirewallCustomRule class. /// public WebApplicationFirewallCustomRule() { @@ -31,44 +21,56 @@ public WebApplicationFirewallCustomRule() } /// - /// Initializes a new instance of the WebApplicationFirewallCustomRule - /// class. + /// Initializes a new instance of the WebApplicationFirewallCustomRule class. /// - /// Priority of the rule. Rules with a lower - /// value will be evaluated before rules with a higher value. - /// The rule type. Possible values include: - /// 'MatchRule', 'RateLimitRule', 'Invalid' - /// List of match conditions. - /// Type of Actions. Possible values include: - /// 'Allow', 'Block', 'Log', 'JSChallenge' - /// The name of the resource that is unique within a - /// policy. This name can be used to access the resource. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Describes if the custom rule is in enabled or - /// disabled state. Defaults to Enabled if not specified. Possible - /// values include: 'Disabled', 'Enabled' - /// Duration over which Rate Limit - /// policy will be applied. Applies only when ruleType is - /// RateLimitRule. Possible values include: 'OneMin', - /// 'FiveMins' - /// Rate Limit threshold to apply in - /// case ruleType is RateLimitRule. Must be greater than or equal to - /// 1 - /// List of user session identifier - /// group by clauses. - public WebApplicationFirewallCustomRule(int priority, string ruleType, IList matchConditions, string action, string name = default(string), string etag = default(string), string state = default(string), string rateLimitDuration = default(string), int? rateLimitThreshold = default(int?), IList groupByUserSession = default(IList)) + + /// The name of the resource that is unique within a policy. This name can be + /// used to access the resource. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Priority of the rule. Rules with a lower value will be evaluated before + /// rules with a higher value. + /// + + /// Describes if the custom rule is in enabled or disabled state. Defaults to + /// Enabled if not specified. + /// Possible values include: 'Disabled', 'Enabled' + + /// Duration over which Rate Limit policy will be applied. Applies only when + /// ruleType is RateLimitRule. + /// Possible values include: 'OneMin', 'FiveMins' + + /// Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be + /// greater than or equal to 1 + /// + + /// The rule type. + /// Possible values include: 'MatchRule', 'RateLimitRule', 'Invalid' + + /// List of match conditions. + /// + + /// List of user session identifier group by clauses. + /// + + /// Type of Actions. + /// Possible values include: 'Allow', 'Block', 'Log', 'JSChallenge' + public WebApplicationFirewallCustomRule(int priority, string ruleType, System.Collections.Generic.IList matchConditions, string action, string name = default(string), string etag = default(string), string state = default(string), string rateLimitDuration = default(string), int? rateLimitThreshold = default(int?), System.Collections.Generic.IList groupByUserSession = default(System.Collections.Generic.IList)) + { - Name = name; - Etag = etag; - Priority = priority; - State = state; - RateLimitDuration = rateLimitDuration; - RateLimitThreshold = rateLimitThreshold; - RuleType = ruleType; - MatchConditions = matchConditions; - GroupByUserSession = groupByUserSession; - Action = action; + this.Name = name; + this.Etag = etag; + this.Priority = priority; + this.State = state; + this.RateLimitDuration = rateLimitDuration; + this.RateLimitThreshold = rateLimitThreshold; + this.RuleType = ruleType; + this.MatchConditions = matchConditions; + this.GroupByUserSession = groupByUserSession; + this.Action = action; CustomInit(); } @@ -77,106 +79,106 @@ public WebApplicationFirewallCustomRule() /// partial void CustomInit(); + /// - /// Gets or sets the name of the resource that is unique within a - /// policy. This name can be used to access the resource. + /// Gets or sets the name of the resource that is unique within a policy. This + /// name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Gets or sets priority of the rule. Rules with a lower value will be /// evaluated before rules with a higher value. /// - [JsonProperty(PropertyName = "priority")] - public int Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public int Priority {get; set; } /// - /// Gets or sets describes if the custom rule is in enabled or disabled - /// state. Defaults to Enabled if not specified. Possible values - /// include: 'Disabled', 'Enabled' + /// Gets or sets describes if the custom rule is in enabled or disabled state. + /// Defaults to Enabled if not specified. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// - /// Gets or sets duration over which Rate Limit policy will be applied. - /// Applies only when ruleType is RateLimitRule. Possible values - /// include: 'OneMin', 'FiveMins' + /// Gets or sets duration over which Rate Limit policy will be applied. Applies + /// only when ruleType is RateLimitRule. Possible values include: 'OneMin', 'FiveMins' /// - [JsonProperty(PropertyName = "rateLimitDuration")] - public string RateLimitDuration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rateLimitDuration")] + public string RateLimitDuration {get; set; } /// /// Gets or sets rate Limit threshold to apply in case ruleType is /// RateLimitRule. Must be greater than or equal to 1 /// - [JsonProperty(PropertyName = "rateLimitThreshold")] - public int? RateLimitThreshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rateLimitThreshold")] + public int? RateLimitThreshold {get; set; } /// - /// Gets or sets the rule type. Possible values include: 'MatchRule', - /// 'RateLimitRule', 'Invalid' + /// Gets or sets the rule type. Possible values include: 'MatchRule', 'RateLimitRule', 'Invalid' /// - [JsonProperty(PropertyName = "ruleType")] - public string RuleType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleType")] + public string RuleType {get; set; } /// /// Gets or sets list of match conditions. /// - [JsonProperty(PropertyName = "matchConditions")] - public IList MatchConditions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchConditions")] + public System.Collections.Generic.IList MatchConditions {get; set; } /// /// Gets or sets list of user session identifier group by clauses. /// - [JsonProperty(PropertyName = "groupByUserSession")] - public IList GroupByUserSession { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByUserSession")] + public System.Collections.Generic.IList GroupByUserSession {get; set; } /// - /// Gets or sets type of Actions. Possible values include: 'Allow', - /// 'Block', 'Log', 'JSChallenge' + /// Gets or sets type of Actions. Possible values include: 'Allow', 'Block', 'Log', 'JSChallenge' /// - [JsonProperty(PropertyName = "action")] - public string Action { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public string Action {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleType == null) + if (this.RuleType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RuleType"); } - if (MatchConditions == null) + if (this.MatchConditions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchConditions"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MatchConditions"); } - if (Action == null) + if (this.Action == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Action"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Action"); } - if (Name != null) + if (this.Name != null) { - if (Name.Length > 128) + if (this.Name.Length > 128) { - throw new ValidationException(ValidationRules.MaxLength, "Name", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Name", 128); } } - if (MatchConditions != null) + + + + + if (this.MatchConditions != null) { - foreach (var element in MatchConditions) + foreach (var element in this.MatchConditions) { if (element != null) { @@ -184,16 +186,17 @@ public virtual void Validate() } } } - if (GroupByUserSession != null) + if (this.GroupByUserSession != null) { - foreach (var element1 in GroupByUserSession) + foreach (var element in this.GroupByUserSession) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallEnabledState.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallEnabledState.cs index 1d9e974d3575..edb29e99a0e8 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallEnabledState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallEnabledState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallEnabledState. /// + + public static class WebApplicationFirewallEnabledState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMatchVariable.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMatchVariable.cs index f84a785261dd..42cbc9d834dc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMatchVariable.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMatchVariable.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallMatchVariable. /// + + public static class WebApplicationFirewallMatchVariable { public const string RemoteAddr = "RemoteAddr"; @@ -25,4 +22,4 @@ public static class WebApplicationFirewallMatchVariable public const string RequestBody = "RequestBody"; public const string RequestCookies = "RequestCookies"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMode.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMode.cs index 75f8e00b224d..6218ee132875 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMode.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallMode. /// + + public static class WebApplicationFirewallMode { public const string Prevention = "Prevention"; public const string Detection = "Detection"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallOperator.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallOperator.cs index fe9471edcdc6..7c84f5762139 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallOperator.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallOperator.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallOperator. /// + + public static class WebApplicationFirewallOperator { public const string IPMatch = "IPMatch"; @@ -29,4 +26,4 @@ public static class WebApplicationFirewallOperator public const string GeoMatch = "GeoMatch"; public const string Any = "Any"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicy.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicy.cs index be96c86f8e8e..49d17e9429a1 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicy.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicy.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Defines web application firewall policy. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class WebApplicationFirewallPolicy : Resource { /// - /// Initializes a new instance of the WebApplicationFirewallPolicy - /// class. + /// Initializes a new instance of the WebApplicationFirewallPolicy class. /// public WebApplicationFirewallPolicy() { @@ -33,43 +22,64 @@ public WebApplicationFirewallPolicy() } /// - /// Initializes a new instance of the WebApplicationFirewallPolicy - /// class. + /// Initializes a new instance of the WebApplicationFirewallPolicy class. /// - /// Describes the managedRules - /// structure. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The PolicySettings for policy. - /// The custom rules inside the - /// policy. - /// A collection of references to - /// application gateways. - /// The provisioning state of the web - /// application firewall policy resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// Resource status of the policy. - /// A collection of references to - /// application gateway http listeners. - /// A collection of references to - /// application gateway path rules. - /// A unique read-only string that changes whenever - /// the resource is updated. - public WebApplicationFirewallPolicy(ManagedRulesDefinition managedRules, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PolicySettings policySettings = default(PolicySettings), IList customRules = default(IList), IList applicationGateways = default(IList), string provisioningState = default(string), string resourceState = default(string), IList httpListeners = default(IList), IList pathBasedRules = default(IList), string etag = default(string)) - : base(id, name, type, location, tags) + + /// Resource ID. + /// + + /// Resource name. + /// + + /// Resource type. + /// + + /// Resource location. + /// + + /// Resource tags. + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The PolicySettings for policy. + /// + + /// The provisioning state of the web application firewall policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// The custom rules inside the policy. + /// + + /// A collection of references to application gateways. + /// + + /// Resource status of the policy. + /// Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + /// 'Disabled', 'Deleting' + + /// Describes the managedRules structure. + /// + + /// A collection of references to application gateway http listeners. + /// + + /// A collection of references to application gateway path rules. + /// + public WebApplicationFirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), PolicySettings policySettings = default(PolicySettings), string provisioningState = default(string), System.Collections.Generic.IList customRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationGateways = default(System.Collections.Generic.IList), string resourceState = default(string), ManagedRulesDefinition managedRules = default(ManagedRulesDefinition), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList pathBasedRules = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - PolicySettings = policySettings; - CustomRules = customRules; - ApplicationGateways = applicationGateways; - ProvisioningState = provisioningState; - ResourceState = resourceState; - ManagedRules = managedRules; - HttpListeners = httpListeners; - PathBasedRules = pathBasedRules; - Etag = etag; + this.Etag = etag; + this.PolicySettings = policySettings; + this.ProvisioningState = provisioningState; + this.CustomRules = customRules; + this.ApplicationGateways = applicationGateways; + this.ResourceState = resourceState; + this.ManagedRules = managedRules; + this.HttpListeners = httpListeners; + this.PathBasedRules = pathBasedRules; CustomInit(); } @@ -78,87 +88,79 @@ public WebApplicationFirewallPolicy() /// partial void CustomInit(); - /// - /// Gets or sets the PolicySettings for policy. - /// - [JsonProperty(PropertyName = "properties.policySettings")] - public PolicySettings PolicySettings { get; set; } /// - /// Gets or sets the custom rules inside the policy. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "properties.customRules")] - public IList CustomRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets a collection of references to application gateways. + /// Gets or sets the PolicySettings for policy. /// - [JsonProperty(PropertyName = "properties.applicationGateways")] - public IList ApplicationGateways { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.policySettings")] + public PolicySettings PolicySettings {get; set; } /// /// Gets the provisioning state of the web application firewall policy - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets resource status of the policy. + /// Gets or sets the custom rules inside the policy. /// - /// - /// Resource status of the policy. Possible values include: 'Creating', - /// 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.resourceState")] - public string ResourceState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customRules")] + public System.Collections.Generic.IList CustomRules {get; set; } /// - /// Gets or sets describes the managedRules structure. + /// Gets a collection of references to application gateways. /// - [JsonProperty(PropertyName = "properties.managedRules")] - public ManagedRulesDefinition ManagedRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGateways")] + public System.Collections.Generic.IList ApplicationGateways {get; private set; } /// - /// Gets a collection of references to application gateway http - /// listeners. + /// Gets resource status of the policy. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' /// - [JsonProperty(PropertyName = "properties.httpListeners")] - public IList HttpListeners { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceState")] + public string ResourceState {get; private set; } /// - /// Gets a collection of references to application gateway path rules. + /// Gets or sets describes the managedRules structure. /// - [JsonProperty(PropertyName = "properties.pathBasedRules")] - public IList PathBasedRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.managedRules")] + public ManagedRulesDefinition ManagedRules {get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a collection of references to application gateway http listeners. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListeners")] + public System.Collections.Generic.IList HttpListeners {get; private set; } + /// + /// Gets a collection of references to application gateway path rules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pathBasedRules")] + public System.Collections.Generic.IList PathBasedRules {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ManagedRules == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ManagedRules"); - } - if (PolicySettings != null) + + if (this.PolicySettings != null) { - PolicySettings.Validate(); + this.PolicySettings.Validate(); } - if (CustomRules != null) + + if (this.CustomRules != null) { - foreach (var element in CustomRules) + foreach (var element in this.CustomRules) { if (element != null) { @@ -166,20 +168,23 @@ public virtual void Validate() } } } - if (ApplicationGateways != null) + if (this.ApplicationGateways != null) { - foreach (var element1 in ApplicationGateways) + foreach (var element in this.ApplicationGateways) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } - if (ManagedRules != null) + + if (this.ManagedRules != null) { - ManagedRules.Validate(); + this.ManagedRules.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyPropertiesFormat.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyPropertiesFormat.cs new file mode 100644 index 000000000000..1d786e300b7d --- /dev/null +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyPropertiesFormat.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Network.Models +{ + using System.Linq; + + /// + /// Defines web application firewall policy properties. + /// + public partial class WebApplicationFirewallPolicyPropertiesFormat + { + /// + /// Initializes a new instance of the WebApplicationFirewallPolicyPropertiesFormat class. + /// + public WebApplicationFirewallPolicyPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebApplicationFirewallPolicyPropertiesFormat class. + /// + + /// The PolicySettings for policy. + /// + + /// The custom rules inside the policy. + /// + + /// A collection of references to application gateways. + /// + + /// The provisioning state of the web application firewall policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + + /// Resource status of the policy. + /// Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + /// 'Disabled', 'Deleting' + + /// Describes the managedRules structure. + /// + + /// A collection of references to application gateway http listeners. + /// + + /// A collection of references to application gateway path rules. + /// + public WebApplicationFirewallPolicyPropertiesFormat(ManagedRulesDefinition managedRules, PolicySettings policySettings = default(PolicySettings), System.Collections.Generic.IList customRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationGateways = default(System.Collections.Generic.IList), string provisioningState = default(string), string resourceState = default(string), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList pathBasedRules = default(System.Collections.Generic.IList)) + + { + this.PolicySettings = policySettings; + this.CustomRules = customRules; + this.ApplicationGateways = applicationGateways; + this.ProvisioningState = provisioningState; + this.ResourceState = resourceState; + this.ManagedRules = managedRules; + this.HttpListeners = httpListeners; + this.PathBasedRules = pathBasedRules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the PolicySettings for policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "policySettings")] + public PolicySettings PolicySettings {get; set; } + + /// + /// Gets or sets the custom rules inside the policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customRules")] + public System.Collections.Generic.IList CustomRules {get; set; } + + /// + /// Gets a collection of references to application gateways. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationGateways")] + public System.Collections.Generic.IList ApplicationGateways {get; private set; } + + /// + /// Gets the provisioning state of the web application firewall policy + /// resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets resource status of the policy. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceState")] + public string ResourceState {get; private set; } + + /// + /// Gets or sets describes the managedRules structure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managedRules")] + public ManagedRulesDefinition ManagedRules {get; set; } + + /// + /// Gets a collection of references to application gateway http listeners. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "httpListeners")] + public System.Collections.Generic.IList HttpListeners {get; private set; } + + /// + /// Gets a collection of references to application gateway path rules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "pathBasedRules")] + public System.Collections.Generic.IList PathBasedRules {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ManagedRules == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ManagedRules"); + } + if (this.PolicySettings != null) + { + this.PolicySettings.Validate(); + } + if (this.CustomRules != null) + { + foreach (var element in this.CustomRules) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.ApplicationGateways != null) + { + foreach (var element in this.ApplicationGateways) + { + if (element != null) + { + element.Validate(); + } + } + } + + + if (this.ManagedRules != null) + { + this.ManagedRules.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyResourceState.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyResourceState.cs index 284af4104102..cccd766b1c88 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyResourceState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallPolicyResourceState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallPolicyResourceState. /// + + public static class WebApplicationFirewallPolicyResourceState { public const string Creating = "Creating"; @@ -23,4 +20,4 @@ public static class WebApplicationFirewallPolicyResourceState public const string Disabled = "Disabled"; public const string Deleting = "Deleting"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallRuleType.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallRuleType.cs index 73f038a1a5ff..4db03f2d8aa4 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallRuleType.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallRuleType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallRuleType. /// + + public static class WebApplicationFirewallRuleType { public const string MatchRule = "MatchRule"; public const string RateLimitRule = "RateLimitRule"; public const string Invalid = "Invalid"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingRules.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingRules.cs index 40ac40ad8aa0..e6f5aa33b705 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingRules.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingRules.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Network.Models public partial class WebApplicationFirewallScrubbingRules { /// - /// Initializes a new instance of the - /// WebApplicationFirewallScrubbingRules class. + /// Initializes a new instance of the WebApplicationFirewallScrubbingRules class. /// public WebApplicationFirewallScrubbingRules() { @@ -29,29 +21,31 @@ public WebApplicationFirewallScrubbingRules() } /// - /// Initializes a new instance of the - /// WebApplicationFirewallScrubbingRules class. + /// Initializes a new instance of the WebApplicationFirewallScrubbingRules class. /// - /// The variable to be scrubbed from the - /// logs. Possible values include: 'RequestHeaderNames', - /// 'RequestCookieNames', 'RequestArgNames', 'RequestPostArgNames', - /// 'RequestJSONArgNames', 'RequestIPAddress' - /// When matchVariable is a - /// collection, operate on the selector to specify which elements in - /// the collection this rule applies to. Possible values include: - /// 'Equals', 'EqualsAny' - /// When matchVariable is a collection, operator - /// used to specify which elements in the collection this rule applies - /// to. - /// Defines the state of log scrubbing rule. - /// Default value is Enabled. Possible values include: 'Enabled', - /// 'Disabled' + + /// The variable to be scrubbed from the logs. + /// Possible values include: 'RequestHeaderNames', 'RequestCookieNames', + /// 'RequestArgNames', 'RequestPostArgNames', 'RequestJSONArgNames', + /// 'RequestIPAddress' + + /// When matchVariable is a collection, operate on the selector to specify + /// which elements in the collection this rule applies to. + /// Possible values include: 'Equals', 'EqualsAny' + + /// When matchVariable is a collection, operator used to specify which elements + /// in the collection this rule applies to. + /// + + /// Defines the state of log scrubbing rule. Default value is Enabled. + /// Possible values include: 'Enabled', 'Disabled' public WebApplicationFirewallScrubbingRules(string matchVariable, string selectorMatchOperator, string selector = default(string), string state = default(string)) + { - MatchVariable = matchVariable; - SelectorMatchOperator = selectorMatchOperator; - Selector = selector; - State = state; + this.MatchVariable = matchVariable; + this.SelectorMatchOperator = selectorMatchOperator; + this.Selector = selector; + this.State = state; CustomInit(); } @@ -60,53 +54,53 @@ public WebApplicationFirewallScrubbingRules() /// partial void CustomInit(); + /// - /// Gets or sets the variable to be scrubbed from the logs. Possible - /// values include: 'RequestHeaderNames', 'RequestCookieNames', - /// 'RequestArgNames', 'RequestPostArgNames', 'RequestJSONArgNames', - /// 'RequestIPAddress' + /// Gets or sets the variable to be scrubbed from the logs. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames', 'RequestPostArgNames', 'RequestJSONArgNames', 'RequestIPAddress' /// - [JsonProperty(PropertyName = "matchVariable")] - public string MatchVariable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "matchVariable")] + public string MatchVariable {get; set; } /// - /// Gets or sets when matchVariable is a collection, operate on the - /// selector to specify which elements in the collection this rule - /// applies to. Possible values include: 'Equals', 'EqualsAny' + /// Gets or sets when matchVariable is a collection, operate on the selector to + /// specify which elements in the collection this rule applies to. Possible values include: 'Equals', 'EqualsAny' /// - [JsonProperty(PropertyName = "selectorMatchOperator")] - public string SelectorMatchOperator { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "selectorMatchOperator")] + public string SelectorMatchOperator {get; set; } /// - /// Gets or sets when matchVariable is a collection, operator used to - /// specify which elements in the collection this rule applies to. + /// Gets or sets when matchVariable is a collection, operator used to specify + /// which elements in the collection this rule applies to. /// - [JsonProperty(PropertyName = "selector")] - public string Selector { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "selector")] + public string Selector {get; set; } /// - /// Gets or sets defines the state of log scrubbing rule. Default value - /// is Enabled. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets defines the state of log scrubbing rule. Default value is + /// Enabled. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MatchVariable == null) + if (this.MatchVariable == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchVariable"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MatchVariable"); } - if (SelectorMatchOperator == null) + if (this.SelectorMatchOperator == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SelectorMatchOperator"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SelectorMatchOperator"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingState.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingState.cs index 3c39fe64ef2c..f3f0ed96eb52 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallScrubbingState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallScrubbingState. /// + + public static class WebApplicationFirewallScrubbingState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallState.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallState.cs index f5635fa7d3bf..e6ce3d23dffc 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallState.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallState. /// + + public static class WebApplicationFirewallState { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallTransform.cs b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallTransform.cs index ad870ba9e7bf..d30bf33fc96d 100644 --- a/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallTransform.cs +++ b/src/Network/Network.Management.Sdk/Generated/Models/WebApplicationFirewallTransform.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Defines values for WebApplicationFirewallTransform. /// + + public static class WebApplicationFirewallTransform { public const string Uppercase = "Uppercase"; @@ -24,4 +21,4 @@ public static class WebApplicationFirewallTransform public const string RemoveNulls = "RemoveNulls"; public const string HtmlEntityDecode = "HtmlEntityDecode"; } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperations.cs index 6359b85b9d55..7450dfbd0b12 100644 --- a/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NatGatewaysOperations operations. /// - internal partial class NatGatewaysOperations : IServiceOperations, INatGatewaysOperations + internal partial class NatGatewaysOperations : Microsoft.Rest.IServiceOperations, INatGatewaysOperations { /// /// Initializes a new instance of the NatGatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class NatGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NatGatewaysOperations(NetworkManagementClient client) + internal NatGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// The name of the nat gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, natGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, natGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (natGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("natGatewayName", natGatewayName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{natGatewayName}", System.Uri.EscapeDataString(natGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal NatGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a nat gateway. /// @@ -287,16 +292,16 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to the create or update nat gateway operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (natGatewayName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (natGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("natGatewayName", natGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{natGatewayName}", System.Uri.EscapeDataString(natGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal NatGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Nat Gateways in a subscription. /// @@ -516,13 +537,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,29 +552,38 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +593,24 @@ internal NatGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +622,56 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +681,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +695,29 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all nat gateways in a resource group. /// @@ -695,13 +730,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,35 +745,45 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal NatGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified nat gateway. /// @@ -883,10 +933,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (natGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("natGatewayName", natGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{natGatewayName}", System.Uri.EscapeDataString(natGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal NatGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a nat gateway. /// @@ -1059,13 +1125,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,46 +1140,58 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string natGatewayName, NatGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (natGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (natGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("natGatewayName", natGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{natGatewayName}", System.Uri.EscapeDataString(natGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1123,25 +1201,24 @@ internal NatGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1153,61 +1230,62 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1217,9 +1295,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1230,16 +1309,16 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1248,25 +1327,29 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Nat Gateways in a subscription. /// @@ -1279,13 +1362,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1294,51 +1377,54 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1350,55 +1436,56 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1408,9 +1495,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1421,25 +1509,29 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all nat gateways in a resource group. /// @@ -1452,13 +1544,13 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,51 +1559,54 @@ internal NatGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1523,55 +1618,56 @@ internal NatGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1677,10 @@ internal NatGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1594,24 +1691,28 @@ internal NatGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperationsExtensions.cs index 5fb1030c6d9d..a3d64a9da1b8 100644 --- a/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NatGatewaysOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NatGatewaysOperations. + /// Extension methods for NatGatewaysOperations /// public static partial class NatGatewaysOperationsExtensions { - /// - /// Deletes the specified nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - public static void Delete(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName) - { - operations.DeleteAsync(resourceGroupName, natGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, natGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified nat gateway in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Expands referenced resources. - /// - public static NatGateway Get(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, natGatewayName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + public static void Delete(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName) + { + ((INatGatewaysOperations)operations).DeleteAsync(resourceGroupName, natGatewayName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified nat gateway in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, natGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, natGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified nat gateway in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// Expands referenced resources. + /// + public static NatGateway Get(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, string expand = default(string)) + { + return ((INatGatewaysOperations)operations).GetAsync(resourceGroupName, natGatewayName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Parameters supplied to the create or update nat gateway operation. - /// - public static NatGateway CreateOrUpdate(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters) + /// + /// Gets the specified nat gateway in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, natGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + public static NatGateway CreateOrUpdate(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters) + { + return ((INatGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Parameters supplied to the create or update nat gateway operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates nat gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + public static NatGateway UpdateTags(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, TagsObject parameters) + { + return ((INatGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, natGatewayName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates nat gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Parameters supplied to update nat gateway tags. - /// - public static NatGateway UpdateTags(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, TagsObject parameters) + /// + /// Updates nat gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, natGatewayName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the Nat Gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this INatGatewaysOperations operations) + { + return ((INatGatewaysOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Updates nat gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Parameters supplied to update nat gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the Nat Gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this INatGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all nat gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this INatGatewaysOperations operations, string resourceGroupName) + { + return ((INatGatewaysOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all the Nat Gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this INatGatewaysOperations operations) + /// + /// Gets all nat gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INatGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + public static void BeginDelete(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName) + { + ((INatGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, natGatewayName).GetAwaiter().GetResult(); + } - /// - /// Gets all the Nat Gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this INatGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, natGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + public static NatGateway BeginCreateOrUpdate(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters) + { + return ((INatGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all nat gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this INatGatewaysOperations operations, string resourceGroupName) + /// + /// Creates or updates a nat gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the nat gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the Nat Gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this INatGatewaysOperations operations, string nextPageLink) + { + return ((INatGatewaysOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all nat gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INatGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the Nat Gateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this INatGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all nat gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INatGatewaysOperations operations, string nextPageLink) + { + return ((INatGatewaysOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - public static void BeginDelete(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName) + /// + /// Gets all nat gateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INatGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, natGatewayName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, natGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Parameters supplied to the create or update nat gateway operation. - /// - public static NatGateway BeginCreateOrUpdate(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a nat gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the nat gateway. - /// - /// - /// Parameters supplied to the create or update nat gateway operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INatGatewaysOperations operations, string resourceGroupName, string natGatewayName, NatGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, natGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the Nat Gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this INatGatewaysOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Nat Gateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this INatGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all nat gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INatGatewaysOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all nat gateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INatGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NatRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/NatRulesOperations.cs index 939f6da208d9..12addd9d916d 100644 --- a/src/Network/Network.Management.Sdk/Generated/NatRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NatRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NatRulesOperations operations. /// - internal partial class NatRulesOperations : IServiceOperations, INatRulesOperations + internal partial class NatRulesOperations : Microsoft.Rest.IServiceOperations, INatRulesOperations { /// /// Initializes a new instance of the NatRulesOperations class. @@ -36,13 +24,13 @@ internal partial class NatRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NatRulesOperations(NetworkManagementClient client) + internal NatRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal NatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal NatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal NatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,28 +235,31 @@ internal NatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else - /// updates the existing nat rules. + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. /// /// /// The resource group name of the VpnGateway. @@ -270,16 +274,16 @@ internal NatRulesOperations(NetworkManagementClient client) /// Parameters supplied to create or Update a Nat Rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -295,16 +299,16 @@ internal NatRulesOperations(NetworkManagementClient client) /// The name of the nat rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +326,13 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +341,52 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGateway", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGateway", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +396,24 @@ internal NatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +425,56 @@ internal NatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +484,10 @@ internal NatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,27 +498,31 @@ internal NatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else /// updates the existing nat rules. /// /// @@ -523,13 +543,13 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,52 +558,65 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (natRuleParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); - } - if (natRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("natRuleParameters", natRuleParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -593,25 +626,24 @@ internal NatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -623,61 +655,62 @@ internal NatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(natRuleParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(natRuleParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(natRuleParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -687,9 +720,10 @@ internal NatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -700,16 +734,16 @@ internal NatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -718,25 +752,29 @@ internal NatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a nat rule. /// @@ -755,10 +793,10 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -767,47 +805,59 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +867,24 @@ internal NatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +896,56 @@ internal NatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,20 +955,25 @@ internal NatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all nat rules for a particular virtual wan vpn gateway. /// @@ -931,13 +986,13 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1001,54 @@ internal NatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGatewayNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGatewayNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1060,56 @@ internal NatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1119,10 @@ internal NatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1133,28 @@ internal NatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NatRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NatRulesOperationsExtensions.cs index b5043f5ddffc..678dee52f8e9 100644 --- a/src/Network/Network.Management.Sdk/Generated/NatRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NatRulesOperationsExtensions.cs @@ -1,339 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NatRulesOperations. + /// Extension methods for NatRulesOperations /// public static partial class NatRulesOperationsExtensions { - /// - /// Retrieves the details of a nat ruleGet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static VpnGatewayNatRule Get(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName) - { - return operations.GetAsync(resourceGroupName, gatewayName, natRuleName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a nat ruleGet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else - /// updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - public static VpnGatewayNatRule CreateOrUpdate(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else - /// updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static void Delete(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName) - { - operations.DeleteAsync(resourceGroupName, gatewayName, natRuleName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a nat ruleGet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static VpnGatewayNatRule Get(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName) + { + return ((INatRulesOperations)operations).GetAsync(resourceGroupName, gatewayName, natRuleName).GetAwaiter().GetResult(); + } - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a nat ruleGet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static VpnGatewayNatRule CreateOrUpdate(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters) + { + return ((INatRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves all nat rules for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - public static IPage ListByVpnGateway(this INatRulesOperations operations, string resourceGroupName, string gatewayName) + /// + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByVpnGatewayAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static void Delete(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName) + { + ((INatRulesOperations)operations).DeleteAsync(resourceGroupName, gatewayName, natRuleName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all nat rules for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnGatewayAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnGatewayWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves all nat rules for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnGateway(this INatRulesOperations operations, string resourceGroupName, string gatewayName) + { + return ((INatRulesOperations)operations).ListByVpnGatewayAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } - /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else - /// updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - public static VpnGatewayNatRule BeginCreateOrUpdate(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters) + /// + /// Retrieves all nat rules for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnGatewayAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnGatewayWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static VpnGatewayNatRule BeginCreateOrUpdate(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters) + { + return ((INatRulesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else - /// updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a nat rule to a scalable vpn gateway if it doesn't exist else + /// updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static void BeginDelete(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName) + { + ((INatRulesOperations)operations).BeginDeleteAsync(resourceGroupName, gatewayName, natRuleName).GetAwaiter().GetResult(); + } - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static void BeginDelete(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName) - { - operations.BeginDeleteAsync(resourceGroupName, gatewayName, natRuleName).GetAwaiter().GetResult(); - } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves all nat rules for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnGatewayNext(this INatRulesOperations operations, string nextPageLink) + { + return ((INatRulesOperations)operations).ListByVpnGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all nat rules for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnGatewayNextAsync(this INatRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves all nat rules for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVpnGatewayNext(this INatRulesOperations operations, string nextPageLink) - { - return operations.ListByVpnGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all nat rules for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnGatewayNextAsync(this INatRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperations.cs index c663b8886f6e..08b60ee999a5 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkGroupsOperations operations. /// - internal partial class NetworkGroupsOperations : IServiceOperations, INetworkGroupsOperations + internal partial class NetworkGroupsOperations : Microsoft.Rest.IServiceOperations, INetworkGroupsOperations { /// /// Initializes a new instance of the NetworkGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkGroupsOperations(NetworkManagementClient client) + internal NetworkGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal NetworkGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,31 +235,32 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a network group. /// - /// - /// Parameters supplied to the specify which network group need to create - /// /// /// The name of the resource group. /// @@ -273,19 +275,22 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// + /// + /// Parameters supplied to the specify which network group need to create + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -294,53 +299,67 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, NetworkGroup parameters, string ifMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("ifMatch", ifMatch); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("ifMatch", ifMatch); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -350,33 +369,32 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (ifMatch != null) + if (this.Client.AcceptLanguage != null) { - if (_httpRequest.Headers.Contains("If-Match")) + if (_httpRequest.Headers.Contains("accept-language")) { - _httpRequest.Headers.Remove("If-Match"); + _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (Client.AcceptLanguage != null) + if (ifMatch != null) { - if (_httpRequest.Headers.Contains("accept-language")) + if (_httpRequest.Headers.Contains("If-Match")) { - _httpRequest.Headers.Remove("accept-language"); + _httpRequest.Headers.Remove("If-Match"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -388,61 +406,62 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -452,9 +471,10 @@ internal NetworkGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -465,16 +485,16 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -483,38 +503,42 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a network group. /// @@ -533,16 +557,16 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// in the background, prior to the delete. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -570,13 +594,13 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -585,61 +609,73 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -650,25 +686,24 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -680,55 +715,56 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -738,9 +774,10 @@ internal NetworkGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -751,25 +788,29 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a network group. /// @@ -793,10 +834,10 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -805,80 +846,92 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("force", force); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); - List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -890,55 +943,56 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -948,33 +1002,38 @@ internal NetworkGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists the specified network group. /// @@ -987,13 +1046,13 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1002,51 +1061,54 @@ internal NetworkGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1058,55 +1120,56 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1116,9 +1179,10 @@ internal NetworkGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1129,24 +1193,28 @@ internal NetworkGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperationsExtensions.cs index a453460e00a5..ac647e21ee73 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkGroupsOperationsExtensions.cs @@ -1,339 +1,318 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkGroupsOperations. + /// Extension methods for NetworkGroupsOperations /// public static partial class NetworkGroupsOperationsExtensions { - /// - /// Gets the specified network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - public static NetworkGroup Get(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, networkGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + public static NetworkGroup Get(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName) + { + return ((INetworkGroupsOperations)operations).GetAsync(resourceGroupName, networkManagerName, networkGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to the specify which network group need to create - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - public static NetworkGroup CreateOrUpdate(this INetworkGroupsOperations operations, NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string)) + /// + /// Gets the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + public static NetworkGroup CreateOrUpdate(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, NetworkGroup parameters, string ifMatch = default(string)) + { + return ((INetworkGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, ifMatch).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to the specify which network group need to create - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkGroupsOperations operations, NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, NetworkGroup parameters, string ifMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkGroupsDeleteHeaders Delete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?)) + { + return ((INetworkGroupsOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).GetAwaiter().GetResult(); + } - /// - /// Deletes a network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static NetworkGroupsDeleteHeaders Delete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?)) + /// + /// Deletes a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return ((INetworkGroupsOperations)operations).ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Deletes a network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } + } + /// + /// Deletes a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkGroupsDeleteHeaders BeginDelete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?)) + { + return ((INetworkGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).GetAwaiter().GetResult(); + } - /// - /// Lists the specified network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + /// + /// Deletes a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkGroupsOperations operations, string nextPageLink) + { + return ((INetworkGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists the specified network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes a network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static NetworkGroupsDeleteHeaders BeginDelete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?)) - { - return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).GetAwaiter().GetResult(); - } - - /// - /// Deletes a network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists the specified network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the specified network group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperations.cs index fffcd9c605ad..9c7cf5d842b7 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfaceIPConfigurationsOperations operations. /// - internal partial class NetworkInterfaceIPConfigurationsOperations : IServiceOperations, INetworkInterfaceIPConfigurationsOperations + internal partial class NetworkInterfaceIPConfigurationsOperations : Microsoft.Rest.IServiceOperations, INetworkInterfaceIPConfigurationsOperations { /// /// Initializes a new instance of the NetworkInterfaceIPConfigurationsOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkInterfaceIPConfigurationsOperations : IServiceOper /// /// Thrown when a required parameter is null /// - internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient client) + internal NetworkInterfaceIPConfigurationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the specified network interface ip configuration. /// @@ -262,13 +266,13 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,47 +281,59 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string ipConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (ipConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("ipConfigurationName", ipConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get all ip configurations in a network interface. /// @@ -459,13 +480,13 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperationsExtensions.cs index 188297a5c3ce..a63310038424 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceIPConfigurationsOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkInterfaceIPConfigurationsOperations. + /// Extension methods for NetworkInterfaceIPConfigurationsOperations /// public static partial class NetworkInterfaceIPConfigurationsOperationsExtensions { - /// - /// Get all ip configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static IPage List(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName) - { - return operations.ListAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); - } - - /// - /// Get all ip configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Get all ip configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfaceIPConfigurationsOperations)operations).ListAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified network interface ip configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the ip configuration name. - /// - public static NetworkInterfaceIPConfiguration Get(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string ipConfigurationName) + /// + /// Get all ip configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the specified network interface ip configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the ip configuration name. + /// + public static NetworkInterfaceIPConfiguration Get(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string ipConfigurationName) + { + return ((INetworkInterfaceIPConfigurationsOperations)operations).GetAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified network interface ip configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the ip configuration name. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string ipConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified network interface ip configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the ip configuration name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkInterfaceIPConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string ipConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, ipConfigurationName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, ipConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get all ip configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkInterfaceIPConfigurationsOperations operations, string nextPageLink) + { + return ((INetworkInterfaceIPConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Get all ip configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkInterfaceIPConfigurationsOperations operations, string nextPageLink) + /// + /// Get all ip configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkInterfaceIPConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Get all ip configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkInterfaceIPConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperations.cs index 0d23faf98902..4ba85905eabe 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfaceLoadBalancersOperations operations. /// - internal partial class NetworkInterfaceLoadBalancersOperations : IServiceOperations, INetworkInterfaceLoadBalancersOperations + internal partial class NetworkInterfaceLoadBalancersOperations : Microsoft.Rest.IServiceOperations, INetworkInterfaceLoadBalancersOperations { /// /// Initializes a new instance of the NetworkInterfaceLoadBalancersOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkInterfaceLoadBalancersOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) + internal NetworkInterfaceLoadBalancersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all load balancers in a network interface. /// @@ -256,13 +260,13 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -271,51 +275,54 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -327,55 +334,56 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -385,9 +393,10 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -398,24 +407,28 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperationsExtensions.cs index e3e094c59dfc..521b38c1a619 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceLoadBalancersOperationsExtensions.cs @@ -1,99 +1,88 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkInterfaceLoadBalancersOperations. + /// Extension methods for NetworkInterfaceLoadBalancersOperations /// public static partial class NetworkInterfaceLoadBalancersOperationsExtensions { - /// - /// List all load balancers in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static IPage List(this INetworkInterfaceLoadBalancersOperations operations, string resourceGroupName, string networkInterfaceName) - { - return operations.ListAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); - } + /// + /// List all load balancers in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkInterfaceLoadBalancersOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfaceLoadBalancersOperations)operations).ListAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// List all load balancers in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkInterfaceLoadBalancersOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all load balancers in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkInterfaceLoadBalancersOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all load balancers in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkInterfaceLoadBalancersOperations operations, string nextPageLink) + { + return ((INetworkInterfaceLoadBalancersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all load balancers in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkInterfaceLoadBalancersOperations operations, string nextPageLink) + /// + /// List all load balancers in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkInterfaceLoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all load balancers in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkInterfaceLoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperations.cs index aefb2499f5f7..cda0fd39c7bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfaceTapConfigurationsOperations operations. /// - internal partial class NetworkInterfaceTapConfigurationsOperations : IServiceOperations, INetworkInterfaceTapConfigurationsOperations + internal partial class NetworkInterfaceTapConfigurationsOperations : Microsoft.Rest.IServiceOperations, INetworkInterfaceTapConfigurationsOperations { /// /// Initializes a new instance of the NetworkInterfaceTapConfigurationsOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkInterfaceTapConfigurationsOperations : IServiceOpe /// /// Thrown when a required parameter is null /// - internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient client) + internal NetworkInterfaceTapConfigurationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// The name of the tap configuration. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (tapConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("tapConfigurationName", tapConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{tapConfigurationName}", System.Uri.EscapeDataString(tapConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Tap configuration in the specified NetworkInterface. /// @@ -294,16 +299,16 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// Parameters supplied to the create or update tap configuration operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -321,13 +326,13 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -336,41 +341,52 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -380,25 +396,24 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -410,55 +425,56 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +484,10 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,25 +498,29 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified tap configuration from the NetworkInterface. /// @@ -518,10 +539,10 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -530,47 +551,59 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (tapConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("tapConfigurationName", tapConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{tapConfigurationName}", System.Uri.EscapeDataString(tapConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -580,25 +613,24 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -610,55 +642,56 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -668,20 +701,25 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Tap configuration in the specified NetworkInterface. /// @@ -703,13 +741,13 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -718,52 +756,65 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (tapConfigurationParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapConfigurationParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (tapConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapConfigurationName"); } - if (tapConfigurationParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationParameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("tapConfigurationName", tapConfigurationName); - tracingParameters.Add("tapConfigurationParameters", tapConfigurationParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("tapConfigurationParameters", tapConfigurationParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{tapConfigurationName}", System.Uri.EscapeDataString(tapConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -773,25 +824,24 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -803,61 +853,62 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(tapConfigurationParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tapConfigurationParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(tapConfigurationParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -867,9 +918,10 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -880,16 +932,16 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -898,25 +950,29 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get all Tap configurations in a network interface. /// @@ -929,13 +985,13 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -944,51 +1000,54 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1000,55 +1059,56 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1058,9 +1118,10 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1071,24 +1132,28 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperationsExtensions.cs index 3e6e26768dbb..3f9adefe16b6 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfaceTapConfigurationsOperationsExtensions.cs @@ -1,335 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkInterfaceTapConfigurationsOperations. + /// Extension methods for NetworkInterfaceTapConfigurationsOperations /// public static partial class NetworkInterfaceTapConfigurationsOperationsExtensions { - /// - /// Deletes the specified tap configuration from the NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - public static void Delete(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName) - { - operations.DeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified tap configuration from the NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get the specified tap configuration on a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - public static NetworkInterfaceTapConfiguration Get(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName) - { - return operations.GetAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Get the specified tap configuration on a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a Tap configuration in the specified NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// Parameters supplied to the create or update tap configuration operation. - /// - public static NetworkInterfaceTapConfiguration CreateOrUpdate(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified tap configuration from the NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + public static void Delete(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName) + { + ((INetworkInterfaceTapConfigurationsOperations)operations).DeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Tap configuration in the specified NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// Parameters supplied to the create or update tap configuration operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified tap configuration from the NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get the specified tap configuration on a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + public static NetworkInterfaceTapConfiguration Get(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName) + { + return ((INetworkInterfaceTapConfigurationsOperations)operations).GetAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Get all Tap configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static IPage List(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName) + /// + /// Get the specified tap configuration on a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a Tap configuration in the specified NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + public static NetworkInterfaceTapConfiguration CreateOrUpdate(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters) + { + return ((INetworkInterfaceTapConfigurationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).GetAwaiter().GetResult(); + } - /// - /// Get all Tap configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a Tap configuration in the specified NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get all Tap configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfaceTapConfigurationsOperations)operations).ListAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified tap configuration from the NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - public static void BeginDelete(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName) + /// + /// Get all Tap configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified tap configuration from the NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + public static void BeginDelete(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName) + { + ((INetworkInterfaceTapConfigurationsOperations)operations).BeginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified tap configuration from the NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified tap configuration from the NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a Tap configuration in the specified NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + public static NetworkInterfaceTapConfiguration BeginCreateOrUpdate(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters) + { + return ((INetworkInterfaceTapConfigurationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Tap configuration in the specified NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// Parameters supplied to the create or update tap configuration operation. - /// - public static NetworkInterfaceTapConfiguration BeginCreateOrUpdate(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters) + /// + /// Creates or updates a Tap configuration in the specified NetworkInterface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the tap configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get all Tap configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkInterfaceTapConfigurationsOperations operations, string nextPageLink) + { + return ((INetworkInterfaceTapConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Tap configuration in the specified NetworkInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the tap configuration. - /// - /// - /// Parameters supplied to the create or update tap configuration operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INetworkInterfaceTapConfigurationsOperations operations, string resourceGroupName, string networkInterfaceName, string tapConfigurationName, NetworkInterfaceTapConfiguration tapConfigurationParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get all Tap configurations in a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkInterfaceTapConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Get all Tap configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkInterfaceTapConfigurationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all Tap configurations in a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkInterfaceTapConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperations.cs index c6e34acbca60..3122de8f10f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkInterfacesOperations operations. /// - internal partial class NetworkInterfacesOperations : IServiceOperations, INetworkInterfacesOperations + internal partial class NetworkInterfacesOperations : Microsoft.Rest.IServiceOperations, INetworkInterfacesOperations { /// /// Initializes a new instance of the NetworkInterfacesOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkInterfacesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkInterfacesOperations(NetworkManagementClient client) + internal NetworkInterfacesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -69,13 +57,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,47 +72,59 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServiceRoleInstanceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServiceRoleInstanceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudServiceName"); } + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleInstanceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("roleInstanceName", roleInstanceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstanceNetworkInterfaces", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstanceNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -134,25 +134,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -164,55 +163,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -222,9 +222,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -235,25 +236,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a cloud service. /// @@ -269,13 +274,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -284,41 +289,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServiceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServiceNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudServiceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceNetworkInterfaces", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -328,25 +344,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -358,55 +373,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -416,9 +432,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -429,25 +446,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified network interface in a cloud service. /// @@ -472,13 +493,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -487,54 +508,68 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetCloudServiceNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetCloudServiceNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudServiceName"); } + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleInstanceName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("roleInstanceName", roleInstanceName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetCloudServiceNetworkInterface", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCloudServiceNetworkInterface", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -548,25 +583,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -578,55 +612,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -636,9 +671,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -649,25 +685,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified network interface. /// @@ -678,16 +718,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -708,13 +748,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -723,42 +763,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -772,25 +824,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -802,55 +853,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -860,9 +912,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -873,25 +926,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a network interface. /// @@ -905,16 +962,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update network interface operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -935,13 +992,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -950,46 +1007,57 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkInterfaceName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -999,25 +1067,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1029,61 +1096,62 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1093,9 +1161,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1106,25 +1175,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a subscription. /// @@ -1134,13 +1207,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1149,29 +1222,38 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1181,25 +1263,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1211,55 +1292,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1269,9 +1351,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1282,25 +1365,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a resource group. /// @@ -1313,13 +1400,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1328,35 +1415,45 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1366,25 +1463,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1396,55 +1492,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1454,9 +1551,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1467,25 +1565,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route tables applied to a network interface. /// @@ -1496,16 +1598,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1518,16 +1620,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1549,13 +1651,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1564,47 +1666,59 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1614,25 +1728,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1644,55 +1757,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1702,9 +1816,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1715,25 +1830,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a virtual machine scale set. /// @@ -1749,13 +1868,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1764,41 +1883,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1808,25 +1938,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1838,55 +1967,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1896,9 +2026,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1909,25 +2040,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified network interface in a virtual machine scale set. /// @@ -1952,13 +2087,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1967,54 +2102,68 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2028,25 +2177,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2058,55 +2206,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2116,9 +2265,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2129,25 +2279,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified network interface ip configuration in a virtual machine /// scale set. @@ -2173,13 +2327,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2188,54 +2342,68 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetIpConfigurationsWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetIpConfigurationsWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetIpConfigurations", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetIpConfigurations", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2249,25 +2417,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2279,55 +2446,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2337,9 +2505,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2350,25 +2519,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified network interface ip configuration in a virtual machine /// scale set. @@ -2397,13 +2570,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2412,40 +2585,51 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineScaleSetIpConfigurationWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVirtualMachineScaleSetIpConfigurationWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (ipConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); @@ -2453,19 +2637,23 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) tracingParameters.Add("ipConfigurationName", ipConfigurationName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetIpConfiguration", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetIpConfiguration", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2479,25 +2667,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2509,55 +2696,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2567,9 +2755,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2580,25 +2769,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified network interface. /// @@ -2614,10 +2807,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2626,41 +2819,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2670,25 +2874,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2700,55 +2903,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2758,20 +2962,25 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a network interface. /// @@ -2790,13 +2999,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2805,46 +3014,58 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkInterfaceName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2854,25 +3075,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2884,61 +3104,62 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2948,9 +3169,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2961,16 +3183,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2979,25 +3201,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route tables applied to a network interface. /// @@ -3013,13 +3239,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3028,41 +3254,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3072,25 +3309,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3102,55 +3338,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3160,9 +3397,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3173,25 +3411,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network security groups applied to a network interface. /// @@ -3207,13 +3449,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3222,41 +3464,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3266,25 +3519,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3296,55 +3548,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3354,9 +3607,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3367,25 +3621,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all network interfaces in a role instance in a cloud /// service. @@ -3399,13 +3657,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3414,51 +3672,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServiceRoleInstanceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServiceRoleInstanceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstanceNetworkInterfacesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstanceNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3470,55 +3731,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3528,9 +3790,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3541,25 +3804,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a cloud service. /// @@ -3572,13 +3839,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3587,51 +3854,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServiceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServiceNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceNetworkInterfacesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3643,55 +3913,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3701,9 +3972,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3714,25 +3986,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a subscription. /// @@ -3745,13 +4021,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3760,51 +4036,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3816,55 +4095,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3874,9 +4154,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3887,25 +4168,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a resource group. /// @@ -3918,13 +4203,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3933,51 +4218,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3989,55 +4277,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4047,9 +4336,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4060,25 +4350,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all network interfaces in a virtual machine in a /// virtual machine scale set. @@ -4092,13 +4386,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4107,51 +4401,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfacesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4163,55 +4460,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4221,9 +4519,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4234,25 +4533,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network interfaces in a virtual machine scale set. /// @@ -4265,13 +4568,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4280,51 +4583,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfacesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4336,55 +4642,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4394,9 +4701,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4407,25 +4715,29 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified network interface ip configuration in a virtual machine /// scale set. @@ -4439,13 +4751,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4454,51 +4766,54 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetIpConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetIpConfigurationsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetIpConfigurationsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetIpConfigurationsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4510,55 +4825,56 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4568,9 +4884,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4581,24 +4898,28 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperationsExtensions.cs index aed23612e048..5bf7e29b31bb 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkInterfacesOperationsExtensions.cs @@ -1,1167 +1,1113 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkInterfacesOperations. + /// Extension methods for NetworkInterfacesOperations /// public static partial class NetworkInterfacesOperationsExtensions { - /// - /// Gets information about all network interfaces in a role instance in a cloud - /// service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The name of role instance. - /// - public static IPage ListCloudServiceRoleInstanceNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName) - { - return operations.ListCloudServiceRoleInstanceNetworkInterfacesAsync(resourceGroupName, cloudServiceName, roleInstanceName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all network interfaces in a role instance in a cloud - /// service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The name of role instance. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServiceRoleInstanceNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCloudServiceRoleInstanceNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network interfaces in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - public static IPage ListCloudServiceNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName) - { - return operations.ListCloudServiceNetworkInterfacesAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all network interfaces in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServiceNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCloudServiceNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the specified network interface in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The name of role instance. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - public static NetworkInterface GetCloudServiceNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string)) - { - return operations.GetCloudServiceNetworkInterfaceAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand).GetAwaiter().GetResult(); - } - - /// - /// Get the specified network interface in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The name of role instance. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetCloudServiceNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetCloudServiceNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static void Delete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) - { - operations.DeleteAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets information about the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - public static NetworkInterface Get(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, networkInterfaceName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets information about the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a network interface tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to update network interface tags. - /// - public static NetworkInterface UpdateTags(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a network interface tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to update network interface tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network interfaces in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this INetworkInterfacesOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all network interfaces in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this INetworkInterfacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network interfaces in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this INetworkInterfacesOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all network interfaces in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets information about all network interfaces in a role instance in a cloud + /// service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The name of role instance. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServiceRoleInstanceNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName) + { + return ((INetworkInterfacesOperations)operations).ListCloudServiceRoleInstanceNetworkInterfacesAsync(resourceGroupName, cloudServiceName, roleInstanceName).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + /// + /// Gets information about all network interfaces in a role instance in a cloud + /// service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The name of role instance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServiceRoleInstanceNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServiceRoleInstanceNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network interfaces in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServiceNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName) + { + return ((INetworkInterfacesOperations)operations).ListCloudServiceNetworkInterfacesAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network interfaces in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServiceNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServiceNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get the specified network interface in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The name of role instance. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + public static NetworkInterface GetCloudServiceNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string)) + { + return ((INetworkInterfacesOperations)operations).GetCloudServiceNetworkInterfaceAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + /// + /// Get the specified network interface in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The name of role instance. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetCloudServiceNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetCloudServiceNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static void Delete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + ((INetworkInterfacesOperations)operations).DeleteAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets information about the specified network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + public static NetworkInterface Get(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string)) + { + return ((INetworkInterfacesOperations)operations).GetAsync(resourceGroupName, networkInterfaceName, expand).GetAwaiter().GetResult(); + } - /// - /// Gets information about all network interfaces in a virtual machine in a - /// virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - public static IPage ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex) + /// + /// Gets information about the specified network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) + { + return ((INetworkInterfacesOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets information about all network interfaces in a virtual machine in a - /// virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates a network interface tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static NetworkInterface UpdateTags(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, TagsObject parameters) + { + return ((INetworkInterfacesOperations)operations).UpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all network interfaces in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - public static IPage ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) + /// + /// Updates a network interface tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network interfaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this INetworkInterfacesOperations operations) + { + return ((INetworkInterfacesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all network interfaces in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network interfaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this INetworkInterfacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network interfaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkInterfacesOperations operations, string resourceGroupName) + { + return ((INetworkInterfacesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Get the specified network interface in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - public static NetworkInterface GetVirtualMachineScaleSetNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) + /// + /// Gets all network interfaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfacesOperations)operations).GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Get the specified network interface in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfacesOperations)operations).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Get the specified network interface ip configuration in a virtual machine - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - public static IPage ListVirtualMachineScaleSetIpConfigurations(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex) + { + return ((INetworkInterfacesOperations)operations).ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).GetAwaiter().GetResult(); + } - /// - /// Get the specified network interface ip configuration in a virtual machine - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetIpConfigurationsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListVirtualMachineScaleSetIpConfigurationsWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network interfaces in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) + { + return ((INetworkInterfacesOperations)operations).ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Get the specified network interface ip configuration in a virtual machine - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the ip configuration. - /// - /// - /// Expands referenced resources. - /// - public static NetworkInterfaceIPConfiguration GetVirtualMachineScaleSetIpConfiguration(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string)) + /// + /// Gets all network interfaces in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the specified network interface in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + public static NetworkInterface GetVirtualMachineScaleSetNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) + { + return ((INetworkInterfacesOperations)operations).GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).GetAwaiter().GetResult(); + } - /// - /// Get the specified network interface ip configuration in a virtual machine - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the ip configuration. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetVirtualMachineScaleSetIpConfigurationAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the specified network interface in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetVirtualMachineScaleSetIpConfigurationWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetIpConfigurations(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) + { + return ((INetworkInterfacesOperations)operations).ListVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetIpConfigurationsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetIpConfigurationsWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the ip configuration. + /// + /// + /// Expands referenced resources. + /// + public static NetworkInterfaceIPConfiguration GetVirtualMachineScaleSetIpConfiguration(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string)) + { + return ((INetworkInterfacesOperations)operations).GetVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the ip configuration. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVirtualMachineScaleSetIpConfigurationAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVirtualMachineScaleSetIpConfigurationWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + ((INetworkInterfacesOperations)operations).BeginDeleteAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) + { + return ((INetworkInterfacesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfacesOperations)operations).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + return ((INetworkInterfacesOperations)operations).BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets information about all network interfaces in a role instance in a cloud + /// service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServiceRoleInstanceNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListCloudServiceRoleInstanceNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + /// + /// Gets information about all network interfaces in a role instance in a cloud + /// service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServiceRoleInstanceNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServiceRoleInstanceNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network interfaces in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServiceNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListCloudServiceNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network interfaces in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServiceNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServiceNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network interfaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets information about all network interfaces in a role instance in a cloud - /// service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListCloudServiceRoleInstanceNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + /// + /// Gets all network interfaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListCloudServiceRoleInstanceNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network interfaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets information about all network interfaces in a role instance in a cloud - /// service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServiceRoleInstanceNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network interfaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListCloudServiceRoleInstanceNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network interfaces in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListCloudServiceNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListCloudServiceNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network interfaces in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network interfaces in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServiceNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network interfaces in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListCloudServiceNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetIpConfigurationsNext(this INetworkInterfacesOperations operations, string nextPageLink) + { + return ((INetworkInterfacesOperations)operations).ListVirtualMachineScaleSetIpConfigurationsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network interfaces in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink) + /// + /// Get the specified network interface ip configuration in a virtual machine + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetIpConfigurationsNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetIpConfigurationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all network interfaces in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network interfaces in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all network interfaces in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all network interfaces in a virtual machine in a - /// virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all network interfaces in a virtual machine in a - /// virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network interfaces in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all network interfaces in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the specified network interface ip configuration in a virtual machine - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListVirtualMachineScaleSetIpConfigurationsNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.ListVirtualMachineScaleSetIpConfigurationsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get the specified network interface ip configuration in a virtual machine - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetIpConfigurationsNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetIpConfigurationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagementClient.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagementClient.cs index 9cf2b6838f08..56d0d9d244e2 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagementClient.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagementClient.cs @@ -1,740 +1,593 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - public partial class NetworkManagementClient : ServiceClient, INetworkManagementClient, IAzureClient + /// + /// The Microsoft Azure Network management API provides a RESTful set of web + /// services that interact with Microsoft Azure Networks service to manage your + /// network resources. The API has entities that capture the relationship + /// between an end user and the Microsoft Azure Networks service. + /// + public partial class NetworkManagementClient : Microsoft.Rest.ServiceClient, INetworkManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// The subscription credentials which uniquely identify the Microsoft Azure /// subscription. The subscription ID forms part of the URI for every service /// call. /// - public string SubscriptionId { get; set; } - - /// - /// Client API version. - /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// 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. + /// 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. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IApplicationGatewaysOperations. + /// Gets the IApplicationGatewaysOperations /// public virtual IApplicationGatewaysOperations ApplicationGateways { get; private set; } - /// - /// Gets the IApplicationGatewayPrivateLinkResourcesOperations. + /// Gets the IApplicationGatewayPrivateLinkResourcesOperations /// public virtual IApplicationGatewayPrivateLinkResourcesOperations ApplicationGatewayPrivateLinkResources { get; private set; } - /// - /// Gets the IApplicationGatewayPrivateEndpointConnectionsOperations. + /// Gets the IApplicationGatewayPrivateEndpointConnectionsOperations /// public virtual IApplicationGatewayPrivateEndpointConnectionsOperations ApplicationGatewayPrivateEndpointConnections { get; private set; } - /// - /// Gets the IApplicationGatewayWafDynamicManifestsDefaultOperations. + /// Gets the IApplicationGatewayWafDynamicManifestsDefaultOperations /// public virtual IApplicationGatewayWafDynamicManifestsDefaultOperations ApplicationGatewayWafDynamicManifestsDefault { get; private set; } - /// - /// Gets the IApplicationGatewayWafDynamicManifestsOperations. + /// Gets the IApplicationGatewayWafDynamicManifestsOperations /// public virtual IApplicationGatewayWafDynamicManifestsOperations ApplicationGatewayWafDynamicManifests { get; private set; } - /// - /// Gets the IApplicationSecurityGroupsOperations. + /// Gets the IApplicationSecurityGroupsOperations /// public virtual IApplicationSecurityGroupsOperations ApplicationSecurityGroups { get; private set; } - /// - /// Gets the IAvailableDelegationsOperations. + /// Gets the IAvailableDelegationsOperations /// public virtual IAvailableDelegationsOperations AvailableDelegations { get; private set; } - /// - /// Gets the IAvailableResourceGroupDelegationsOperations. + /// Gets the IAvailableResourceGroupDelegationsOperations /// public virtual IAvailableResourceGroupDelegationsOperations AvailableResourceGroupDelegations { get; private set; } - /// - /// Gets the IAvailableServiceAliasesOperations. + /// Gets the IAvailableServiceAliasesOperations /// public virtual IAvailableServiceAliasesOperations AvailableServiceAliases { get; private set; } - /// - /// Gets the IAzureFirewallsOperations. + /// Gets the IAzureFirewallsOperations /// public virtual IAzureFirewallsOperations AzureFirewalls { get; private set; } - /// - /// Gets the IAzureFirewallFqdnTagsOperations. + /// Gets the IAzureFirewallFqdnTagsOperations /// public virtual IAzureFirewallFqdnTagsOperations AzureFirewallFqdnTags { get; private set; } - /// - /// Gets the IWebCategoriesOperations. + /// Gets the IWebCategoriesOperations /// public virtual IWebCategoriesOperations WebCategories { get; private set; } - /// - /// Gets the IBastionHostsOperations. + /// Gets the IBastionHostsOperations /// public virtual IBastionHostsOperations BastionHosts { get; private set; } - /// - /// Gets the INetworkInterfacesOperations. + /// Gets the INetworkInterfacesOperations /// public virtual INetworkInterfacesOperations NetworkInterfaces { get; private set; } - /// - /// Gets the IPublicIPAddressesOperations. + /// Gets the IPublicIPAddressesOperations /// public virtual IPublicIPAddressesOperations PublicIPAddresses { get; private set; } - /// - /// Gets the IVipSwapOperations. + /// Gets the IVipSwapOperations /// public virtual IVipSwapOperations VipSwap { get; private set; } - /// - /// Gets the ICustomIPPrefixesOperations. + /// Gets the ICustomIPPrefixesOperations /// public virtual ICustomIPPrefixesOperations CustomIPPrefixes { get; private set; } - /// - /// Gets the IDdosCustomPoliciesOperations. + /// Gets the IDdosCustomPoliciesOperations /// public virtual IDdosCustomPoliciesOperations DdosCustomPolicies { get; private set; } - /// - /// Gets the IDdosProtectionPlansOperations. + /// Gets the IDdosProtectionPlansOperations /// public virtual IDdosProtectionPlansOperations DdosProtectionPlans { get; private set; } - /// - /// Gets the IDscpConfigurationOperations. + /// Gets the IDscpConfigurationOperations /// public virtual IDscpConfigurationOperations DscpConfiguration { get; private set; } - /// - /// Gets the IAvailableEndpointServicesOperations. + /// Gets the IAvailableEndpointServicesOperations /// public virtual IAvailableEndpointServicesOperations AvailableEndpointServices { get; private set; } - /// - /// Gets the IExpressRouteCircuitAuthorizationsOperations. + /// Gets the IExpressRouteCircuitAuthorizationsOperations /// public virtual IExpressRouteCircuitAuthorizationsOperations ExpressRouteCircuitAuthorizations { get; private set; } - /// - /// Gets the IExpressRouteCircuitPeeringsOperations. + /// Gets the IExpressRouteCircuitPeeringsOperations /// public virtual IExpressRouteCircuitPeeringsOperations ExpressRouteCircuitPeerings { get; private set; } - /// - /// Gets the IExpressRouteCircuitConnectionsOperations. + /// Gets the IExpressRouteCircuitConnectionsOperations /// public virtual IExpressRouteCircuitConnectionsOperations ExpressRouteCircuitConnections { get; private set; } - /// - /// Gets the IPeerExpressRouteCircuitConnectionsOperations. + /// Gets the IPeerExpressRouteCircuitConnectionsOperations /// public virtual IPeerExpressRouteCircuitConnectionsOperations PeerExpressRouteCircuitConnections { get; private set; } - /// - /// Gets the IExpressRouteCircuitsOperations. + /// Gets the IExpressRouteCircuitsOperations /// public virtual IExpressRouteCircuitsOperations ExpressRouteCircuits { get; private set; } - /// - /// Gets the IExpressRouteServiceProvidersOperations. + /// Gets the IExpressRouteServiceProvidersOperations /// public virtual IExpressRouteServiceProvidersOperations ExpressRouteServiceProviders { get; private set; } - /// - /// Gets the IExpressRouteCrossConnectionsOperations. + /// Gets the IExpressRouteCrossConnectionsOperations /// public virtual IExpressRouteCrossConnectionsOperations ExpressRouteCrossConnections { get; private set; } - /// - /// Gets the IExpressRouteCrossConnectionPeeringsOperations. + /// Gets the IExpressRouteCrossConnectionPeeringsOperations /// public virtual IExpressRouteCrossConnectionPeeringsOperations ExpressRouteCrossConnectionPeerings { get; private set; } - /// - /// Gets the IExpressRoutePortsLocationsOperations. + /// Gets the IExpressRoutePortsLocationsOperations /// public virtual IExpressRoutePortsLocationsOperations ExpressRoutePortsLocations { get; private set; } - /// - /// Gets the IExpressRoutePortsOperations. + /// Gets the IExpressRoutePortsOperations /// public virtual IExpressRoutePortsOperations ExpressRoutePorts { get; private set; } - /// - /// Gets the IExpressRouteLinksOperations. + /// Gets the IExpressRouteLinksOperations /// public virtual IExpressRouteLinksOperations ExpressRouteLinks { get; private set; } - /// - /// Gets the IExpressRoutePortAuthorizationsOperations. + /// Gets the IExpressRoutePortAuthorizationsOperations /// public virtual IExpressRoutePortAuthorizationsOperations ExpressRoutePortAuthorizations { get; private set; } - /// - /// Gets the IExpressRouteProviderPortsLocationOperations. + /// Gets the IExpressRouteProviderPortsLocationOperations /// public virtual IExpressRouteProviderPortsLocationOperations ExpressRouteProviderPortsLocation { get; private set; } - /// - /// Gets the IFirewallPoliciesOperations. + /// Gets the IFirewallPoliciesOperations /// public virtual IFirewallPoliciesOperations FirewallPolicies { get; private set; } - /// - /// Gets the IFirewallPolicyRuleCollectionGroupsOperations. + /// Gets the IFirewallPolicyRuleCollectionGroupsOperations /// public virtual IFirewallPolicyRuleCollectionGroupsOperations FirewallPolicyRuleCollectionGroups { get; private set; } - /// - /// Gets the IFirewallPolicyIdpsSignaturesOperations. + /// Gets the IFirewallPolicyIdpsSignaturesOperations /// public virtual IFirewallPolicyIdpsSignaturesOperations FirewallPolicyIdpsSignatures { get; private set; } - /// - /// Gets the IFirewallPolicyIdpsSignaturesOverridesOperations. + /// Gets the IFirewallPolicyIdpsSignaturesOverridesOperations /// public virtual IFirewallPolicyIdpsSignaturesOverridesOperations FirewallPolicyIdpsSignaturesOverrides { get; private set; } - /// - /// Gets the IFirewallPolicyIdpsSignaturesFilterValuesOperations. + /// Gets the IFirewallPolicyIdpsSignaturesFilterValuesOperations /// public virtual IFirewallPolicyIdpsSignaturesFilterValuesOperations FirewallPolicyIdpsSignaturesFilterValues { get; private set; } - /// - /// Gets the IIpAllocationsOperations. + /// Gets the IIPAllocationsOperations /// - public virtual IIpAllocationsOperations IpAllocations { get; private set; } - + public virtual IIPAllocationsOperations IPAllocations { get; private set; } /// - /// Gets the IIpGroupsOperations. + /// Gets the IIPGroupsOperations /// - public virtual IIpGroupsOperations IpGroups { get; private set; } - + public virtual IIPGroupsOperations IPGroups { get; private set; } /// - /// Gets the ILoadBalancersOperations. + /// Gets the ILoadBalancersOperations /// public virtual ILoadBalancersOperations LoadBalancers { get; private set; } - /// - /// Gets the ILoadBalancerBackendAddressPoolsOperations. + /// Gets the ILoadBalancerBackendAddressPoolsOperations /// public virtual ILoadBalancerBackendAddressPoolsOperations LoadBalancerBackendAddressPools { get; private set; } - /// - /// Gets the ILoadBalancerFrontendIPConfigurationsOperations. + /// Gets the ILoadBalancerFrontendIPConfigurationsOperations /// public virtual ILoadBalancerFrontendIPConfigurationsOperations LoadBalancerFrontendIPConfigurations { get; private set; } - /// - /// Gets the IInboundNatRulesOperations. + /// Gets the IInboundNatRulesOperations /// public virtual IInboundNatRulesOperations InboundNatRules { get; private set; } - /// - /// Gets the ILoadBalancerLoadBalancingRulesOperations. + /// Gets the ILoadBalancerLoadBalancingRulesOperations /// public virtual ILoadBalancerLoadBalancingRulesOperations LoadBalancerLoadBalancingRules { get; private set; } - /// - /// Gets the ILoadBalancerOutboundRulesOperations. + /// Gets the ILoadBalancerOutboundRulesOperations /// public virtual ILoadBalancerOutboundRulesOperations LoadBalancerOutboundRules { get; private set; } - /// - /// Gets the ILoadBalancerNetworkInterfacesOperations. + /// Gets the ILoadBalancerNetworkInterfacesOperations /// public virtual ILoadBalancerNetworkInterfacesOperations LoadBalancerNetworkInterfaces { get; private set; } - /// - /// Gets the ILoadBalancerProbesOperations. + /// Gets the ILoadBalancerProbesOperations /// public virtual ILoadBalancerProbesOperations LoadBalancerProbes { get; private set; } - /// - /// Gets the INatGatewaysOperations. + /// Gets the INatGatewaysOperations /// public virtual INatGatewaysOperations NatGateways { get; private set; } - /// - /// Gets the INetworkInterfaceIPConfigurationsOperations. + /// Gets the INetworkInterfaceIPConfigurationsOperations /// public virtual INetworkInterfaceIPConfigurationsOperations NetworkInterfaceIPConfigurations { get; private set; } - /// - /// Gets the INetworkInterfaceLoadBalancersOperations. + /// Gets the INetworkInterfaceLoadBalancersOperations /// public virtual INetworkInterfaceLoadBalancersOperations NetworkInterfaceLoadBalancers { get; private set; } - /// - /// Gets the INetworkInterfaceTapConfigurationsOperations. + /// Gets the INetworkInterfaceTapConfigurationsOperations /// public virtual INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; private set; } - /// - /// Gets the INetworkManagersOperations. + /// Gets the INetworkManagersOperations /// public virtual INetworkManagersOperations NetworkManagers { get; private set; } - /// - /// Gets the INetworkManagerCommitsOperations. + /// Gets the INetworkManagerCommitsOperations /// public virtual INetworkManagerCommitsOperations NetworkManagerCommits { get; private set; } - /// - /// Gets the INetworkManagerDeploymentStatusOperations. + /// Gets the INetworkManagerDeploymentStatusOperations /// public virtual INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; private set; } - /// - /// Gets the ISubscriptionNetworkManagerConnectionsOperations. + /// Gets the ISubscriptionNetworkManagerConnectionsOperations /// public virtual ISubscriptionNetworkManagerConnectionsOperations SubscriptionNetworkManagerConnections { get; private set; } - /// - /// Gets the IManagementGroupNetworkManagerConnectionsOperations. + /// Gets the IManagementGroupNetworkManagerConnectionsOperations /// public virtual IManagementGroupNetworkManagerConnectionsOperations ManagementGroupNetworkManagerConnections { get; private set; } - /// - /// Gets the IConnectivityConfigurationsOperations. + /// Gets the IConnectivityConfigurationsOperations /// public virtual IConnectivityConfigurationsOperations ConnectivityConfigurations { get; private set; } - /// - /// Gets the INetworkGroupsOperations. + /// Gets the INetworkGroupsOperations /// public virtual INetworkGroupsOperations NetworkGroups { get; private set; } - /// - /// Gets the IStaticMembersOperations. + /// Gets the IStaticMembersOperations /// public virtual IStaticMembersOperations StaticMembers { get; private set; } - /// - /// Gets the IScopeConnectionsOperations. + /// Gets the IScopeConnectionsOperations /// public virtual IScopeConnectionsOperations ScopeConnections { get; private set; } - /// - /// Gets the ISecurityAdminConfigurationsOperations. + /// Gets the ISecurityAdminConfigurationsOperations /// public virtual ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; private set; } - /// - /// Gets the IAdminRuleCollectionsOperations. + /// Gets the IAdminRuleCollectionsOperations /// public virtual IAdminRuleCollectionsOperations AdminRuleCollections { get; private set; } - /// - /// Gets the IAdminRulesOperations. + /// Gets the IAdminRulesOperations /// public virtual IAdminRulesOperations AdminRules { get; private set; } - /// - /// Gets the INetworkProfilesOperations. + /// Gets the INetworkProfilesOperations /// public virtual INetworkProfilesOperations NetworkProfiles { get; private set; } - /// - /// Gets the INetworkSecurityGroupsOperations. + /// Gets the INetworkSecurityGroupsOperations /// public virtual INetworkSecurityGroupsOperations NetworkSecurityGroups { get; private set; } - /// - /// Gets the ISecurityRulesOperations. + /// Gets the ISecurityRulesOperations /// public virtual ISecurityRulesOperations SecurityRules { get; private set; } - /// - /// Gets the IDefaultSecurityRulesOperations. + /// Gets the IDefaultSecurityRulesOperations /// public virtual IDefaultSecurityRulesOperations DefaultSecurityRules { get; private set; } - /// - /// Gets the INetworkVirtualAppliancesOperations. + /// Gets the INetworkVirtualAppliancesOperations /// public virtual INetworkVirtualAppliancesOperations NetworkVirtualAppliances { get; private set; } - /// - /// Gets the IVirtualApplianceSitesOperations. + /// Gets the IVirtualApplianceSitesOperations /// public virtual IVirtualApplianceSitesOperations VirtualApplianceSites { get; private set; } - /// - /// Gets the IVirtualApplianceSkusOperations. + /// Gets the IVirtualApplianceSkusOperations /// public virtual IVirtualApplianceSkusOperations VirtualApplianceSkus { get; private set; } - /// - /// Gets the IInboundSecurityRuleOperations. + /// Gets the IInboundSecurityRuleOperations /// public virtual IInboundSecurityRuleOperations InboundSecurityRule { get; private set; } - /// - /// Gets the INetworkWatchersOperations. + /// Gets the INetworkWatchersOperations /// public virtual INetworkWatchersOperations NetworkWatchers { get; private set; } - /// - /// Gets the IPacketCapturesOperations. + /// Gets the IPacketCapturesOperations /// public virtual IPacketCapturesOperations PacketCaptures { get; private set; } - /// - /// Gets the IConnectionMonitorsOperations. + /// Gets the IConnectionMonitorsOperations /// public virtual IConnectionMonitorsOperations ConnectionMonitors { get; private set; } - /// - /// Gets the IFlowLogsOperations. + /// Gets the IFlowLogsOperations /// public virtual IFlowLogsOperations FlowLogs { get; private set; } - /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IPrivateEndpointsOperations. + /// Gets the IPrivateEndpointsOperations /// public virtual IPrivateEndpointsOperations PrivateEndpoints { get; private set; } - /// - /// Gets the IAvailablePrivateEndpointTypesOperations. + /// Gets the IAvailablePrivateEndpointTypesOperations /// public virtual IAvailablePrivateEndpointTypesOperations AvailablePrivateEndpointTypes { get; private set; } - /// - /// Gets the IPrivateDnsZoneGroupsOperations. + /// Gets the IPrivateDnsZoneGroupsOperations /// public virtual IPrivateDnsZoneGroupsOperations PrivateDnsZoneGroups { get; private set; } - /// - /// Gets the IPrivateLinkServicesOperations. + /// Gets the IPrivateLinkServicesOperations /// public virtual IPrivateLinkServicesOperations PrivateLinkServices { get; private set; } - /// - /// Gets the IPublicIPPrefixesOperations. + /// Gets the IPublicIPPrefixesOperations /// public virtual IPublicIPPrefixesOperations PublicIPPrefixes { get; private set; } - /// - /// Gets the IRouteFiltersOperations. + /// Gets the IRouteFiltersOperations /// public virtual IRouteFiltersOperations RouteFilters { get; private set; } - /// - /// Gets the IRouteFilterRulesOperations. + /// Gets the IRouteFilterRulesOperations /// public virtual IRouteFilterRulesOperations RouteFilterRules { get; private set; } - /// - /// Gets the IRouteTablesOperations. + /// Gets the IRouteTablesOperations /// public virtual IRouteTablesOperations RouteTables { get; private set; } - /// - /// Gets the IRoutesOperations. + /// Gets the IRoutesOperations /// public virtual IRoutesOperations Routes { get; private set; } - /// - /// Gets the ISecurityPartnerProvidersOperations. + /// Gets the ISecurityPartnerProvidersOperations /// public virtual ISecurityPartnerProvidersOperations SecurityPartnerProviders { get; private set; } - /// - /// Gets the IBgpServiceCommunitiesOperations. + /// Gets the IBgpServiceCommunitiesOperations /// public virtual IBgpServiceCommunitiesOperations BgpServiceCommunities { get; private set; } - /// - /// Gets the IServiceEndpointPoliciesOperations. + /// Gets the IServiceEndpointPoliciesOperations /// public virtual IServiceEndpointPoliciesOperations ServiceEndpointPolicies { get; private set; } - /// - /// Gets the IServiceEndpointPolicyDefinitionsOperations. + /// Gets the IServiceEndpointPolicyDefinitionsOperations /// public virtual IServiceEndpointPolicyDefinitionsOperations ServiceEndpointPolicyDefinitions { get; private set; } - /// - /// Gets the IServiceTagsOperations. + /// Gets the IServiceTagsOperations /// public virtual IServiceTagsOperations ServiceTags { get; private set; } - /// - /// Gets the IServiceTagInformationOperations. + /// Gets the IServiceTagInformationOperations /// public virtual IServiceTagInformationOperations ServiceTagInformation { get; private set; } - /// - /// Gets the IUsagesOperations. + /// Gets the IUsagesOperations /// public virtual IUsagesOperations Usages { get; private set; } - /// - /// Gets the IVirtualNetworksOperations. + /// Gets the IVirtualNetworksOperations /// public virtual IVirtualNetworksOperations VirtualNetworks { get; private set; } - /// - /// Gets the ISubnetsOperations. + /// Gets the ISubnetsOperations /// public virtual ISubnetsOperations Subnets { get; private set; } - /// - /// Gets the IResourceNavigationLinksOperations. + /// Gets the IResourceNavigationLinksOperations /// public virtual IResourceNavigationLinksOperations ResourceNavigationLinks { get; private set; } - /// - /// Gets the IServiceAssociationLinksOperations. + /// Gets the IServiceAssociationLinksOperations /// public virtual IServiceAssociationLinksOperations ServiceAssociationLinks { get; private set; } - /// - /// Gets the IVirtualNetworkPeeringsOperations. + /// Gets the IVirtualNetworkPeeringsOperations /// public virtual IVirtualNetworkPeeringsOperations VirtualNetworkPeerings { get; private set; } - /// - /// Gets the IVirtualNetworkGatewaysOperations. + /// Gets the IVirtualNetworkGatewaysOperations /// public virtual IVirtualNetworkGatewaysOperations VirtualNetworkGateways { get; private set; } - /// - /// Gets the IVirtualNetworkGatewayConnectionsOperations. + /// Gets the IVirtualNetworkGatewayConnectionsOperations /// public virtual IVirtualNetworkGatewayConnectionsOperations VirtualNetworkGatewayConnections { get; private set; } - /// - /// Gets the ILocalNetworkGatewaysOperations. + /// Gets the ILocalNetworkGatewaysOperations /// public virtual ILocalNetworkGatewaysOperations LocalNetworkGateways { get; private set; } - /// - /// Gets the IVirtualNetworkGatewayNatRulesOperations. + /// Gets the IVirtualNetworkGatewayNatRulesOperations /// public virtual IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; private set; } - /// - /// Gets the IVirtualNetworkTapsOperations. + /// Gets the IVirtualNetworkTapsOperations /// public virtual IVirtualNetworkTapsOperations VirtualNetworkTaps { get; private set; } - /// - /// Gets the IVirtualRoutersOperations. + /// Gets the IVirtualRoutersOperations /// public virtual IVirtualRoutersOperations VirtualRouters { get; private set; } - /// - /// Gets the IVirtualRouterPeeringsOperations. + /// Gets the IVirtualRouterPeeringsOperations /// public virtual IVirtualRouterPeeringsOperations VirtualRouterPeerings { get; private set; } - /// - /// Gets the IVirtualWansOperations. + /// Gets the IVirtualWansOperations /// public virtual IVirtualWansOperations VirtualWans { get; private set; } - /// - /// Gets the IVpnSitesOperations. + /// Gets the IVpnSitesOperations /// public virtual IVpnSitesOperations VpnSites { get; private set; } - /// - /// Gets the IVpnSiteLinksOperations. + /// Gets the IVpnSiteLinksOperations /// public virtual IVpnSiteLinksOperations VpnSiteLinks { get; private set; } - /// - /// Gets the IVpnSitesConfigurationOperations. + /// Gets the IVpnSitesConfigurationOperations /// public virtual IVpnSitesConfigurationOperations VpnSitesConfiguration { get; private set; } - /// - /// Gets the IVpnServerConfigurationsOperations. + /// Gets the IVpnServerConfigurationsOperations /// public virtual IVpnServerConfigurationsOperations VpnServerConfigurations { get; private set; } - /// - /// Gets the IConfigurationPolicyGroupsOperations. + /// Gets the IConfigurationPolicyGroupsOperations /// public virtual IConfigurationPolicyGroupsOperations ConfigurationPolicyGroups { get; private set; } - /// - /// Gets the IVirtualHubsOperations. + /// Gets the IVirtualHubsOperations /// public virtual IVirtualHubsOperations VirtualHubs { get; private set; } - /// - /// Gets the IRouteMapsOperations. + /// Gets the IRouteMapsOperations /// public virtual IRouteMapsOperations RouteMaps { get; private set; } - /// - /// Gets the IHubVirtualNetworkConnectionsOperations. + /// Gets the IHubVirtualNetworkConnectionsOperations /// public virtual IHubVirtualNetworkConnectionsOperations HubVirtualNetworkConnections { get; private set; } - /// - /// Gets the IVpnGatewaysOperations. + /// Gets the IVpnGatewaysOperations /// public virtual IVpnGatewaysOperations VpnGateways { get; private set; } - /// - /// Gets the IVpnLinkConnectionsOperations. + /// Gets the IVpnLinkConnectionsOperations /// public virtual IVpnLinkConnectionsOperations VpnLinkConnections { get; private set; } - /// - /// Gets the IVpnConnectionsOperations. + /// Gets the IVpnConnectionsOperations /// public virtual IVpnConnectionsOperations VpnConnections { get; private set; } - /// - /// Gets the IVpnSiteLinkConnectionsOperations. + /// Gets the IVpnSiteLinkConnectionsOperations /// public virtual IVpnSiteLinkConnectionsOperations VpnSiteLinkConnections { get; private set; } - /// - /// Gets the INatRulesOperations. + /// Gets the INatRulesOperations /// public virtual INatRulesOperations NatRules { get; private set; } - /// - /// Gets the IP2sVpnGatewaysOperations. + /// Gets the IP2SVpnGatewaysOperations /// - public virtual IP2sVpnGatewaysOperations P2sVpnGateways { get; private set; } - + public virtual IP2SVpnGatewaysOperations P2SVpnGateways { get; private set; } /// - /// Gets the IVpnServerConfigurationsAssociatedWithVirtualWanOperations. + /// Gets the IVpnServerConfigurationsAssociatedWithVirtualWanOperations /// public virtual IVpnServerConfigurationsAssociatedWithVirtualWanOperations VpnServerConfigurationsAssociatedWithVirtualWan { get; private set; } - /// - /// Gets the IVirtualHubRouteTableV2sOperations. + /// Gets the IVirtualHubRouteTableV2SOperations /// - public virtual IVirtualHubRouteTableV2sOperations VirtualHubRouteTableV2s { get; private set; } - + public virtual IVirtualHubRouteTableV2SOperations VirtualHubRouteTableV2S { get; private set; } /// - /// Gets the IExpressRouteGatewaysOperations. + /// Gets the IExpressRouteGatewaysOperations /// public virtual IExpressRouteGatewaysOperations ExpressRouteGateways { get; private set; } - /// - /// Gets the IExpressRouteConnectionsOperations. + /// Gets the IExpressRouteConnectionsOperations /// public virtual IExpressRouteConnectionsOperations ExpressRouteConnections { get; private set; } - /// - /// Gets the INetworkVirtualApplianceConnectionsOperations. + /// Gets the INetworkVirtualApplianceConnectionsOperations /// public virtual INetworkVirtualApplianceConnectionsOperations NetworkVirtualApplianceConnections { get; private set; } - /// - /// Gets the IVirtualHubBgpConnectionOperations. + /// Gets the IVirtualHubBgpConnectionOperations /// public virtual IVirtualHubBgpConnectionOperations VirtualHubBgpConnection { get; private set; } - /// - /// Gets the IVirtualHubBgpConnectionsOperations. + /// Gets the IVirtualHubBgpConnectionsOperations /// public virtual IVirtualHubBgpConnectionsOperations VirtualHubBgpConnections { get; private set; } - /// - /// Gets the IVirtualHubIpConfigurationOperations. + /// Gets the IVirtualHubIPConfigurationOperations /// - public virtual IVirtualHubIpConfigurationOperations VirtualHubIpConfiguration { get; private set; } - + public virtual IVirtualHubIPConfigurationOperations VirtualHubIPConfiguration { get; private set; } /// - /// Gets the IHubRouteTablesOperations. + /// Gets the IHubRouteTablesOperations /// public virtual IHubRouteTablesOperations HubRouteTables { get; private set; } - /// - /// Gets the IRoutingIntentOperations. + /// Gets the IRoutingIntentOperations /// public virtual IRoutingIntentOperations RoutingIntent { get; private set; } - /// - /// Gets the IWebApplicationFirewallPoliciesOperations. + /// Gets the IWebApplicationFirewallPoliciesOperations /// public virtual IWebApplicationFirewallPoliciesOperations WebApplicationFirewallPolicies { get; private set; } - /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -743,24 +596,22 @@ public partial class NetworkManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling NetworkManagementClient.Dispose(). False: will not dispose provided httpClient - protected NetworkManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected NetworkManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the NetworkManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected NetworkManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the NetworkManagementClient class. + /// Initializes a new instance of the NetworkManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -768,11 +619,10 @@ protected NetworkManagementClient(params DelegatingHandler[] handlers) : base(ha /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected NetworkManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -785,15 +635,14 @@ protected NetworkManagementClient(HttpClientHandler rootHandler, params Delegati /// /// Thrown when a required parameter is null /// - protected NetworkManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected NetworkManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -809,15 +658,15 @@ protected NetworkManagementClient(System.Uri baseUri, params DelegatingHandler[] /// /// Thrown when a required parameter is null /// - protected NetworkManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected NetworkManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -830,23 +679,23 @@ protected NetworkManagementClient(System.Uri baseUri, HttpClientHandler rootHand /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the NetworkManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -857,23 +706,23 @@ public NetworkManagementClient(ServiceClientCredentials credentials, params Dele /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the NetworkManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -885,26 +734,26 @@ public NetworkManagementClient(ServiceClientCredentials credentials, HttpClient /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the NetworkManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -913,7 +762,7 @@ public NetworkManagementClient(ServiceClientCredentials credentials, HttpClientH /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -923,33 +772,30 @@ public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials cred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the NetworkManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -959,198 +805,199 @@ public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials cred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - ApplicationGateways = new ApplicationGatewaysOperations(this); - ApplicationGatewayPrivateLinkResources = new ApplicationGatewayPrivateLinkResourcesOperations(this); - ApplicationGatewayPrivateEndpointConnections = new ApplicationGatewayPrivateEndpointConnectionsOperations(this); - ApplicationGatewayWafDynamicManifestsDefault = new ApplicationGatewayWafDynamicManifestsDefaultOperations(this); - ApplicationGatewayWafDynamicManifests = new ApplicationGatewayWafDynamicManifestsOperations(this); - ApplicationSecurityGroups = new ApplicationSecurityGroupsOperations(this); - AvailableDelegations = new AvailableDelegationsOperations(this); - AvailableResourceGroupDelegations = new AvailableResourceGroupDelegationsOperations(this); - AvailableServiceAliases = new AvailableServiceAliasesOperations(this); - AzureFirewalls = new AzureFirewallsOperations(this); - AzureFirewallFqdnTags = new AzureFirewallFqdnTagsOperations(this); - WebCategories = new WebCategoriesOperations(this); - BastionHosts = new BastionHostsOperations(this); - NetworkInterfaces = new NetworkInterfacesOperations(this); - PublicIPAddresses = new PublicIPAddressesOperations(this); - VipSwap = new VipSwapOperations(this); - CustomIPPrefixes = new CustomIPPrefixesOperations(this); - DdosCustomPolicies = new DdosCustomPoliciesOperations(this); - DdosProtectionPlans = new DdosProtectionPlansOperations(this); - DscpConfiguration = new DscpConfigurationOperations(this); - AvailableEndpointServices = new AvailableEndpointServicesOperations(this); - ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); - ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); - ExpressRouteCircuitConnections = new ExpressRouteCircuitConnectionsOperations(this); - PeerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsOperations(this); - ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); - ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); - ExpressRouteCrossConnections = new ExpressRouteCrossConnectionsOperations(this); - ExpressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsOperations(this); - ExpressRoutePortsLocations = new ExpressRoutePortsLocationsOperations(this); - ExpressRoutePorts = new ExpressRoutePortsOperations(this); - ExpressRouteLinks = new ExpressRouteLinksOperations(this); - ExpressRoutePortAuthorizations = new ExpressRoutePortAuthorizationsOperations(this); - ExpressRouteProviderPortsLocation = new ExpressRouteProviderPortsLocationOperations(this); - FirewallPolicies = new FirewallPoliciesOperations(this); - FirewallPolicyRuleCollectionGroups = new FirewallPolicyRuleCollectionGroupsOperations(this); - FirewallPolicyIdpsSignatures = new FirewallPolicyIdpsSignaturesOperations(this); - FirewallPolicyIdpsSignaturesOverrides = new FirewallPolicyIdpsSignaturesOverridesOperations(this); - FirewallPolicyIdpsSignaturesFilterValues = new FirewallPolicyIdpsSignaturesFilterValuesOperations(this); - IpAllocations = new IpAllocationsOperations(this); - IpGroups = new IpGroupsOperations(this); - LoadBalancers = new LoadBalancersOperations(this); - LoadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsOperations(this); - LoadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsOperations(this); - InboundNatRules = new InboundNatRulesOperations(this); - LoadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesOperations(this); - LoadBalancerOutboundRules = new LoadBalancerOutboundRulesOperations(this); - LoadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesOperations(this); - LoadBalancerProbes = new LoadBalancerProbesOperations(this); - NatGateways = new NatGatewaysOperations(this); - NetworkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsOperations(this); - NetworkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersOperations(this); - NetworkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsOperations(this); - NetworkManagers = new NetworkManagersOperations(this); - NetworkManagerCommits = new NetworkManagerCommitsOperations(this); - NetworkManagerDeploymentStatus = new NetworkManagerDeploymentStatusOperations(this); - SubscriptionNetworkManagerConnections = new SubscriptionNetworkManagerConnectionsOperations(this); - ManagementGroupNetworkManagerConnections = new ManagementGroupNetworkManagerConnectionsOperations(this); - ConnectivityConfigurations = new ConnectivityConfigurationsOperations(this); - NetworkGroups = new NetworkGroupsOperations(this); - StaticMembers = new StaticMembersOperations(this); - ScopeConnections = new ScopeConnectionsOperations(this); - SecurityAdminConfigurations = new SecurityAdminConfigurationsOperations(this); - AdminRuleCollections = new AdminRuleCollectionsOperations(this); - AdminRules = new AdminRulesOperations(this); - NetworkProfiles = new NetworkProfilesOperations(this); - NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); - SecurityRules = new SecurityRulesOperations(this); - DefaultSecurityRules = new DefaultSecurityRulesOperations(this); - NetworkVirtualAppliances = new NetworkVirtualAppliancesOperations(this); - VirtualApplianceSites = new VirtualApplianceSitesOperations(this); - VirtualApplianceSkus = new VirtualApplianceSkusOperations(this); - InboundSecurityRule = new InboundSecurityRuleOperations(this); - NetworkWatchers = new NetworkWatchersOperations(this); - PacketCaptures = new PacketCapturesOperations(this); - ConnectionMonitors = new ConnectionMonitorsOperations(this); - FlowLogs = new FlowLogsOperations(this); - Operations = new Operations(this); - PrivateEndpoints = new PrivateEndpointsOperations(this); - AvailablePrivateEndpointTypes = new AvailablePrivateEndpointTypesOperations(this); - PrivateDnsZoneGroups = new PrivateDnsZoneGroupsOperations(this); - PrivateLinkServices = new PrivateLinkServicesOperations(this); - PublicIPPrefixes = new PublicIPPrefixesOperations(this); - RouteFilters = new RouteFiltersOperations(this); - RouteFilterRules = new RouteFilterRulesOperations(this); - RouteTables = new RouteTablesOperations(this); - Routes = new RoutesOperations(this); - SecurityPartnerProviders = new SecurityPartnerProvidersOperations(this); - BgpServiceCommunities = new BgpServiceCommunitiesOperations(this); - ServiceEndpointPolicies = new ServiceEndpointPoliciesOperations(this); - ServiceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsOperations(this); - ServiceTags = new ServiceTagsOperations(this); - ServiceTagInformation = new ServiceTagInformationOperations(this); - Usages = new UsagesOperations(this); - VirtualNetworks = new VirtualNetworksOperations(this); - Subnets = new SubnetsOperations(this); - ResourceNavigationLinks = new ResourceNavigationLinksOperations(this); - ServiceAssociationLinks = new ServiceAssociationLinksOperations(this); - VirtualNetworkPeerings = new VirtualNetworkPeeringsOperations(this); - VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); - VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); - LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); - VirtualNetworkGatewayNatRules = new VirtualNetworkGatewayNatRulesOperations(this); - VirtualNetworkTaps = new VirtualNetworkTapsOperations(this); - VirtualRouters = new VirtualRoutersOperations(this); - VirtualRouterPeerings = new VirtualRouterPeeringsOperations(this); - VirtualWans = new VirtualWansOperations(this); - VpnSites = new VpnSitesOperations(this); - VpnSiteLinks = new VpnSiteLinksOperations(this); - VpnSitesConfiguration = new VpnSitesConfigurationOperations(this); - VpnServerConfigurations = new VpnServerConfigurationsOperations(this); - ConfigurationPolicyGroups = new ConfigurationPolicyGroupsOperations(this); - VirtualHubs = new VirtualHubsOperations(this); - RouteMaps = new RouteMapsOperations(this); - HubVirtualNetworkConnections = new HubVirtualNetworkConnectionsOperations(this); - VpnGateways = new VpnGatewaysOperations(this); - VpnLinkConnections = new VpnLinkConnectionsOperations(this); - VpnConnections = new VpnConnectionsOperations(this); - VpnSiteLinkConnections = new VpnSiteLinkConnectionsOperations(this); - NatRules = new NatRulesOperations(this); - P2sVpnGateways = new P2sVpnGatewaysOperations(this); - VpnServerConfigurationsAssociatedWithVirtualWan = new VpnServerConfigurationsAssociatedWithVirtualWanOperations(this); - VirtualHubRouteTableV2s = new VirtualHubRouteTableV2sOperations(this); - ExpressRouteGateways = new ExpressRouteGatewaysOperations(this); - ExpressRouteConnections = new ExpressRouteConnectionsOperations(this); - NetworkVirtualApplianceConnections = new NetworkVirtualApplianceConnectionsOperations(this); - VirtualHubBgpConnection = new VirtualHubBgpConnectionOperations(this); - VirtualHubBgpConnections = new VirtualHubBgpConnectionsOperations(this); - VirtualHubIpConfiguration = new VirtualHubIpConfigurationOperations(this); - HubRouteTables = new HubRouteTablesOperations(this); - RoutingIntent = new RoutingIntentOperations(this); - WebApplicationFirewallPolicies = new WebApplicationFirewallPoliciesOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.ApplicationGateways = new ApplicationGatewaysOperations(this); + this.ApplicationGatewayPrivateLinkResources = new ApplicationGatewayPrivateLinkResourcesOperations(this); + this.ApplicationGatewayPrivateEndpointConnections = new ApplicationGatewayPrivateEndpointConnectionsOperations(this); + this.ApplicationGatewayWafDynamicManifestsDefault = new ApplicationGatewayWafDynamicManifestsDefaultOperations(this); + this.ApplicationGatewayWafDynamicManifests = new ApplicationGatewayWafDynamicManifestsOperations(this); + this.ApplicationSecurityGroups = new ApplicationSecurityGroupsOperations(this); + this.AvailableDelegations = new AvailableDelegationsOperations(this); + this.AvailableResourceGroupDelegations = new AvailableResourceGroupDelegationsOperations(this); + this.AvailableServiceAliases = new AvailableServiceAliasesOperations(this); + this.AzureFirewalls = new AzureFirewallsOperations(this); + this.AzureFirewallFqdnTags = new AzureFirewallFqdnTagsOperations(this); + this.WebCategories = new WebCategoriesOperations(this); + this.BastionHosts = new BastionHostsOperations(this); + this.NetworkInterfaces = new NetworkInterfacesOperations(this); + this.PublicIPAddresses = new PublicIPAddressesOperations(this); + this.VipSwap = new VipSwapOperations(this); + this.CustomIPPrefixes = new CustomIPPrefixesOperations(this); + this.DdosCustomPolicies = new DdosCustomPoliciesOperations(this); + this.DdosProtectionPlans = new DdosProtectionPlansOperations(this); + this.DscpConfiguration = new DscpConfigurationOperations(this); + this.AvailableEndpointServices = new AvailableEndpointServicesOperations(this); + this.ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); + this.ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); + this.ExpressRouteCircuitConnections = new ExpressRouteCircuitConnectionsOperations(this); + this.PeerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsOperations(this); + this.ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); + this.ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); + this.ExpressRouteCrossConnections = new ExpressRouteCrossConnectionsOperations(this); + this.ExpressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsOperations(this); + this.ExpressRoutePortsLocations = new ExpressRoutePortsLocationsOperations(this); + this.ExpressRoutePorts = new ExpressRoutePortsOperations(this); + this.ExpressRouteLinks = new ExpressRouteLinksOperations(this); + this.ExpressRoutePortAuthorizations = new ExpressRoutePortAuthorizationsOperations(this); + this.ExpressRouteProviderPortsLocation = new ExpressRouteProviderPortsLocationOperations(this); + this.FirewallPolicies = new FirewallPoliciesOperations(this); + this.FirewallPolicyRuleCollectionGroups = new FirewallPolicyRuleCollectionGroupsOperations(this); + this.FirewallPolicyIdpsSignatures = new FirewallPolicyIdpsSignaturesOperations(this); + this.FirewallPolicyIdpsSignaturesOverrides = new FirewallPolicyIdpsSignaturesOverridesOperations(this); + this.FirewallPolicyIdpsSignaturesFilterValues = new FirewallPolicyIdpsSignaturesFilterValuesOperations(this); + this.IPAllocations = new IPAllocationsOperations(this); + this.IPGroups = new IPGroupsOperations(this); + this.LoadBalancers = new LoadBalancersOperations(this); + this.LoadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsOperations(this); + this.LoadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsOperations(this); + this.InboundNatRules = new InboundNatRulesOperations(this); + this.LoadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesOperations(this); + this.LoadBalancerOutboundRules = new LoadBalancerOutboundRulesOperations(this); + this.LoadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesOperations(this); + this.LoadBalancerProbes = new LoadBalancerProbesOperations(this); + this.NatGateways = new NatGatewaysOperations(this); + this.NetworkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsOperations(this); + this.NetworkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersOperations(this); + this.NetworkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsOperations(this); + this.NetworkManagers = new NetworkManagersOperations(this); + this.NetworkManagerCommits = new NetworkManagerCommitsOperations(this); + this.NetworkManagerDeploymentStatus = new NetworkManagerDeploymentStatusOperations(this); + this.SubscriptionNetworkManagerConnections = new SubscriptionNetworkManagerConnectionsOperations(this); + this.ManagementGroupNetworkManagerConnections = new ManagementGroupNetworkManagerConnectionsOperations(this); + this.ConnectivityConfigurations = new ConnectivityConfigurationsOperations(this); + this.NetworkGroups = new NetworkGroupsOperations(this); + this.StaticMembers = new StaticMembersOperations(this); + this.ScopeConnections = new ScopeConnectionsOperations(this); + this.SecurityAdminConfigurations = new SecurityAdminConfigurationsOperations(this); + this.AdminRuleCollections = new AdminRuleCollectionsOperations(this); + this.AdminRules = new AdminRulesOperations(this); + this.NetworkProfiles = new NetworkProfilesOperations(this); + this.NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); + this.SecurityRules = new SecurityRulesOperations(this); + this.DefaultSecurityRules = new DefaultSecurityRulesOperations(this); + this.NetworkVirtualAppliances = new NetworkVirtualAppliancesOperations(this); + this.VirtualApplianceSites = new VirtualApplianceSitesOperations(this); + this.VirtualApplianceSkus = new VirtualApplianceSkusOperations(this); + this.InboundSecurityRule = new InboundSecurityRuleOperations(this); + this.NetworkWatchers = new NetworkWatchersOperations(this); + this.PacketCaptures = new PacketCapturesOperations(this); + this.ConnectionMonitors = new ConnectionMonitorsOperations(this); + this.FlowLogs = new FlowLogsOperations(this); + this.Operations = new Operations(this); + this.PrivateEndpoints = new PrivateEndpointsOperations(this); + this.AvailablePrivateEndpointTypes = new AvailablePrivateEndpointTypesOperations(this); + this.PrivateDnsZoneGroups = new PrivateDnsZoneGroupsOperations(this); + this.PrivateLinkServices = new PrivateLinkServicesOperations(this); + this.PublicIPPrefixes = new PublicIPPrefixesOperations(this); + this.RouteFilters = new RouteFiltersOperations(this); + this.RouteFilterRules = new RouteFilterRulesOperations(this); + this.RouteTables = new RouteTablesOperations(this); + this.Routes = new RoutesOperations(this); + this.SecurityPartnerProviders = new SecurityPartnerProvidersOperations(this); + this.BgpServiceCommunities = new BgpServiceCommunitiesOperations(this); + this.ServiceEndpointPolicies = new ServiceEndpointPoliciesOperations(this); + this.ServiceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsOperations(this); + this.ServiceTags = new ServiceTagsOperations(this); + this.ServiceTagInformation = new ServiceTagInformationOperations(this); + this.Usages = new UsagesOperations(this); + this.VirtualNetworks = new VirtualNetworksOperations(this); + this.Subnets = new SubnetsOperations(this); + this.ResourceNavigationLinks = new ResourceNavigationLinksOperations(this); + this.ServiceAssociationLinks = new ServiceAssociationLinksOperations(this); + this.VirtualNetworkPeerings = new VirtualNetworkPeeringsOperations(this); + this.VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); + this.VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); + this.LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); + this.VirtualNetworkGatewayNatRules = new VirtualNetworkGatewayNatRulesOperations(this); + this.VirtualNetworkTaps = new VirtualNetworkTapsOperations(this); + this.VirtualRouters = new VirtualRoutersOperations(this); + this.VirtualRouterPeerings = new VirtualRouterPeeringsOperations(this); + this.VirtualWans = new VirtualWansOperations(this); + this.VpnSites = new VpnSitesOperations(this); + this.VpnSiteLinks = new VpnSiteLinksOperations(this); + this.VpnSitesConfiguration = new VpnSitesConfigurationOperations(this); + this.VpnServerConfigurations = new VpnServerConfigurationsOperations(this); + this.ConfigurationPolicyGroups = new ConfigurationPolicyGroupsOperations(this); + this.VirtualHubs = new VirtualHubsOperations(this); + this.RouteMaps = new RouteMapsOperations(this); + this.HubVirtualNetworkConnections = new HubVirtualNetworkConnectionsOperations(this); + this.VpnGateways = new VpnGatewaysOperations(this); + this.VpnLinkConnections = new VpnLinkConnectionsOperations(this); + this.VpnConnections = new VpnConnectionsOperations(this); + this.VpnSiteLinkConnections = new VpnSiteLinkConnectionsOperations(this); + this.NatRules = new NatRulesOperations(this); + this.P2SVpnGateways = new P2SVpnGatewaysOperations(this); + this.VpnServerConfigurationsAssociatedWithVirtualWan = new VpnServerConfigurationsAssociatedWithVirtualWanOperations(this); + this.VirtualHubRouteTableV2S = new VirtualHubRouteTableV2SOperations(this); + this.ExpressRouteGateways = new ExpressRouteGatewaysOperations(this); + this.ExpressRouteConnections = new ExpressRouteConnectionsOperations(this); + this.NetworkVirtualApplianceConnections = new NetworkVirtualApplianceConnectionsOperations(this); + this.VirtualHubBgpConnection = new VirtualHubBgpConnectionOperations(this); + this.VirtualHubBgpConnections = new VirtualHubBgpConnectionsOperations(this); + this.VirtualHubIPConfiguration = new VirtualHubIPConfigurationOperations(this); + this.HubRouteTables = new HubRouteTablesOperations(this); + this.RoutingIntent = new RoutingIntentOperations(this); + this.WebApplicationFirewallPolicies = new WebApplicationFirewallPoliciesOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleCollectionType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleCollectionType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("ruleCollectionType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("ruleCollectionType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("ruleType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("ruleType")); CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// /// Creates a Bastion Shareable Links for all the VMs specified in the request. @@ -1165,21 +1012,20 @@ private void Initialize() /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> PutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> PutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginPutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse> _response = await BeginPutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the Bastion Shareable Links for all the VMs specified in the - /// request. + /// Deletes the Bastion Shareable Links for all the VMs specified in the request. /// /// /// The name of the resource group. @@ -1191,21 +1037,20 @@ private void Initialize() /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the Bastion Shareable Links for all the tokens specified in the - /// request. + /// Deletes the Bastion Shareable Links for all the tokens specified in the request. /// /// /// The name of the resource group. @@ -1217,16 +1062,16 @@ private void Initialize() /// Post request for Delete Bastion Shareable Link By Token endpoint. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslTokenRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslTokenRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1248,13 +1093,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1263,46 +1108,58 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> GetBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (bslRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bslRequest"); } - if (bastionHostName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (SubscriptionId == null) + + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (bslRequest == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("bslRequest", bslRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBastionShareableLink", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetBastionShareableLink", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1312,25 +1169,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1342,61 +1198,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(bslRequest != null) { - _requestContent = SafeJsonConvert.SerializeObject(bslRequest, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(bslRequest, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1406,9 +1263,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1419,25 +1277,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns the list of currently active sessions on the Bastion. /// @@ -1448,16 +1310,16 @@ private void Initialize() /// The name of the Bastion Host. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> GetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginGetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse> _response = await BeginGetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1478,13 +1340,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1493,46 +1355,58 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> DisconnectActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, SessionIds sessionIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> DisconnectActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, SessionIds sessionIds, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (sessionIds == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sessionIds"); } - if (bastionHostName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (SubscriptionId == null) + + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (sessionIds == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sessionIds"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("sessionIds", sessionIds); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DisconnectActiveSessions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DisconnectActiveSessions", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1542,25 +1416,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1572,61 +1445,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(sessionIds != null) { - _requestContent = SafeJsonConvert.SerializeObject(sessionIds, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(sessionIds, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1636,9 +1510,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1649,25 +1524,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Checks whether a domain name in the cloudapp.azure.com zone is available /// for use. @@ -1685,13 +1564,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1700,40 +1579,51 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } + if (domainNameLabel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainNameLabel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "domainNameLabel"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("domainNameLabel", domainNameLabel); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (domainNameLabel != null) { _queryParameters.Add(string.Format("domainNameLabel={0}", System.Uri.EscapeDataString(domainNameLabel))); @@ -1747,25 +1637,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1777,55 +1666,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1835,9 +1725,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1848,25 +1739,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves detail of a provider port. /// @@ -1879,13 +1774,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1894,35 +1789,45 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> ExpressRouteProviderPortMethodWithHttpMessagesAsync(string providerport, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExpressRouteProviderPortWithHttpMessagesAsync(string providerport, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (providerport == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "providerport"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerport"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("providerport", providerport); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ExpressRouteProviderPortMethod", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ExpressRouteProviderPort", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}").ToString(); _url = _url.Replace("{providerport}", System.Uri.EscapeDataString(providerport)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1932,25 +1837,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1962,55 +1866,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2020,9 +1925,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2033,31 +1939,32 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists active connectivity configurations in a network manager. /// - /// - /// Active Configuration Parameter. - /// /// /// The name of the resource group. /// @@ -2068,19 +1975,22 @@ private void Initialize() /// An optional query parameter which specifies the maximum number of records /// to be returned by the server. /// + /// + /// Active Configuration Parameter. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2089,90 +1999,101 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> ListActiveConnectivityConfigurationsWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListActiveConnectivityConfigurationsWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("top", top); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListActiveConnectivityConfigurations", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListActiveConnectivityConfigurations", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(top, SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2184,61 +2105,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2248,9 +2170,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2261,31 +2184,32 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists active security admin rules in a network manager. /// - /// - /// Active Configuration Parameter. - /// /// /// The name of the resource group. /// @@ -2296,19 +2220,22 @@ private void Initialize() /// An optional query parameter which specifies the maximum number of records /// to be returned by the server. /// + /// + /// Active Configuration Parameter. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2317,90 +2244,101 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> ListActiveSecurityAdminRulesWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListActiveSecurityAdminRulesWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("top", top); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListActiveSecurityAdminRules", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListActiveSecurityAdminRules", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(top, SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2412,61 +2350,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2476,9 +2415,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2489,32 +2429,33 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all effective connectivity configurations applied on a virtual /// network. /// - /// - /// Parameters supplied to list correct page. - /// /// /// The name of the resource group. /// @@ -2525,19 +2466,22 @@ private void Initialize() /// An optional query parameter which specifies the maximum number of records /// to be returned by the server. /// + /// + /// Parameters supplied to list correct page. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2546,90 +2490,101 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkManagerEffectiveConnectivityConfigurations", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNetworkManagerEffectiveConnectivityConfigurations", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(top, SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2641,61 +2596,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2705,9 +2661,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2718,31 +2675,32 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all effective security admin rules applied on a virtual network. /// - /// - /// Parameters supplied to list correct page. - /// /// /// The name of the resource group. /// @@ -2753,19 +2711,22 @@ private void Initialize() /// An optional query parameter which specifies the maximum number of records /// to be returned by the server. /// + /// + /// Parameters supplied to list correct page. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2774,90 +2735,101 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkManagerEffectiveSecurityAdminRules", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNetworkManagerEffectiveSecurityAdminRules", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(top, SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2869,61 +2841,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2933,9 +2906,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2946,25 +2920,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gives the supported security providers for the virtual wan. /// @@ -2981,13 +2959,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2996,41 +2974,52 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> SupportedSecurityProvidersWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SupportedSecurityProvidersWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (SubscriptionId == null) + + + + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SupportedSecurityProviders", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "SupportedSecurityProviders", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3040,25 +3029,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3070,55 +3058,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3128,9 +3117,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3141,29 +3131,31 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified resource - /// group. + /// Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. /// /// /// The resource group name. @@ -3177,16 +3169,16 @@ private void Initialize() /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -3207,13 +3199,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3222,46 +3214,58 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> BeginPutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> BeginPutBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (bslRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bslRequest"); } - if (bastionHostName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (SubscriptionId == null) + + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (bslRequest == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("bslRequest", bslRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPutBastionShareableLink", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPutBastionShareableLink", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3271,25 +3275,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3301,61 +3304,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(bslRequest != null) { - _requestContent = SafeJsonConvert.SerializeObject(bslRequest, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(bslRequest, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3365,9 +3369,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3378,25 +3383,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the Bastion Shareable Links for all the VMs specified in the /// request. @@ -3416,10 +3425,10 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3428,46 +3437,58 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteBastionShareableLinkWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (bslRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bslRequest"); } - if (bastionHostName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (SubscriptionId == null) + + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (bslRequest == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("bslRequest", bslRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteBastionShareableLink", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteBastionShareableLink", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3477,25 +3498,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3507,61 +3527,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(bslRequest != null) { - _requestContent = SafeJsonConvert.SerializeObject(bslRequest, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(bslRequest, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3571,20 +3592,25 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the Bastion Shareable Links for all the tokens specified in the /// request. @@ -3604,10 +3630,10 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3616,46 +3642,58 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (bslTokenRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bslTokenRequest"); } - if (bastionHostName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (SubscriptionId == null) + + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (bslTokenRequest == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bslTokenRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("bslTokenRequest", bslTokenRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteBastionShareableLinkByToken", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteBastionShareableLinkByToken", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinksByToken").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3665,25 +3703,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3695,61 +3732,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(bslTokenRequest != null) { - _requestContent = SafeJsonConvert.SerializeObject(bslTokenRequest, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(bslTokenRequest, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3759,33 +3797,38 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns the list of currently active sessions on the Bastion. /// @@ -3801,13 +3844,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3816,41 +3859,52 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> BeginGetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> BeginGetActiveSessionsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (bastionHostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "bastionHostName"); } - if (SubscriptionId == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("bastionHostName", bastionHostName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetActiveSessions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetActiveSessions", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3860,25 +3914,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3890,55 +3943,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3948,9 +4002,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3961,25 +4016,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Generates a unique VPN profile for P2S clients for VirtualWan and /// associated VpnServerConfiguration combination in the specified resource @@ -4002,13 +4061,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4017,46 +4076,58 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (SubscriptionId == null) + + + + + if (vpnClientParams == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnClientParams"); } - if (resourceGroupName == null) + + if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } - if (virtualWANName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnClientParams == null) + + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnClientParams"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); - tracingParameters.Add("vpnClientParams", vpnClientParams); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("vpnClientParams", vpnClientParams); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGeneratevirtualwanvpnserverconfigurationvpnprofile", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGeneratevirtualwanvpnserverconfigurationvpnprofile", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4066,25 +4137,24 @@ private void Initialize() _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4096,61 +4166,62 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnClientParams != null) { - _requestContent = SafeJsonConvert.SerializeObject(vpnClientParams, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnClientParams, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4160,9 +4231,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4173,25 +4245,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// @@ -4199,16 +4275,16 @@ private void Initialize() /// The NextLink from the previous successful call to List operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> PutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> PutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginPutBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse> _response = await BeginPutBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -4224,13 +4300,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4239,51 +4315,54 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> GetBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBastionShareableLinkNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetBastionShareableLinkNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4295,55 +4374,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4353,9 +4433,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4366,25 +4447,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns the list of currently active sessions on the Bastion. /// @@ -4392,16 +4477,16 @@ private void Initialize() /// The NextLink from the previous successful call to List operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> GetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginGetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse> _response = await BeginGetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -4416,13 +4501,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4431,51 +4516,54 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> DisconnectActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> DisconnectActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DisconnectActiveSessionsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DisconnectActiveSessionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4487,55 +4575,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4545,9 +4634,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4558,25 +4648,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// @@ -4589,13 +4683,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4604,51 +4698,54 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> BeginPutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> BeginPutBastionShareableLinkNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPutBastionShareableLinkNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPutBastionShareableLinkNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4660,55 +4757,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4718,9 +4816,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4731,25 +4830,29 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns the list of currently active sessions on the Bastion. /// @@ -4762,13 +4865,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4777,51 +4880,54 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task>> BeginGetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> BeginGetActiveSessionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetActiveSessionsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetActiveSessionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4833,55 +4939,56 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4891,9 +4998,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4904,24 +5012,28 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagementClientExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagementClientExtensions.cs index 171cab5a96a9..32ed4729c3ab 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagementClientExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagementClientExtensions.cs @@ -1,1129 +1,1007 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkManagementClient. + /// Extension methods for NetworkManagementClient /// public static partial class NetworkManagementClientExtensions { - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - public static IPage PutBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) - { - return operations.PutBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - /// - /// The cancellation token. - /// - public static async Task> PutBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - public static void DeleteBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) - { - operations.DeleteBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); - } - - /// - /// Deletes the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes the Bastion Shareable Links for all the tokens specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Delete Bastion Shareable Link By Token endpoint. - /// - public static DeleteBastionShareableLinkByTokenHeaders DeleteBastionShareableLinkByToken(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest) - { - return operations.DeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostName, bslTokenRequest).GetAwaiter().GetResult(); - } - - /// - /// Deletes the Bastion Shareable Links for all the tokens specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Delete Bastion Shareable Link By Token endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteBastionShareableLinkByTokenAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteBastionShareableLinkByTokenWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslTokenRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Return the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - public static IPage GetBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) - { - return operations.GetBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); - } - - /// - /// Return the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - /// - /// The cancellation token. - /// - public static async Task> GetBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - public static IPage GetActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName) - { - return operations.GetActiveSessionsAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The cancellation token. - /// - public static async Task> GetActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The list of sessionids to disconnect. - /// - public static IPage DisconnectActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, SessionIds sessionIds) - { - return operations.DisconnectActiveSessionsAsync(resourceGroupName, bastionHostName, sessionIds).GetAwaiter().GetResult(); - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The list of sessionids to disconnect. - /// - /// - /// The cancellation token. - /// - public static async Task> DisconnectActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, SessionIds sessionIds, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DisconnectActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, sessionIds, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks whether a domain name in the cloudapp.azure.com zone is available - /// for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The domain name to be verified. It must conform to the following regular - /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - /// - public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkManagementClient operations, string location, string domainNameLabel) - { - return operations.CheckDnsNameAvailabilityAsync(location, domainNameLabel).GetAwaiter().GetResult(); - } - - /// - /// Checks whether a domain name in the cloudapp.azure.com zone is available - /// for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The domain name to be verified. It must conform to the following regular - /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - /// - /// - /// The cancellation token. - /// - public static async Task CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckDnsNameAvailabilityWithHttpMessagesAsync(location, domainNameLabel, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves detail of a provider port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the provider port. - /// - public static ExpressRouteProviderPort ExpressRouteProviderPortMethod(this INetworkManagementClient operations, string providerport) - { - return operations.ExpressRouteProviderPortMethodAsync(providerport).GetAwaiter().GetResult(); - } - - /// - /// Retrieves detail of a provider port. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the provider port. - /// - /// - /// The cancellation token. - /// - public static async Task ExpressRouteProviderPortMethodAsync(this INetworkManagementClient operations, string providerport, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExpressRouteProviderPortMethodWithHttpMessagesAsync(providerport, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists active connectivity configurations in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - public static ActiveConnectivityConfigurationsListResult ListActiveConnectivityConfigurations(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?)) - { - return operations.ListActiveConnectivityConfigurationsAsync(parameters, resourceGroupName, networkManagerName, top).GetAwaiter().GetResult(); - } - - /// - /// Lists active connectivity configurations in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// The cancellation token. - /// - public static async Task ListActiveConnectivityConfigurationsAsync(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListActiveConnectivityConfigurationsWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists active security admin rules in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - public static ActiveSecurityAdminRulesListResult ListActiveSecurityAdminRules(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?)) - { - return operations.ListActiveSecurityAdminRulesAsync(parameters, resourceGroupName, networkManagerName, top).GetAwaiter().GetResult(); - } - - /// - /// Lists active security admin rules in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// The cancellation token. - /// - public static async Task ListActiveSecurityAdminRulesAsync(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListActiveSecurityAdminRulesWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all effective connectivity configurations applied on a virtual - /// network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - public static NetworkManagerEffectiveConnectivityConfigurationListResult ListNetworkManagerEffectiveConnectivityConfigurations(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?)) - { - return operations.ListNetworkManagerEffectiveConnectivityConfigurationsAsync(parameters, resourceGroupName, virtualNetworkName, top).GetAwaiter().GetResult(); - } - - /// - /// List all effective connectivity configurations applied on a virtual - /// network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// The cancellation token. - /// - public static async Task ListNetworkManagerEffectiveConnectivityConfigurationsAsync(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(parameters, resourceGroupName, virtualNetworkName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all effective security admin rules applied on a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - public static NetworkManagerEffectiveSecurityAdminRulesListResult ListNetworkManagerEffectiveSecurityAdminRules(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?)) - { - return operations.ListNetworkManagerEffectiveSecurityAdminRulesAsync(parameters, resourceGroupName, virtualNetworkName, top).GetAwaiter().GetResult(); - } - - /// - /// List all effective security admin rules applied on a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// The cancellation token. - /// - public static async Task ListNetworkManagerEffectiveSecurityAdminRulesAsync(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(parameters, resourceGroupName, virtualNetworkName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gives the supported security providers for the virtual wan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN for which supported security providers are - /// needed. - /// - public static VirtualWanSecurityProviders SupportedSecurityProviders(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName) - { - return operations.SupportedSecurityProvidersAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); - } - - /// - /// Gives the supported security providers for the virtual wan. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN for which supported security providers are - /// needed. - /// - /// - /// The cancellation token. - /// - public static async Task SupportedSecurityProvidersAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.SupportedSecurityProvidersWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - /// - /// Parameters supplied to the generate VirtualWan VPN profile generation - /// operation. - /// - public static VpnProfileResponse Generatevirtualwanvpnserverconfigurationvpnprofile(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams) - { - return operations.GeneratevirtualwanvpnserverconfigurationvpnprofileAsync(resourceGroupName, virtualWANName, vpnClientParams).GetAwaiter().GetResult(); - } - - /// - /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - /// - /// Parameters supplied to the generate VirtualWan VPN profile generation - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task GeneratevirtualwanvpnserverconfigurationvpnprofileAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - public static IPage BeginPutBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) - { - return operations.BeginPutBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginPutBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginPutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - public static void BeginDeleteBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) - { - operations.BeginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); - } - - /// - /// Deletes the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Create/Delete/Get Bastion Shareable Link endpoints. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes the Bastion Shareable Links for all the tokens specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Delete Bastion Shareable Link By Token endpoint. - /// - public static DeleteBastionShareableLinkByTokenHeaders BeginDeleteBastionShareableLinkByToken(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest) - { - return operations.BeginDeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostName, bslTokenRequest).GetAwaiter().GetResult(); - } - - /// - /// Deletes the Bastion Shareable Links for all the tokens specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// Post request for Delete Bastion Shareable Link By Token endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteBastionShareableLinkByTokenAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslTokenRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - public static IPage BeginGetActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName) - { - return operations.BeginGetActiveSessionsAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Bastion Host. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginGetActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - /// - /// Parameters supplied to the generate VirtualWan VPN profile generation - /// operation. - /// - public static VpnProfileResponse BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams) - { - return operations.BeginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync(resourceGroupName, virtualWANName, vpnClientParams).GetAwaiter().GetResult(); - } - - /// - /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - /// - /// Parameters supplied to the generate VirtualWan VPN profile generation - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage PutBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink) - { - return operations.PutBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> PutBastionShareableLinkNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PutBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Return the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink) - { - return operations.GetBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Return the Bastion Shareable Links for all the VMs specified in the - /// request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetBastionShareableLinkNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink) - { - return operations.GetActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage DisconnectActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink) - { - return operations.DisconnectActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> DisconnectActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DisconnectActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage BeginPutBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink) - { - return operations.BeginPutBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Creates a Bastion Shareable Links for all the VMs specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginPutBastionShareableLinkNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginPutBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage BeginGetActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink) - { - return operations.BeginGetActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns the list of currently active sessions on the Bastion. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginGetActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static Microsoft.Rest.Azure.IPage PutBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) + { + return ((INetworkManagementClient)operations).PutBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); + } + + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> PutBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static void DeleteBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) + { + ((INetworkManagementClient)operations).DeleteBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); + } + + /// + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static DeleteBastionShareableLinkByTokenHeaders DeleteBastionShareableLinkByToken(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest) + { + return ((INetworkManagementClient)operations).DeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostName, bslTokenRequest).GetAwaiter().GetResult(); + } + + /// + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteBastionShareableLinkByTokenAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteBastionShareableLinkByTokenWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslTokenRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Return the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static Microsoft.Rest.Azure.IPage GetBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) + { + return ((INetworkManagementClient)operations).GetBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); + } + + /// + /// Return the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static Microsoft.Rest.Azure.IPage GetActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName) + { + return ((INetworkManagementClient)operations).GetActiveSessionsAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static Microsoft.Rest.Azure.IPage DisconnectActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, SessionIds sessionIds) + { + return ((INetworkManagementClient)operations).DisconnectActiveSessionsAsync(resourceGroupName, bastionHostName, sessionIds).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> DisconnectActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, SessionIds sessionIds, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DisconnectActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, sessionIds, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks whether a domain name in the cloudapp.azure.com zone is available + /// for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The domain name to be verified. It must conform to the following regular + /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + /// + public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkManagementClient operations, string location, string domainNameLabel) + { + return ((INetworkManagementClient)operations).CheckDnsNameAvailabilityAsync(location, domainNameLabel).GetAwaiter().GetResult(); + } + + /// + /// Checks whether a domain name in the cloudapp.azure.com zone is available + /// for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The domain name to be verified. It must conform to the following regular + /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckDnsNameAvailabilityWithHttpMessagesAsync(location, domainNameLabel, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves detail of a provider port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the provider port. + /// + public static ExpressRouteProviderPort ExpressRouteProviderPort(this INetworkManagementClient operations, string providerport) + { + return ((INetworkManagementClient)operations).ExpressRouteProviderPortAsync(providerport).GetAwaiter().GetResult(); + } + + /// + /// Retrieves detail of a provider port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the provider port. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExpressRouteProviderPortAsync(this INetworkManagementClient operations, string providerport, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExpressRouteProviderPortWithHttpMessagesAsync(providerport, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + public static ActiveConnectivityConfigurationsListResult ListActiveConnectivityConfigurations(this INetworkManagementClient operations, string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?)) + { + return ((INetworkManagementClient)operations).ListActiveConnectivityConfigurationsAsync(resourceGroupName, networkManagerName, parameters, top).GetAwaiter().GetResult(); + } + + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListActiveConnectivityConfigurationsAsync(this INetworkManagementClient operations, string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListActiveConnectivityConfigurationsWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + public static ActiveSecurityAdminRulesListResult ListActiveSecurityAdminRules(this INetworkManagementClient operations, string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?)) + { + return ((INetworkManagementClient)operations).ListActiveSecurityAdminRulesAsync(resourceGroupName, networkManagerName, parameters, top).GetAwaiter().GetResult(); + } + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListActiveSecurityAdminRulesAsync(this INetworkManagementClient operations, string resourceGroupName, string networkManagerName, ActiveConfigurationParameter parameters, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListActiveSecurityAdminRulesWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + public static NetworkManagerEffectiveConnectivityConfigurationListResult ListNetworkManagerEffectiveConnectivityConfigurations(this INetworkManagementClient operations, string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?)) + { + return ((INetworkManagementClient)operations).ListNetworkManagerEffectiveConnectivityConfigurationsAsync(resourceGroupName, virtualNetworkName, parameters, top).GetAwaiter().GetResult(); + } + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListNetworkManagerEffectiveConnectivityConfigurationsAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + public static NetworkManagerEffectiveSecurityAdminRulesListResult ListNetworkManagerEffectiveSecurityAdminRules(this INetworkManagementClient operations, string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?)) + { + return ((INetworkManagementClient)operations).ListNetworkManagerEffectiveSecurityAdminRulesAsync(resourceGroupName, virtualNetworkName, parameters, top).GetAwaiter().GetResult(); + } + + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListNetworkManagerEffectiveSecurityAdminRulesAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualNetworkName, QueryRequestOptions parameters, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gives the supported security providers for the virtual wan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which supported security providers are + /// needed. + /// + public static VirtualWanSecurityProviders SupportedSecurityProviders(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName) + { + return ((INetworkManagementClient)operations).SupportedSecurityProvidersAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + } + + /// + /// Gives the supported security providers for the virtual wan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which supported security providers are + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SupportedSecurityProvidersAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.SupportedSecurityProvidersWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + public static VpnProfileResponse Generatevirtualwanvpnserverconfigurationvpnprofile(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams) + { + return ((INetworkManagementClient)operations).GeneratevirtualwanvpnserverconfigurationvpnprofileAsync(resourceGroupName, virtualWANName, vpnClientParams).GetAwaiter().GetResult(); + } + + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GeneratevirtualwanvpnserverconfigurationvpnprofileAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static Microsoft.Rest.Azure.IPage BeginPutBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) + { + return ((INetworkManagementClient)operations).BeginPutBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); + } + + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> BeginPutBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginPutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static void BeginDeleteBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest) + { + ((INetworkManagementClient)operations).BeginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult(); + } + + /// + /// Deletes the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static DeleteBastionShareableLinkByTokenHeaders BeginDeleteBastionShareableLinkByToken(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest) + { + return ((INetworkManagementClient)operations).BeginDeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostName, bslTokenRequest).GetAwaiter().GetResult(); + } + + /// + /// Deletes the Bastion Shareable Links for all the tokens specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteBastionShareableLinkByTokenAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkTokenListRequest bslTokenRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteBastionShareableLinkByTokenWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslTokenRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + public static Microsoft.Rest.Azure.IPage BeginGetActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName) + { + return ((INetworkManagementClient)operations).BeginGetActiveSessionsAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> BeginGetActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + public static VpnProfileResponse BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams) + { + return ((INetworkManagementClient)operations).BeginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync(resourceGroupName, virtualWANName, vpnClientParams).GetAwaiter().GetResult(); + } + + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage PutBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink) + { + return ((INetworkManagementClient)operations).PutBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> PutBastionShareableLinkNextAsync(this INetworkManagementClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PutBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Return the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage GetBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink) + { + return ((INetworkManagementClient)operations).GetBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Return the Bastion Shareable Links for all the VMs specified in the + /// request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetBastionShareableLinkNextAsync(this INetworkManagementClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage GetActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink) + { + return ((INetworkManagementClient)operations).GetActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage DisconnectActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink) + { + return ((INetworkManagementClient)operations).DisconnectActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> DisconnectActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DisconnectActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage BeginPutBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink) + { + return ((INetworkManagementClient)operations).BeginPutBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Creates a Bastion Shareable Links for all the VMs specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> BeginPutBastionShareableLinkNextAsync(this INetworkManagementClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginPutBastionShareableLinkNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage BeginGetActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink) + { + return ((INetworkManagementClient)operations).BeginGetActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of currently active sessions on the Bastion. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> BeginGetActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperations.cs index 013e473cf83f..fd22d65e5aca 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkManagerCommitsOperations operations. /// - internal partial class NetworkManagerCommitsOperations : IServiceOperations, INetworkManagerCommitsOperations + internal partial class NetworkManagerCommitsOperations : Microsoft.Rest.IServiceOperations, INetworkManagerCommitsOperations { /// /// Initializes a new instance of the NetworkManagerCommitsOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkManagerCommitsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkManagerCommitsOperations(NetworkManagementClient client) + internal NetworkManagerCommitsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,53 +41,53 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) /// /// Post a Network Manager Commit. /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PostWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPostWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Post a Network Manager Commit. /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,50 +96,61 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginPostWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPost", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPost", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -161,25 +160,24 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -191,61 +189,62 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -255,9 +254,10 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -268,16 +268,16 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -286,37 +286,41 @@ internal NetworkManagerCommitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperationsExtensions.cs index f78cfa320e13..51bb0c5e1f9b 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagerCommitsOperationsExtensions.cs @@ -1,117 +1,94 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkManagerCommitsOperations. + /// Extension methods for NetworkManagerCommitsOperations /// public static partial class NetworkManagerCommitsOperationsExtensions { - /// - /// Post a Network Manager Commit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - public static NetworkManagerCommit Post(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName) - { - return operations.PostAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); - } + /// + /// Post a Network Manager Commit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManagerCommit Post(this INetworkManagerCommitsOperations operations, string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters) + { + return ((INetworkManagerCommitsOperations)operations).PostAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } - /// - /// Post a Network Manager Commit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The cancellation token. - /// - public static async Task PostAsync(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Post a Network Manager Commit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PostAsync(this INetworkManagerCommitsOperations operations, string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PostWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.PostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Post a Network Manager Commit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManagerCommit BeginPost(this INetworkManagerCommitsOperations operations, string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters) + { + return ((INetworkManagerCommitsOperations)operations).BeginPostAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } - /// - /// Post a Network Manager Commit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - public static NetworkManagerCommit BeginPost(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName) + /// + /// Post a Network Manager Commit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPostAsync(this INetworkManagerCommitsOperations operations, string resourceGroupName, string networkManagerName, NetworkManagerCommit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginPostWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginPostAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Post a Network Manager Commit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which Managed Network commit is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPostAsync(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginPostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperations.cs index 70ba3fa09ca7..8fa9ced7390f 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkManagerDeploymentStatusOperations operations. /// - internal partial class NetworkManagerDeploymentStatusOperations : IServiceOperations, INetworkManagerDeploymentStatusOperations + internal partial class NetworkManagerDeploymentStatusOperations : Microsoft.Rest.IServiceOperations, INetworkManagerDeploymentStatusOperations { /// /// Initializes a new instance of the NetworkManagerDeploymentStatusOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkManagerDeploymentStatusOperations : IServiceOperat /// /// Thrown when a required parameter is null /// - internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client) + internal NetworkManagerDeploymentStatusOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,9 +41,6 @@ internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client /// /// Post to List of Network Manager Deployment Status. /// - /// - /// Parameters supplied to specify which Managed Network deployment status is. - /// /// /// The name of the resource group. /// @@ -66,19 +51,22 @@ internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client /// An optional query parameter which specifies the maximum number of records /// to be returned by the server. /// + /// + /// Parameters supplied to specify which Managed Network deployment status is. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -87,90 +75,101 @@ internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManagerDeploymentStatusParameter parameters, int? top = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -182,61 +181,62 @@ internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,24 +260,28 @@ internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs index 33e35ce9a425..7e9e365acf1d 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs @@ -1,79 +1,63 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkManagerDeploymentStatusOperations. + /// Extension methods for NetworkManagerDeploymentStatusOperations /// public static partial class NetworkManagerDeploymentStatusOperationsExtensions { - /// - /// Post to List of Network Manager Deployment Status. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which Managed Network deployment status is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - public static NetworkManagerDeploymentStatusListResult List(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?)) - { - return operations.ListAsync(parameters, resourceGroupName, networkManagerName, top).GetAwaiter().GetResult(); - } + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + public static NetworkManagerDeploymentStatusListResult List(this INetworkManagerDeploymentStatusOperations operations, string resourceGroupName, string networkManagerName, NetworkManagerDeploymentStatusParameter parameters, int? top = default(int?)) + { + return ((INetworkManagerDeploymentStatusOperations)operations).ListAsync(resourceGroupName, networkManagerName, parameters, top).GetAwaiter().GetResult(); + } - /// - /// Post to List of Network Manager Deployment Status. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which Managed Network deployment status is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this INetworkManagerDeploymentStatusOperations operations, string resourceGroupName, string networkManagerName, NetworkManagerDeploymentStatusParameter parameters, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, top, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, top, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperations.cs index c1cc41642ba2..76ca8dd4cd10 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkManagersOperations operations. /// - internal partial class NetworkManagersOperations : IServiceOperations, INetworkManagersOperations + internal partial class NetworkManagersOperations : Microsoft.Rest.IServiceOperations, INetworkManagersOperations { /// /// Initializes a new instance of the NetworkManagersOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkManagersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkManagersOperations(NetworkManagementClient client) + internal NetworkManagersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal NetworkManagersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,50 +225,54 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Network Manager. /// - /// - /// Parameters supplied to specify which network manager is. - /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which network manager is. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -277,50 +281,58 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManager parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, NetworkManager parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -330,25 +342,24 @@ internal NetworkManagersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -360,61 +371,62 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -424,9 +436,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -437,16 +450,16 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -455,25 +468,29 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a network manager. /// @@ -489,43 +506,43 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// in the background, prior to the delete. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Patch NetworkManager. /// - /// - /// Parameters supplied to specify which network manager is. - /// /// /// The name of the resource group. /// /// /// The name of the network manager. /// + /// + /// Parameters supplied to specify which network manager is. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -534,46 +551,57 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PatchWithHttpMessagesAsync(PatchObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, PatchObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -583,25 +611,24 @@ internal NetworkManagersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -613,61 +640,62 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -677,9 +705,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -690,25 +719,29 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network managers in a subscription. /// @@ -728,13 +761,13 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -743,49 +776,59 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -796,25 +839,24 @@ internal NetworkManagersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -826,55 +868,56 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -884,9 +927,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -897,25 +941,29 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List network managers in a resource group. /// @@ -938,13 +986,13 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -953,55 +1001,66 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -1012,25 +1071,24 @@ internal NetworkManagersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1042,55 +1100,56 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1100,9 +1159,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1113,25 +1173,29 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a network manager. /// @@ -1152,10 +1216,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1164,74 +1228,85 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("force", force); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1243,55 +1318,56 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1301,33 +1377,38 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network managers in a subscription. /// @@ -1340,13 +1421,13 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1355,51 +1436,54 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1411,55 +1495,56 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1469,9 +1554,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1482,25 +1568,29 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List network managers in a resource group. /// @@ -1513,13 +1603,13 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1528,51 +1618,54 @@ internal NetworkManagersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1584,55 +1677,56 @@ internal NetworkManagersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1642,9 +1736,10 @@ internal NetworkManagersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1655,24 +1750,28 @@ internal NetworkManagersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperationsExtensions.cs index 4149facc5895..2b7342efb929 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkManagersOperationsExtensions.cs @@ -1,427 +1,397 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkManagersOperations. + /// Extension methods for NetworkManagersOperations /// public static partial class NetworkManagersOperationsExtensions { - /// - /// Gets the specified Network Manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - public static NetworkManager Get(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName) - { - return operations.GetAsync(resourceGroupName, networkManagerName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Network Manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a Network Manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which network manager is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - public static NetworkManager CreateOrUpdate(this INetworkManagersOperations operations, NetworkManager parameters, string resourceGroupName, string networkManagerName) - { - return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Network Manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which network manager is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkManagersOperations operations, NetworkManager parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static NetworkManagersDeleteHeaders Delete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?)) - { - return operations.DeleteAsync(resourceGroupName, networkManagerName, force).GetAwaiter().GetResult(); - } - - /// - /// Deletes a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Patch NetworkManager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which network manager is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - public static NetworkManager Patch(this INetworkManagersOperations operations, PatchObject parameters, string resourceGroupName, string networkManagerName) - { - return operations.PatchAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); - } + /// + /// Gets the specified Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager Get(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName) + { + return ((INetworkManagersOperations)operations).GetAsync(resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } - /// - /// Patch NetworkManager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to specify which network manager is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The cancellation token. - /// - public static async Task PatchAsync(this INetworkManagersOperations operations, PatchObject parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.PatchWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager CreateOrUpdate(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, NetworkManager parameters) + { + return ((INetworkManagersOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } - /// - /// List all network managers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage ListBySubscription(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string)) + /// + /// Creates or updates a Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, NetworkManager parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionAsync(top, skipToken).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkManagersDeleteHeaders Delete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?)) + { + return ((INetworkManagersOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, force).GetAwaiter().GetResult(); + } - /// - /// List all network managers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Patch NetworkManager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager Patch(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, PatchObject parameters) + { + return ((INetworkManagersOperations)operations).PatchAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } - /// - /// List network managers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) + /// + /// Patch NetworkManager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PatchAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, PatchObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, top, skipToken).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return ((INetworkManagersOperations)operations).ListBySubscriptionAsync(top, skipToken).GetAwaiter().GetResult(); + } - /// - /// List network managers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) + { + return ((INetworkManagersOperations)operations).ListAsync(resourceGroupName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Deletes a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static NetworkManagersDeleteHeaders BeginDelete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?)) + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, force).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkManagersDeleteHeaders BeginDelete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?)) + { + return ((INetworkManagersOperations)operations).BeginDeleteAsync(resourceGroupName, networkManagerName, force).GetAwaiter().GetResult(); + } - /// - /// Deletes a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Headers; } + } + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this INetworkManagersOperations operations, string nextPageLink) + { + return ((INetworkManagersOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all network managers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this INetworkManagersOperations operations, string nextPageLink) + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this INetworkManagersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkManagersOperations operations, string nextPageLink) + { + return ((INetworkManagersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all network managers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this INetworkManagersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkManagersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// List network managers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkManagersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List network managers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkManagersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperations.cs index e51a40fffba0..be9df3cf20af 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkProfilesOperations operations. /// - internal partial class NetworkProfilesOperations : IServiceOperations, INetworkProfilesOperations + internal partial class NetworkProfilesOperations : Microsoft.Rest.IServiceOperations, INetworkProfilesOperations { /// /// Initializes a new instance of the NetworkProfilesOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkProfilesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkProfilesOperations(NetworkManagementClient client) + internal NetworkProfilesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// The name of the NetworkProfile. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkProfileName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkProfileName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkProfileName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkProfileName", networkProfileName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkProfileName}", System.Uri.EscapeDataString(networkProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a network profile. /// @@ -292,13 +297,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -307,46 +312,58 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, NetworkProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, NetworkProfile parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkProfileName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkProfileName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkProfileName", networkProfileName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkProfileName}", System.Uri.EscapeDataString(networkProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -356,25 +373,24 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -386,61 +402,62 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,9 +467,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -463,16 +481,16 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -481,25 +499,29 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates network profile tags. /// @@ -518,13 +540,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -533,46 +555,57 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkProfileName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkProfileName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkProfileName", networkProfileName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkProfileName}", System.Uri.EscapeDataString(networkProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -582,25 +615,24 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -612,61 +644,62 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -676,9 +709,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -689,25 +723,29 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the network profiles in a subscription. /// @@ -717,13 +755,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -732,29 +770,38 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -764,25 +811,24 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -794,55 +840,56 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -852,9 +899,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -865,25 +913,29 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network profiles in a resource group. /// @@ -896,13 +948,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -911,35 +963,45 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -949,25 +1011,24 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -979,55 +1040,56 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1037,9 +1099,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1050,25 +1113,29 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified network profile. /// @@ -1084,10 +1151,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1096,41 +1163,52 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkProfileName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkProfileName", networkProfileName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkProfileName}", System.Uri.EscapeDataString(networkProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1140,25 +1218,24 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1170,55 +1247,56 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1228,20 +1306,25 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the network profiles in a subscription. /// @@ -1254,13 +1337,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1269,51 +1352,54 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1325,55 +1411,56 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1383,9 +1470,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1396,25 +1484,29 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network profiles in a resource group. /// @@ -1427,13 +1519,13 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1442,51 +1534,54 @@ internal NetworkProfilesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1498,55 +1593,56 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1556,9 +1652,10 @@ internal NetworkProfilesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1569,24 +1666,28 @@ internal NetworkProfilesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperationsExtensions.cs index be79eeddbeb5..de69d49f38af 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkProfilesOperationsExtensions.cs @@ -1,367 +1,337 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkProfilesOperations. + /// Extension methods for NetworkProfilesOperations /// public static partial class NetworkProfilesOperationsExtensions { - /// - /// Deletes the specified network profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetworkProfile. - /// - public static void Delete(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName) - { - operations.DeleteAsync(resourceGroupName, networkProfileName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetworkProfile. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkProfileName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified network profile in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Expands referenced resources. - /// - public static NetworkProfile Get(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, networkProfileName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified network profile in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkProfileName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a network profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network profile. - /// - /// - /// Parameters supplied to the create or update network profile operation. - /// - public static NetworkProfile CreateOrUpdate(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, NetworkProfile parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkProfileName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a network profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network profile. - /// - /// - /// Parameters supplied to the create or update network profile operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, NetworkProfile parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates network profile tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network profile. - /// - /// - /// Parameters supplied to update network profile tags. - /// - public static NetworkProfile UpdateTags(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, networkProfileName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates network profile tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network profile. - /// - /// - /// Parameters supplied to update network profile tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetworkProfile. + /// + public static void Delete(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName) + { + ((INetworkProfilesOperations)operations).DeleteAsync(resourceGroupName, networkProfileName).GetAwaiter().GetResult(); + } - /// - /// Gets all the network profiles in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this INetworkProfilesOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all the network profiles in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this INetworkProfilesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetworkProfile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkProfileName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified network profile in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Expands referenced resources. + /// + public static NetworkProfile Get(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, string expand = default(string)) + { + return ((INetworkProfilesOperations)operations).GetAsync(resourceGroupName, networkProfileName, expand).GetAwaiter().GetResult(); + } - /// - /// Gets all network profiles in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this INetworkProfilesOperations operations, string resourceGroupName) + /// + /// Gets the specified network profile in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkProfileName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a network profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network profile. + /// + public static NetworkProfile CreateOrUpdate(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, NetworkProfile parameters) + { + return ((INetworkProfilesOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkProfileName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all network profiles in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkProfilesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a network profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, NetworkProfile parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates network profile tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network profile. + /// + public static NetworkProfile UpdateTags(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, TagsObject parameters) + { + return ((INetworkProfilesOperations)operations).UpdateTagsAsync(resourceGroupName, networkProfileName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetworkProfile. - /// - public static void BeginDelete(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName) + /// + /// Updates network profile tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkProfileName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the network profiles in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this INetworkProfilesOperations operations) + { + return ((INetworkProfilesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetworkProfile. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the network profiles in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this INetworkProfilesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkProfileName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Gets all network profiles in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkProfilesOperations operations, string resourceGroupName) + { + return ((INetworkProfilesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all the network profiles in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this INetworkProfilesOperations operations, string nextPageLink) + /// + /// Gets all network profiles in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkProfilesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified network profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetworkProfile. + /// + public static void BeginDelete(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName) + { + ((INetworkProfilesOperations)operations).BeginDeleteAsync(resourceGroupName, networkProfileName).GetAwaiter().GetResult(); + } - /// - /// Gets all the network profiles in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this INetworkProfilesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetworkProfile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkProfilesOperations operations, string resourceGroupName, string networkProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkProfileName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all the network profiles in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkProfilesOperations operations, string nextPageLink) + { + return ((INetworkProfilesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network profiles in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkProfilesOperations operations, string nextPageLink) + /// + /// Gets all the network profiles in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this INetworkProfilesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network profiles in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkProfilesOperations operations, string nextPageLink) + { + return ((INetworkProfilesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network profiles in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkProfilesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network profiles in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkProfilesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperations.cs index 7c29e34c1386..a030bc711bb1 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkSecurityGroupsOperations operations. /// - internal partial class NetworkSecurityGroupsOperations : IServiceOperations, INetworkSecurityGroupsOperations + internal partial class NetworkSecurityGroupsOperations : Microsoft.Rest.IServiceOperations, INetworkSecurityGroupsOperations { /// /// Initializes a new instance of the NetworkSecurityGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkSecurityGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkSecurityGroupsOperations(NetworkManagementClient client) + internal NetworkSecurityGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// The name of the network security group. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,28 +256,31 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates or updates a network security group in the specified resource - /// group. + /// Creates or updates a network security group in the specified resource group. /// /// /// The name of the resource group. @@ -289,16 +293,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -319,13 +323,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -334,46 +338,57 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkSecurityGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -383,25 +398,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -413,61 +427,62 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -477,9 +492,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -490,25 +506,29 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network security groups in a subscription. /// @@ -518,13 +538,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -533,29 +553,38 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +594,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +623,56 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +682,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +696,29 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network security groups in a resource group. /// @@ -697,13 +731,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -712,35 +746,45 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -750,25 +794,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -780,55 +823,56 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -838,9 +882,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -851,25 +896,29 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified network security group. /// @@ -885,10 +934,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -897,41 +946,52 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -941,25 +1001,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -971,55 +1030,56 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1029,20 +1089,25 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a network security group in the specified resource /// group. @@ -1063,13 +1128,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1078,46 +1143,58 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkSecurityGroupName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1127,25 +1204,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1157,61 +1233,62 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1221,9 +1298,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1234,16 +1312,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1252,25 +1330,29 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network security groups in a subscription. /// @@ -1283,13 +1365,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1298,51 +1380,54 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1354,55 +1439,56 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1412,9 +1498,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1425,25 +1512,29 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network security groups in a resource group. /// @@ -1456,13 +1547,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1471,51 +1562,54 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1527,55 +1621,56 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1585,9 +1680,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1598,24 +1694,28 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperationsExtensions.cs index 64af2a9c38db..95a057da16b5 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkSecurityGroupsOperationsExtensions.cs @@ -1,421 +1,380 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkSecurityGroupsOperations. + /// Extension methods for NetworkSecurityGroupsOperations /// public static partial class NetworkSecurityGroupsOperationsExtensions { - /// - /// Deletes the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - public static void Delete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) - { - operations.DeleteAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Expands referenced resources. - /// - public static NetworkSecurityGroup Get(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, networkSecurityGroupName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static void Delete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) + { + ((INetworkSecurityGroupsOperations)operations).DeleteAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// Expands referenced resources. + /// + public static NetworkSecurityGroup Get(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string)) + { + return ((INetworkSecurityGroupsOperations)operations).GetAsync(resourceGroupName, networkSecurityGroupName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network security group in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// - public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) + /// + /// Gets the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a network security group in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) + { + return ((INetworkSecurityGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network security group in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a network security group in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates a network security group tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static NetworkSecurityGroup UpdateTags(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, TagsObject parameters) + { + return ((INetworkSecurityGroupsOperations)operations).UpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a network security group tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to update network security group tags. - /// - public static NetworkSecurityGroup UpdateTags(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, TagsObject parameters) + /// + /// Updates a network security group tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this INetworkSecurityGroupsOperations operations) + { + return ((INetworkSecurityGroupsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Updates a network security group tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to update network security group tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) + { + return ((INetworkSecurityGroupsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this INetworkSecurityGroupsOperations operations) + /// + /// Gets all network security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) + { + ((INetworkSecurityGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a network security group in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) + { + return ((INetworkSecurityGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) + /// + /// Creates or updates a network security group in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) + { + return ((INetworkSecurityGroupsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all network security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network security groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) + { + return ((INetworkSecurityGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) + /// + /// Gets all network security groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a network security group in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// - public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a network security group in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all network security groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all network security groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperations.cs index 343d4e8f0e1c..42cd5fa9ac75 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkVirtualApplianceConnectionsOperations operations. /// - internal partial class NetworkVirtualApplianceConnectionsOperations : IServiceOperations, INetworkVirtualApplianceConnectionsOperations + internal partial class NetworkVirtualApplianceConnectionsOperations : Microsoft.Rest.IServiceOperations, INetworkVirtualApplianceConnectionsOperations { /// /// Initializes a new instance of the NetworkVirtualApplianceConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkVirtualApplianceConnectionsOperations : IServiceOp /// /// Thrown when a required parameter is null /// - internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient client) + internal NetworkVirtualApplianceConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl public NetworkManagementClient Client { get; private set; } /// - /// Creates a connection to Network Virtual Appliance, if it doesn't exist else - /// updates the existing NVA connection' + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection' /// /// /// The name of the resource group. @@ -67,16 +54,16 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -97,13 +84,13 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -112,47 +99,59 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -162,25 +161,24 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -192,55 +190,56 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -250,9 +249,10 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -263,25 +263,29 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a NVA connection. /// @@ -295,16 +299,16 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// The name of the NVA connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +326,13 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,48 +341,58 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } if (networkVirtualApplianceName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(networkVirtualApplianceName, "^[A-Za-z0-9_]+")) { - throw new ValidationException(ValidationRules.Pattern, "networkVirtualApplianceName", "^[A-Za-z0-9_]+"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "networkVirtualApplianceName", "^[A-Za-z0-9_]+"); } } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -388,25 +402,24 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -418,55 +431,56 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -476,9 +490,10 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -489,28 +504,32 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a connection to Network Virtual Appliance, if it doesn't exist else - /// updates the existing NVA connection' + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' /// /// /// The name of the resource group. @@ -530,13 +549,13 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -545,70 +564,80 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (networkVirtualApplianceConnectionParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceConnectionParameters"); } + if (networkVirtualApplianceConnectionParameters != null) + { + networkVirtualApplianceConnectionParameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } if (networkVirtualApplianceName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(networkVirtualApplianceName, "^[A-Za-z0-9_]+")) { - throw new ValidationException(ValidationRules.Pattern, "networkVirtualApplianceName", "^[A-Za-z0-9_]+"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "networkVirtualApplianceName", "^[A-Za-z0-9_]+"); } } if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } if (connectionName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(connectionName, "^[A-Za-z0-9_]+")) { - throw new ValidationException(ValidationRules.Pattern, "connectionName", "^[A-Za-z0-9_]+"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "connectionName", "^[A-Za-z0-9_]+"); } } - if (networkVirtualApplianceConnectionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceConnectionParameters"); - } - if (networkVirtualApplianceConnectionParameters != null) - { - networkVirtualApplianceConnectionParameters.Validate(); - } string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("networkVirtualApplianceConnectionParameters", networkVirtualApplianceConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -618,25 +647,24 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -648,61 +676,62 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(networkVirtualApplianceConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(networkVirtualApplianceConnectionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(networkVirtualApplianceConnectionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -712,9 +741,10 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -725,16 +755,16 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -743,25 +773,29 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a NVA connection. /// @@ -780,10 +814,10 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -792,47 +826,59 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -842,25 +888,24 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -872,55 +917,56 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -930,33 +976,38 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists NetworkVirtualApplianceConnections under the NVA. /// @@ -969,13 +1020,13 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -984,51 +1035,54 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1040,55 +1094,56 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1098,9 +1153,10 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1111,24 +1167,28 @@ internal NetworkVirtualApplianceConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperationsExtensions.cs index a35f0a634fd2..1ddcb6664071 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualApplianceConnectionsOperationsExtensions.cs @@ -1,345 +1,317 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkVirtualApplianceConnectionsOperations. + /// Extension methods for NetworkVirtualApplianceConnectionsOperations /// public static partial class NetworkVirtualApplianceConnectionsOperationsExtensions { - /// - /// Creates a connection to Network Virtual Appliance, if it doesn't exist else - /// updates the existing NVA connection' - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. - /// - public static NetworkVirtualApplianceConnection CreateOrUpdate(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a connection to Network Virtual Appliance, if it doesn't exist else - /// updates the existing NVA connection' - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the details of specified NVA connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - public static NetworkVirtualApplianceConnection Get(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName) - { - return operations.GetAsync(resourceGroupName, networkVirtualApplianceName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of specified NVA connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a NVA connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - public static NetworkVirtualApplianceConnectionsDeleteHeaders Delete(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName) - { - return operations.DeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).GetAwaiter().GetResult(); - } + /// + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + public static NetworkVirtualApplianceConnection CreateOrUpdate(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a NVA connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } + } + /// + /// Retrieves the details of specified NVA connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + public static NetworkVirtualApplianceConnection Get(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).GetAsync(resourceGroupName, networkVirtualApplianceName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Lists NetworkVirtualApplianceConnections under the NVA. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - public static IPage List(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName) + /// + /// Retrieves the details of specified NVA connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a NVA connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + public static NetworkVirtualApplianceConnectionsDeleteHeaders Delete(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).DeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Lists NetworkVirtualApplianceConnections under the NVA. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes a NVA connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Lists NetworkVirtualApplianceConnections under the NVA. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).ListAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + } - /// - /// Creates a connection to Network Virtual Appliance, if it doesn't exist else - /// updates the existing NVA connection' - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. - /// - public static NetworkVirtualApplianceConnection BeginCreateOrUpdate(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters) + /// + /// Lists NetworkVirtualApplianceConnections under the NVA. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + public static NetworkVirtualApplianceConnection BeginCreateOrUpdate(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a connection to Network Virtual Appliance, if it doesn't exist else - /// updates the existing NVA connection' - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// Parameters supplied in an NetworkVirtualApplianceConnection PUT operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a connection to Network Virtual Appliance, if it doesn't exist else + /// updates the existing NVA connection' + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, NetworkVirtualApplianceConnection networkVirtualApplianceConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a NVA connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + public static NetworkVirtualApplianceConnectionsDeleteHeaders BeginDelete(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes a NVA connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - public static NetworkVirtualApplianceConnectionsDeleteHeaders BeginDelete(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName) + /// + /// Deletes a NVA connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the NVA connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginDeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists NetworkVirtualApplianceConnections under the NVA. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkVirtualApplianceConnectionsOperations operations, string nextPageLink) + { + return ((INetworkVirtualApplianceConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a NVA connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the NVA connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkVirtualApplianceConnectionsOperations operations, string resourceGroupName, string networkVirtualApplianceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists NetworkVirtualApplianceConnections under the NVA. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkVirtualApplianceConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// Lists NetworkVirtualApplianceConnections under the NVA. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkVirtualApplianceConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists NetworkVirtualApplianceConnections under the NVA. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkVirtualApplianceConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperations.cs index b9c9479ceb67..ee5f17d197ca 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkVirtualAppliancesOperations operations. /// - internal partial class NetworkVirtualAppliancesOperations : IServiceOperations, INetworkVirtualAppliancesOperations + internal partial class NetworkVirtualAppliancesOperations : Microsoft.Rest.IServiceOperations, INetworkVirtualAppliancesOperations { /// /// Initializes a new instance of the NetworkVirtualAppliancesOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkVirtualAppliancesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) + internal NetworkVirtualAppliancesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// The name of Network Virtual Appliance. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a Network Virtual Appliance. /// @@ -292,13 +297,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -307,46 +312,57 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (networkVirtualApplianceName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -356,25 +372,24 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -386,61 +401,62 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,9 +466,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -463,25 +480,29 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Network Virtual Appliance. /// @@ -495,16 +516,16 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update Network Virtual Appliance. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -519,13 +540,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -534,35 +555,45 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -572,25 +603,24 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -602,55 +632,56 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -660,9 +691,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -673,25 +705,29 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all Network Virtual Appliances in a subscription. /// @@ -701,13 +737,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -716,29 +752,38 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Network Virtual Appliance. /// @@ -883,10 +933,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,33 +1088,38 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Network Virtual Appliance. /// @@ -1072,13 +1138,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1087,50 +1153,61 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkVirtualApplianceName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkVirtualApplianceName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1140,25 +1217,24 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1170,61 +1246,62 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1234,9 +1311,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1247,16 +1325,16 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1265,38 +1343,42 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Network Virtual Appliances in a resource group. /// @@ -1309,13 +1391,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1324,51 +1406,54 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1380,55 +1465,56 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1438,9 +1524,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1451,25 +1538,29 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all Network Virtual Appliances in a subscription. /// @@ -1482,13 +1573,13 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1497,51 +1588,54 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1553,55 +1647,56 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1611,9 +1706,10 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1624,24 +1720,28 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperationsExtensions.cs index 678b7970d1e9..227894d170f8 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkVirtualAppliancesOperationsExtensions.cs @@ -1,419 +1,382 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkVirtualAppliancesOperations. + /// Extension methods for NetworkVirtualAppliancesOperations /// public static partial class NetworkVirtualAppliancesOperationsExtensions { - /// - /// Deletes the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - public static NetworkVirtualAppliancesDeleteHeaders Delete(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName) - { - return operations.DeleteAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Gets the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// Expands referenced resources. - /// - public static NetworkVirtualAppliance Get(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, networkVirtualApplianceName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + public static NetworkVirtualAppliancesDeleteHeaders Delete(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName) + { + return ((INetworkVirtualAppliancesOperations)operations).DeleteAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + } - /// - /// Updates a Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of Network Virtual Appliance. - /// - /// - /// The name of Network Virtual Appliance being updated. - /// - /// - /// Parameters supplied to Update Network Virtual Appliance Tags. - /// - public static NetworkVirtualAppliance UpdateTags(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters) + /// + /// Deletes the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, networkVirtualApplianceName, parameters).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Gets the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + /// + /// Expands referenced resources. + /// + public static NetworkVirtualAppliance Get(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string expand = default(string)) + { + return ((INetworkVirtualAppliancesOperations)operations).GetAsync(resourceGroupName, networkVirtualApplianceName, expand).GetAwaiter().GetResult(); + } - /// - /// Updates a Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of Network Virtual Appliance. - /// - /// - /// The name of Network Virtual Appliance being updated. - /// - /// - /// Parameters supplied to Update Network Virtual Appliance Tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates a Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of Network Virtual Appliance. + /// + /// + /// The name of Network Virtual Appliance being updated. + /// + public static NetworkVirtualAppliance UpdateTags(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters) + { + return ((INetworkVirtualAppliancesOperations)operations).UpdateTagsAsync(resourceGroupName, networkVirtualApplianceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance. - /// - public static NetworkVirtualAppliance CreateOrUpdate(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters) + /// + /// Updates a Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of Network Virtual Appliance. + /// + /// + /// The name of Network Virtual Appliance being updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + public static NetworkVirtualAppliance CreateOrUpdate(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters) + { + return ((INetworkVirtualAppliancesOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Network Virtual Appliances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this INetworkVirtualAppliancesOperations operations, string resourceGroupName) + { + return ((INetworkVirtualAppliancesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Lists all Network Virtual Appliances in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this INetworkVirtualAppliancesOperations operations, string resourceGroupName) + /// + /// Lists all Network Virtual Appliances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all Network Virtual Appliances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this INetworkVirtualAppliancesOperations operations) + { + return ((INetworkVirtualAppliancesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all Network Virtual Appliances in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all Network Virtual Appliances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkVirtualAppliancesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + public static NetworkVirtualAppliancesDeleteHeaders BeginDelete(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName) + { + return ((INetworkVirtualAppliancesOperations)operations).BeginDeleteAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + } - /// - /// Gets all Network Virtual Appliances in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this INetworkVirtualAppliancesOperations operations) + /// + /// Deletes the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Creates or updates the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + public static NetworkVirtualAppliance BeginCreateOrUpdate(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters) + { + return ((INetworkVirtualAppliancesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all Network Virtual Appliances in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkVirtualAppliancesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Network Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of Network Virtual Appliance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Network Virtual Appliances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this INetworkVirtualAppliancesOperations operations, string nextPageLink) + { + return ((INetworkVirtualAppliancesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - public static NetworkVirtualAppliancesDeleteHeaders BeginDelete(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName) + /// + /// Lists all Network Virtual Appliances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this INetworkVirtualAppliancesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginDeleteAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all Network Virtual Appliances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkVirtualAppliancesOperations operations, string nextPageLink) + { + return ((INetworkVirtualAppliancesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all Network Virtual Appliances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this INetworkVirtualAppliancesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// Creates or updates the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance. - /// - public static NetworkVirtualAppliance BeginCreateOrUpdate(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified Network Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of Network Virtual Appliance. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INetworkVirtualAppliancesOperations operations, string resourceGroupName, string networkVirtualApplianceName, NetworkVirtualAppliance parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all Network Virtual Appliances in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this INetworkVirtualAppliancesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Network Virtual Appliances in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this INetworkVirtualAppliancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all Network Virtual Appliances in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INetworkVirtualAppliancesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all Network Virtual Appliances in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this INetworkVirtualAppliancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperations.cs b/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperations.cs index 4a5d4759bdae..b69fe001a393 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// NetworkWatchersOperations operations. /// - internal partial class NetworkWatchersOperations : IServiceOperations, INetworkWatchersOperations + internal partial class NetworkWatchersOperations : Microsoft.Rest.IServiceOperations, INetworkWatchersOperations { /// /// Initializes a new instance of the NetworkWatchersOperations class. @@ -36,13 +24,13 @@ internal partial class NetworkWatchersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetworkWatchersOperations(NetworkManagementClient client) + internal NetworkWatchersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,46 +71,58 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkWatcher parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkWatcher parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -132,25 +132,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -162,56 +161,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,16 +235,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -252,25 +253,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the specified network watcher by resource group. /// @@ -286,13 +291,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -301,41 +306,52 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -345,25 +361,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -375,50 +390,51 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -428,9 +444,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -441,25 +458,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified network watcher resource. /// @@ -470,16 +491,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// The name of the network watcher. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -500,13 +521,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -515,46 +536,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -564,25 +596,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -594,56 +625,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +685,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +699,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network watchers by resource group. /// @@ -697,13 +734,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -712,35 +749,45 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -750,25 +797,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -780,50 +826,51 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -833,9 +880,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -846,25 +894,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all network watchers by subscription. /// @@ -874,13 +926,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -889,29 +941,38 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -921,25 +982,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -951,50 +1011,51 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1004,9 +1065,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1017,25 +1079,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the current network topology by resource group. /// @@ -1054,13 +1120,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1069,46 +1135,58 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTopologyWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TopologyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetTopologyWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TopologyParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTopology", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTopology", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1118,25 +1196,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1148,56 +1225,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1207,9 +1285,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1220,28 +1299,31 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Verify IP flow from the specified VM to a location given the currently - /// configured NSG rules. + /// Verify IP flow from the specified VM to a location given the currently configured NSG rules. /// /// /// The name of the resource group. @@ -1253,16 +1335,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that define the IP flow to be verified. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> VerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> VerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginVerifyIPFlowWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginVerifyIPFlowWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1278,16 +1360,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that define the source and destination endpoint. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetNextHopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetNextHopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1303,16 +1385,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that define the VM to check security groups for. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetVMSecurityRulesWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetVMSecurityRulesWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1328,16 +1410,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that define the resource to troubleshoot. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetTroubleshootingWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetTroubleshootingWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1353,21 +1435,20 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that define the resource to query the troubleshooting result. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetTroubleshootingResultWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetTroubleshootingResultWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Configures flow log and traffic analytics (optional) on a specified - /// resource. + /// Configures flow log and traffic analytics (optional) on a specified resource. /// /// /// The name of the network watcher resource group. @@ -1379,21 +1460,20 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that define the configuration of flow log. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> SetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginSetFlowLogConfigurationWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSetFlowLogConfigurationWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Queries status of flow log and traffic analytics (optional) on a specified - /// resource. + /// Queries status of flow log and traffic analytics (optional) on a specified resource. /// /// /// The name of the network watcher resource group. @@ -1406,22 +1486,20 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// (optional) status. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetFlowLogStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetFlowLogStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// 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. + /// 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. /// /// /// The name of the network watcher resource group. @@ -1433,22 +1511,20 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that determine how the connectivity check will be performed. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginCheckConnectivityWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCheckConnectivityWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Gets the relative latency score for internet service providers - /// from a specified location to Azure regions. + /// NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. /// /// /// The name of the network watcher resource group. @@ -1460,22 +1536,20 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that determine Azure reachability report configuration. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetAzureReachabilityReportWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetAzureReachabilityReportWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Lists all available internet service providers for a specified - /// Azure region. + /// NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. /// /// /// The name of the network watcher resource group. @@ -1487,26 +1561,20 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters that scope the list of available providers. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListAvailableProvidersWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListAvailableProvidersWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets Network Configuration Diagnostic data to help customers understand and - /// debug network behavior. It provides detailed information on what security - /// rules were applied to a specified traffic flow and the result of evaluating - /// these rules. Customers must provide details of a flow like source, - /// destination, protocol, etc. The API returns whether traffic was allowed or - /// denied, the rules evaluated for the specified flow and the evaluation - /// results. + /// Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. /// /// /// The name of the resource group. @@ -1518,16 +1586,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// Parameters to get network configuration diagnostic. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1545,10 +1613,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1557,41 +1625,52 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1601,25 +1680,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1631,50 +1709,51 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1684,20 +1763,25 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Verify IP flow from the specified VM to a location given the currently /// configured NSG rules. @@ -1717,13 +1801,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1732,50 +1816,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginVerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginVerifyIPFlowWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginVerifyIPFlow", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginVerifyIPFlow", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1785,25 +1880,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1815,56 +1909,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1874,9 +1969,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1887,16 +1983,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1905,25 +2001,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the next hop from the specified VM. /// @@ -1942,13 +2042,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1957,50 +2057,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetNextHopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NextHopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetNextHop", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetNextHop", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2010,25 +2121,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2040,56 +2150,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2099,9 +2210,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2112,16 +2224,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2130,25 +2242,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the configured and effective security group rules on the specified VM. /// @@ -2167,13 +2283,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2182,50 +2298,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetVMSecurityRulesWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetVMSecurityRules", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetVMSecurityRules", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2235,25 +2362,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2265,56 +2391,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2324,9 +2451,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2337,16 +2465,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2355,25 +2483,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Initiate troubleshooting on a specified resource. /// @@ -2392,13 +2524,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2407,50 +2539,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetTroubleshootingWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetTroubleshooting", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetTroubleshooting", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2460,25 +2603,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2490,56 +2632,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2549,9 +2692,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2562,16 +2706,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2580,25 +2724,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the last completed troubleshooting result on a specified resource. /// @@ -2617,13 +2765,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2632,50 +2780,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetTroubleshootingResultWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetTroubleshootingResult", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetTroubleshootingResult", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2685,25 +2844,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2715,56 +2873,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2774,9 +2933,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2787,16 +2947,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2805,25 +2965,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Configures flow log and traffic analytics (optional) on a specified /// resource. @@ -2843,13 +3007,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2858,50 +3022,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginSetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginSetFlowLogConfigurationWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSetFlowLogConfiguration", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSetFlowLogConfiguration", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2911,25 +3086,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2941,56 +3115,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3000,9 +3175,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3013,16 +3189,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -3031,25 +3207,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Queries status of flow log and traffic analytics (optional) on a specified /// resource. @@ -3070,13 +3250,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3085,50 +3265,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetFlowLogStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetFlowLogStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetFlowLogStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3138,25 +3329,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3168,56 +3358,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3227,9 +3418,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3240,16 +3432,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -3258,25 +3450,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Verifies the possibility of establishing a direct TCP connection from a /// virtual machine to a given endpoint including another VM or an arbitrary @@ -3297,13 +3493,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3312,50 +3508,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCheckConnectivityWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCheckConnectivity", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCheckConnectivity", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3365,25 +3572,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3395,56 +3601,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3454,9 +3661,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3467,16 +3675,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -3485,25 +3693,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// NOTE: This feature is currently in preview and still being tested for /// stability. Gets the relative latency score for internet service providers @@ -3524,13 +3736,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3539,50 +3751,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetAzureReachabilityReportWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetAzureReachabilityReport", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetAzureReachabilityReport", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3592,25 +3815,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3622,56 +3844,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3681,9 +3904,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3694,16 +3918,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -3712,25 +3936,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// NOTE: This feature is currently in preview and still being tested for /// stability. Lists all available internet service providers for a specified @@ -3751,13 +3979,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3766,46 +3994,58 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListAvailableProviders", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListAvailableProviders", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3815,25 +4055,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3845,56 +4084,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3904,9 +4144,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3917,16 +4158,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -3935,25 +4176,29 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets Network Configuration Diagnostic data to help customers understand and /// debug network behavior. It provides detailed information on what security @@ -3978,13 +4223,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3993,50 +4238,61 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (networkWatcherName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetNetworkConfigurationDiagnostic", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetNetworkConfigurationDiagnostic", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4046,25 +4302,24 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4076,56 +4331,57 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4135,9 +4391,10 @@ internal NetworkWatchersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4148,16 +4405,16 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -4166,24 +4423,28 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperationsExtensions.cs index 67c6c658e4bf..08676528b08c 100644 --- a/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/NetworkWatchersOperationsExtensions.cs @@ -1,1417 +1,1222 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetworkWatchersOperations. + /// Extension methods for NetworkWatchersOperations /// public static partial class NetworkWatchersOperationsExtensions { - /// - /// Creates or updates a network watcher in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the network watcher resource. - /// - public static NetworkWatcher CreateOrUpdate(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkWatcher parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a network watcher in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the network watcher resource. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkWatcher parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified network watcher by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - public static NetworkWatcher Get(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName) - { - return operations.GetAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified network watcher by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified network watcher resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - public static void Delete(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName) - { - operations.DeleteAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network watcher resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a network watcher tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters supplied to update network watcher tags. - /// - public static NetworkWatcher UpdateTags(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a network watcher tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters supplied to update network watcher tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Creates or updates a network watcher in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NetworkWatcher CreateOrUpdate(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkWatcher parameters) + { + return ((INetworkWatchersOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all network watchers by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IEnumerable List(this INetworkWatchersOperations operations, string resourceGroupName) + /// + /// Creates or updates a network watcher in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkWatcher parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the specified network watcher by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NetworkWatcher Get(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName) + { + return ((INetworkWatchersOperations)operations).GetAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + } - /// - /// Gets all network watchers by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetworkWatchersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified network watcher by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified network watcher resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static void Delete(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName) + { + ((INetworkWatchersOperations)operations).DeleteAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + } - /// - /// Gets all network watchers by subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable ListAll(this INetworkWatchersOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all network watchers by subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this INetworkWatchersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the current network topology by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the representation of topology. - /// - public static Topology GetTopology(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TopologyParameters parameters) - { - return operations.GetTopologyAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the current network topology by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the representation of topology. - /// - /// - /// The cancellation token. - /// - public static async Task GetTopologyAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TopologyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetTopologyWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Verify IP flow from the specified VM to a location given the currently - /// configured NSG rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the IP flow to be verified. - /// - public static VerificationIPFlowResult VerifyIPFlow(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters) - { - return operations.VerifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Verify IP flow from the specified VM to a location given the currently - /// configured NSG rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the IP flow to be verified. - /// - /// - /// The cancellation token. - /// - public static async Task VerifyIPFlowAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.VerifyIPFlowWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the next hop from the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the source and destination endpoint. - /// - public static NextHopResult GetNextHop(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters) - { - return operations.GetNextHopAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified network watcher resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a network watcher tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NetworkWatcher UpdateTags(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TagsObject parameters) + { + return ((INetworkWatchersOperations)operations).UpdateTagsAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the next hop from the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the source and destination endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task GetNextHopAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates a network watcher tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetNextHopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all network watchers by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static System.Collections.Generic.IEnumerable List(this INetworkWatchersOperations operations, string resourceGroupName) + { + return ((INetworkWatchersOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets the configured and effective security group rules on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the VM to check security groups for. - /// - public static SecurityGroupViewResult GetVMSecurityRules(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters) + /// + /// Gets all network watchers by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetworkWatchersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all network watchers by subscription. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable ListAll(this INetworkWatchersOperations operations) + { + return ((INetworkWatchersOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Gets the configured and effective security group rules on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the VM to check security groups for. - /// - /// - /// The cancellation token. - /// - public static async Task GetVMSecurityRulesAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all network watchers by subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this INetworkWatchersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetVMSecurityRulesWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the current network topology by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static Topology GetTopology(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TopologyParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetTopologyAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Initiate troubleshooting on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to troubleshoot. - /// - public static TroubleshootingResult GetTroubleshooting(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters) + /// + /// Gets the current network topology by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetTopologyAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TopologyParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetTopologyWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static VerificationIPFlowResult VerifyIPFlow(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters) + { + return ((INetworkWatchersOperations)operations).VerifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Initiate troubleshooting on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to troubleshoot. - /// - /// - /// The cancellation token. - /// - public static async Task GetTroubleshootingAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task VerifyIPFlowAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.VerifyIPFlowWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetTroubleshootingWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the next hop from the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NextHopResult GetNextHop(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetNextHopAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Get the last completed troubleshooting result on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to query the troubleshooting result. - /// - public static TroubleshootingResult GetTroubleshootingResult(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters) + /// + /// Gets the next hop from the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetNextHopAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetNextHopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the configured and effective security group rules on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static SecurityGroupViewResult GetVMSecurityRules(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Get the last completed troubleshooting result on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to query the troubleshooting result. - /// - /// - /// The cancellation token. - /// - public static async Task GetTroubleshootingResultAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the configured and effective security group rules on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVMSecurityRulesAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVMSecurityRulesWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetTroubleshootingResultWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Initiate troubleshooting on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static TroubleshootingResult GetTroubleshooting(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Configures flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the configuration of flow log. - /// - public static FlowLogInformation SetFlowLogConfiguration(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters) + /// + /// Initiate troubleshooting on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetTroubleshootingAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetTroubleshootingWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.SetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the last completed troubleshooting result on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static TroubleshootingResult GetTroubleshootingResult(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Configures flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the configuration of flow log. - /// - /// - /// The cancellation token. - /// - public static async Task SetFlowLogConfigurationAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the last completed troubleshooting result on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetTroubleshootingResultAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetTroubleshootingResultWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.SetFlowLogConfigurationWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Configures flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static FlowLogInformation SetFlowLogConfiguration(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters) + { + return ((INetworkWatchersOperations)operations).SetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Queries status of flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define a resource to query flow log and traffic analytics - /// (optional) status. - /// - public static FlowLogInformation GetFlowLogStatus(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters) + /// + /// Configures flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SetFlowLogConfigurationAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.SetFlowLogConfigurationWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static FlowLogInformation GetFlowLogStatus(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Queries status of flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define a resource to query flow log and traffic analytics - /// (optional) status. - /// - /// - /// The cancellation token. - /// - public static async Task GetFlowLogStatusAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetFlowLogStatusAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetFlowLogStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetFlowLogStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static ConnectivityInformation CheckConnectivity(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters) + { + return ((INetworkWatchersOperations)operations).CheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine how the connectivity check will be performed. - /// - public static ConnectivityInformation CheckConnectivity(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters) + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckConnectivityAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckConnectivityWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static AzureReachabilityReport GetAzureReachabilityReport(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine how the connectivity check will be performed. - /// - /// - /// The cancellation token. - /// - public static async Task CheckConnectivityAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAzureReachabilityReportAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAzureReachabilityReportWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CheckConnectivityWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static AvailableProvidersList ListAvailableProviders(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters) + { + return ((INetworkWatchersOperations)operations).ListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Gets the relative latency score for internet service providers - /// from a specified location to Azure regions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine Azure reachability report configuration. - /// - public static AzureReachabilityReport GetAzureReachabilityReport(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters) + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAvailableProvidersAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableProvidersWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NetworkConfigurationDiagnosticResponse GetNetworkConfigurationDiagnostic(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) + { + return ((INetworkWatchersOperations)operations).GetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Gets the relative latency score for internet service providers - /// from a specified location to Azure regions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine Azure reachability report configuration. - /// - /// - /// The cancellation token. - /// - public static async Task GetAzureReachabilityReportAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetNetworkConfigurationDiagnosticAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetAzureReachabilityReportWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified network watcher resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static void BeginDelete(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName) + { + ((INetworkWatchersOperations)operations).BeginDeleteAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + } - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Lists all available internet service providers for a specified - /// Azure region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that scope the list of available providers. - /// - public static AvailableProvidersList ListAvailableProviders(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters) - { - return operations.ListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified network watcher resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static VerificationIPFlowResult BeginVerifyIPFlow(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginVerifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Lists all available internet service providers for a specified - /// Azure region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that scope the list of available providers. - /// - /// - /// The cancellation token. - /// - public static async Task ListAvailableProvidersAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Verify IP flow from the specified VM to a location given the currently + /// configured NSG rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginVerifyIPFlowAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginVerifyIPFlowWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAvailableProvidersWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the next hop from the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NextHopResult BeginGetNextHop(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets Network Configuration Diagnostic data to help customers understand and - /// debug network behavior. It provides detailed information on what security - /// rules were applied to a specified traffic flow and the result of evaluating - /// these rules. Customers must provide details of a flow like source, - /// destination, protocol, etc. The API returns whether traffic was allowed or - /// denied, the rules evaluated for the specified flow and the evaluation - /// results. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters to get network configuration diagnostic. - /// - public static NetworkConfigurationDiagnosticResponse GetNetworkConfigurationDiagnostic(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) + /// + /// Gets the next hop from the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetNextHopAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetNextHopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the configured and effective security group rules on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static SecurityGroupViewResult BeginGetVMSecurityRules(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets Network Configuration Diagnostic data to help customers understand and - /// debug network behavior. It provides detailed information on what security - /// rules were applied to a specified traffic flow and the result of evaluating - /// these rules. Customers must provide details of a flow like source, - /// destination, protocol, etc. The API returns whether traffic was allowed or - /// denied, the rules evaluated for the specified flow and the evaluation - /// results. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters to get network configuration diagnostic. - /// - /// - /// The cancellation token. - /// - public static async Task GetNetworkConfigurationDiagnosticAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the configured and effective security group rules on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetVMSecurityRulesAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetVMSecurityRulesWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Initiate troubleshooting on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static TroubleshootingResult BeginGetTroubleshooting(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network watcher resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - public static void BeginDelete(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName) + /// + /// Initiate troubleshooting on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetTroubleshootingAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetTroubleshootingWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the last completed troubleshooting result on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static TroubleshootingResult BeginGetTroubleshootingResult(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network watcher resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the last completed troubleshooting result on a specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetTroubleshootingResultAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetTroubleshootingResultWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Configures flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static FlowLogInformation BeginSetFlowLogConfiguration(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters) + { + return ((INetworkWatchersOperations)operations).BeginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Verify IP flow from the specified VM to a location given the currently - /// configured NSG rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the IP flow to be verified. - /// - public static VerificationIPFlowResult BeginVerifyIPFlow(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters) + /// + /// Configures flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginSetFlowLogConfigurationAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginSetFlowLogConfigurationWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginVerifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static FlowLogInformation BeginGetFlowLogStatus(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Verify IP flow from the specified VM to a location given the currently - /// configured NSG rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the IP flow to be verified. - /// - /// - /// The cancellation token. - /// - public static async Task BeginVerifyIPFlowAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, VerificationIPFlowParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Queries status of flow log and traffic analytics (optional) on a specified + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetFlowLogStatusAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetFlowLogStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginVerifyIPFlowWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static ConnectivityInformation BeginCheckConnectivity(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the next hop from the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the source and destination endpoint. - /// - public static NextHopResult BeginGetNextHop(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters) + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCheckConnectivityAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCheckConnectivityWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static AzureReachabilityReport BeginGetAzureReachabilityReport(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the next hop from the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the source and destination endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetNextHopAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NextHopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Gets the relative latency score for internet service providers + /// from a specified location to Azure regions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetAzureReachabilityReportAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetAzureReachabilityReportWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginGetNextHopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + public static AvailableProvidersList BeginListAvailableProviders(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the configured and effective security group rules on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the VM to check security groups for. - /// - public static SecurityGroupViewResult BeginGetVMSecurityRules(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters) + /// + /// NOTE: This feature is currently in preview and still being tested for + /// stability. Lists all available internet service providers for a specified + /// Azure region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the network watcher resource group. + /// + /// + /// The name of the network watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListAvailableProvidersAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListAvailableProvidersWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + public static NetworkConfigurationDiagnosticResponse BeginGetNetworkConfigurationDiagnostic(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) + { + return ((INetworkWatchersOperations)operations).BeginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the configured and effective security group rules on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters that define the VM to check security groups for. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetVMSecurityRulesAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, SecurityGroupViewParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets Network Configuration Diagnostic data to help customers understand and + /// debug network behavior. It provides detailed information on what security + /// rules were applied to a specified traffic flow and the result of evaluating + /// these rules. Customers must provide details of a flow like source, + /// destination, protocol, etc. The API returns whether traffic was allowed or + /// denied, the rules evaluated for the specified flow and the evaluation + /// results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetNetworkConfigurationDiagnosticAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginGetVMSecurityRulesWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Initiate troubleshooting on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to troubleshoot. - /// - public static TroubleshootingResult BeginGetTroubleshooting(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters) - { - return operations.BeginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Initiate troubleshooting on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to troubleshoot. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetTroubleshootingAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, TroubleshootingParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetTroubleshootingWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the last completed troubleshooting result on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to query the troubleshooting result. - /// - public static TroubleshootingResult BeginGetTroubleshootingResult(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters) - { - return operations.BeginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Get the last completed troubleshooting result on a specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the resource to query the troubleshooting result. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetTroubleshootingResultAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, QueryTroubleshootingParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetTroubleshootingResultWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Configures flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the configuration of flow log. - /// - public static FlowLogInformation BeginSetFlowLogConfiguration(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters) - { - return operations.BeginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Configures flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define the configuration of flow log. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSetFlowLogConfigurationAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogInformation parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginSetFlowLogConfigurationWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Queries status of flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define a resource to query flow log and traffic analytics - /// (optional) status. - /// - public static FlowLogInformation BeginGetFlowLogStatus(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters) - { - return operations.BeginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Queries status of flow log and traffic analytics (optional) on a specified - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that define a resource to query flow log and traffic analytics - /// (optional) status. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetFlowLogStatusAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, FlowLogStatusParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetFlowLogStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine how the connectivity check will be performed. - /// - public static ConnectivityInformation BeginCheckConnectivity(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters) - { - return operations.BeginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine how the connectivity check will be performed. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCheckConnectivityAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, ConnectivityParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCheckConnectivityWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Gets the relative latency score for internet service providers - /// from a specified location to Azure regions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine Azure reachability report configuration. - /// - public static AzureReachabilityReport BeginGetAzureReachabilityReport(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters) - { - return operations.BeginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Gets the relative latency score for internet service providers - /// from a specified location to Azure regions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that determine Azure reachability report configuration. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetAzureReachabilityReportAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AzureReachabilityReportParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetAzureReachabilityReportWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Lists all available internet service providers for a specified - /// Azure region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that scope the list of available providers. - /// - public static AvailableProvidersList BeginListAvailableProviders(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters) - { - return operations.BeginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// NOTE: This feature is currently in preview and still being tested for - /// stability. Lists all available internet service providers for a specified - /// Azure region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the network watcher resource group. - /// - /// - /// The name of the network watcher resource. - /// - /// - /// Parameters that scope the list of available providers. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListAvailableProvidersAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListAvailableProvidersWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets Network Configuration Diagnostic data to help customers understand and - /// debug network behavior. It provides detailed information on what security - /// rules were applied to a specified traffic flow and the result of evaluating - /// these rules. Customers must provide details of a flow like source, - /// destination, protocol, etc. The API returns whether traffic was allowed or - /// denied, the rules evaluated for the specified flow and the evaluation - /// results. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters to get network configuration diagnostic. - /// - public static NetworkConfigurationDiagnosticResponse BeginGetNetworkConfigurationDiagnostic(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) - { - return operations.BeginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Gets Network Configuration Diagnostic data to help customers understand and - /// debug network behavior. It provides detailed information on what security - /// rules were applied to a specified traffic flow and the result of evaluating - /// these rules. Customers must provide details of a flow like source, - /// destination, protocol, etc. The API returns whether traffic was allowed or - /// denied, the rules evaluated for the specified flow and the evaluation - /// results. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// Parameters to get network configuration diagnostic. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetNetworkConfigurationDiagnosticAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/Operations.cs b/src/Network/Network.Management.Sdk/Generated/Operations.cs index faad4a9bbe80..056464eabc46 100644 --- a/src/Network/Network.Management.Sdk/Generated/Operations.cs +++ b/src/Network/Network.Management.Sdk/Generated/Operations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,13 +24,13 @@ internal partial class Operations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal Operations(NetworkManagementClient client) + internal Operations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,33 +47,47 @@ internal Operations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Network/operations").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -95,25 +97,24 @@ internal Operations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -125,55 +126,56 @@ internal Operations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -183,9 +185,10 @@ internal Operations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -196,25 +199,29 @@ internal Operations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the available Network Rest API operations. /// @@ -227,13 +234,13 @@ internal Operations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -242,51 +249,54 @@ internal Operations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -298,55 +308,56 @@ internal Operations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -356,9 +367,10 @@ internal Operations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -369,24 +381,28 @@ internal Operations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/OperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/OperationsExtensions.cs index 8191509c7ba2..433daa40e8d1 100644 --- a/src/Network/Network.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/OperationsExtensions.cs @@ -1,87 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for Operations /// public static partial class OperationsExtensions { - /// - /// Lists all of the available Network Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Lists all of the available Network Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all of the available Network Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the available Network Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the available Network Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all of the available Network Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOperations operations, string nextPageLink) + /// + /// Lists all of the available Network Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all of the available Network Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperations.cs index ce0e91db4ae3..cc861c8880c0 100644 --- a/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperations.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// P2sVpnGatewaysOperations operations. + /// P2SVpnGatewaysOperations operations. /// - internal partial class P2sVpnGatewaysOperations : IServiceOperations, IP2sVpnGatewaysOperations + internal partial class P2SVpnGatewaysOperations : Microsoft.Rest.IServiceOperations, IP2SVpnGatewaysOperations { /// - /// Initializes a new instance of the P2sVpnGatewaysOperations class. + /// Initializes a new instance of the P2SVpnGatewaysOperations class. /// /// /// Reference to the service client. @@ -36,13 +24,13 @@ internal partial class P2sVpnGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal P2sVpnGatewaysOperations(NetworkManagementClient client) + internal P2SVpnGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,28 +225,31 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - /// existing gateway. + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. /// /// /// The resource group name of the P2SVpnGateway. @@ -258,16 +261,16 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -283,16 +286,16 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update a virtual wan p2s vpn gateway tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -305,16 +308,16 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// The name of the gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -329,13 +332,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -344,35 +347,45 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -382,25 +395,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -412,55 +424,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -470,9 +483,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -483,25 +497,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the P2SVpnGateways in a subscription. /// @@ -511,13 +529,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -526,29 +544,38 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -558,25 +585,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -588,55 +614,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -646,9 +673,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -659,25 +687,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the primary of the p2s vpn gateway in the specified resource group. /// @@ -688,21 +720,20 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// The name of the gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified - /// resource group. + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. /// /// /// The name of the resource group. @@ -715,21 +746,20 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway - /// in the specified resource group. + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. /// /// /// The name of the resource group. @@ -738,21 +768,20 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// The name of the P2SVpnGateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetP2sVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetP2SVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetP2sVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetP2SVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the sas url to get the connection health detail of P2S clients of the - /// virtual wan P2SVpnGateway in the specified resource group. + /// Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. /// /// /// The name of the resource group. @@ -764,46 +793,45 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// Request parameters supplied to get p2s vpn connections detailed health. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the - /// specified resource group. + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. /// /// /// The name of the resource group. /// - /// + /// /// The name of the P2S Vpn Gateway. /// /// /// The parameters are supplied to disconnect p2s vpn connections. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DisconnectP2sVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DisconnectP2SVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDisconnectP2sVpnConnectionsWithHttpMessagesAsync(resourceGroupName, p2sVpnGatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDisconnectP2SVpnConnectionsWithHttpMessagesAsync(resourceGroupName, p2SVpnGatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the /// existing gateway. /// /// @@ -821,13 +849,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -836,46 +864,58 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (p2SVpnGatewayParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (gatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (p2SVpnGatewayParameters == null) + + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("p2SVpnGatewayParameters", p2SVpnGatewayParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -885,25 +925,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -915,61 +954,62 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(p2SVpnGatewayParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(p2SVpnGatewayParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(p2SVpnGatewayParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -979,9 +1019,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -992,16 +1033,16 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1010,25 +1051,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates virtual wan p2s vpn gateway tags. /// @@ -1047,13 +1092,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1062,46 +1107,57 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (p2SVpnGatewayParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (gatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (p2SVpnGatewayParameters == null) + + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("p2SVpnGatewayParameters", p2SVpnGatewayParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1111,25 +1167,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1141,61 +1196,62 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(p2SVpnGatewayParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(p2SVpnGatewayParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(p2SVpnGatewayParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1205,9 +1261,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1218,25 +1275,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a virtual wan p2s vpn gateway. /// @@ -1252,10 +1313,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1264,41 +1325,52 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1308,25 +1380,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1338,55 +1409,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1396,20 +1468,25 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the primary of the p2s vpn gateway in the specified resource group. /// @@ -1425,13 +1502,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1440,41 +1517,52 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1484,25 +1572,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1514,55 +1601,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1572,9 +1660,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1585,25 +1674,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified /// resource group. @@ -1624,13 +1717,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1639,46 +1732,58 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (gatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateVpnProfile", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateVpnProfile", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1688,25 +1793,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1718,61 +1822,62 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1782,9 +1887,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1795,25 +1901,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway /// in the specified resource group. @@ -1830,13 +1940,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1845,41 +1955,52 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetP2sVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetP2SVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetP2sVpnConnectionHealth", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetP2SVpnConnectionHealth", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1889,25 +2010,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1919,55 +2039,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1977,9 +2098,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1990,25 +2112,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the sas url to get the connection health detail of P2S clients of the /// virtual wan P2SVpnGateway in the specified resource group. @@ -2028,13 +2154,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2043,46 +2169,58 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (gatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (request == null) + + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("request", request); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetP2sVpnConnectionHealthDetailed", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetP2SVpnConnectionHealthDetailed", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2092,25 +2230,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2122,61 +2259,62 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2186,9 +2324,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2199,25 +2338,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the /// specified resource group. @@ -2225,7 +2368,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The name of the resource group. /// - /// + /// /// The name of the P2S Vpn Gateway. /// /// @@ -2237,10 +2380,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2249,46 +2392,58 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDisconnectP2sVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDisconnectP2SVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (p2sVpnGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "p2sVpnGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (request == null) + + if (p2SVpnGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "p2SVpnGatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("p2sVpnGatewayName", p2sVpnGatewayName); - tracingParameters.Add("request", request); + tracingParameters.Add("p2SVpnGatewayName", p2SVpnGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDisconnectP2sVpnConnections", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDisconnectP2SVpnConnections", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{p2sVpnGatewayName}", System.Uri.EscapeDataString(p2sVpnGatewayName)); - List _queryParameters = new List(); + _url = _url.Replace("{p2sVpnGatewayName}", System.Uri.EscapeDataString(p2SVpnGatewayName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2298,25 +2453,24 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2328,61 +2482,62 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2392,20 +2547,25 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the P2SVpnGateways in a resource group. /// @@ -2418,13 +2578,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2433,51 +2593,54 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2489,55 +2652,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2547,9 +2711,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2560,25 +2725,29 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the P2SVpnGateways in a subscription. /// @@ -2591,13 +2760,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2606,51 +2775,54 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2662,55 +2834,56 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2720,9 +2893,10 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2733,24 +2907,28 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperationsExtensions.cs index 91bdfff5d706..9624c9db49eb 100644 --- a/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/P2sVpnGatewaysOperationsExtensions.cs @@ -1,907 +1,813 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for P2sVpnGatewaysOperations. + /// Extension methods for P2SVpnGatewaysOperations /// - public static partial class P2sVpnGatewaysOperationsExtensions + public static partial class P2SVpnGatewaysOperationsExtensions { - /// - /// Retrieves the details of a virtual wan p2s vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - public static P2SVpnGateway Get(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - return operations.GetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a virtual wan p2s vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. - /// - public static P2SVpnGateway CreateOrUpdate(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. - /// - public static P2SVpnGateway UpdateTags(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters) - { - return operations.UpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a virtual wan p2s vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - public static void Delete(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - operations.DeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a virtual wan p2s vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the P2SVpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - public static IPage ListByResourceGroup(this IP2sVpnGatewaysOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the P2SVpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the P2SVpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IP2sVpnGatewaysOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the P2SVpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IP2sVpnGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the primary of the p2s vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - public static P2SVpnGateway Reset(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - return operations.ResetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Resets the primary of the p2s vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task ResetAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Parameters supplied to the generate P2SVpnGateway VPN client package - /// operation. - /// - public static VpnProfileResponse GenerateVpnProfile(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters) - { - return operations.GenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Parameters supplied to the generate P2SVpnGateway VPN client package - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateVpnProfileAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - public static P2SVpnGateway GetP2sVpnConnectionHealth(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - return operations.GetP2sVpnConnectionHealthAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetP2sVpnConnectionHealthAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetP2sVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the sas url to get the connection health detail of P2S clients of the - /// virtual wan P2SVpnGateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Request parameters supplied to get p2s vpn connections detailed health. - /// - public static P2SVpnConnectionHealth GetP2sVpnConnectionHealthDetailed(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request) - { - return operations.GetP2sVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).GetAwaiter().GetResult(); - } - - /// - /// Gets the sas url to get the connection health detail of P2S clients of the - /// virtual wan P2SVpnGateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Request parameters supplied to get p2s vpn connections detailed health. - /// - /// - /// The cancellation token. - /// - public static async Task GetP2sVpnConnectionHealthDetailedAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2S Vpn Gateway. - /// - /// - /// The parameters are supplied to disconnect p2s vpn connections. - /// - public static void DisconnectP2sVpnConnections(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request) - { - operations.DisconnectP2sVpnConnectionsAsync(resourceGroupName, p2sVpnGatewayName, request).GetAwaiter().GetResult(); - } - - /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2S Vpn Gateway. - /// - /// - /// The parameters are supplied to disconnect p2s vpn connections. - /// - /// - /// The cancellation token. - /// - public static async Task DisconnectP2sVpnConnectionsAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DisconnectP2sVpnConnectionsWithHttpMessagesAsync(resourceGroupName, p2sVpnGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. - /// - public static P2SVpnGateway BeginCreateOrUpdate(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. - /// - public static P2SVpnGateway BeginUpdateTags(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a virtual wan p2s vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - public static void BeginDelete(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - operations.BeginDeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a virtual wan p2s vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Resets the primary of the p2s vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - public static P2SVpnGateway BeginReset(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - return operations.BeginResetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Resets the primary of the p2s vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Parameters supplied to the generate P2SVpnGateway VPN client package - /// operation. - /// - public static VpnProfileResponse BeginGenerateVpnProfile(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters) - { - return operations.BeginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Parameters supplied to the generate P2SVpnGateway VPN client package - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGenerateVpnProfileAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - public static P2SVpnGateway BeginGetP2sVpnConnectionHealth(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - return operations.BeginGetP2sVpnConnectionHealthAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetP2sVpnConnectionHealthAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetP2sVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the sas url to get the connection health detail of P2S clients of the - /// virtual wan P2SVpnGateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Request parameters supplied to get p2s vpn connections detailed health. - /// - public static P2SVpnConnectionHealth BeginGetP2sVpnConnectionHealthDetailed(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request) - { - return operations.BeginGetP2sVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).GetAwaiter().GetResult(); - } - - /// - /// Gets the sas url to get the connection health detail of P2S clients of the - /// virtual wan P2SVpnGateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Request parameters supplied to get p2s vpn connections detailed health. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetP2sVpnConnectionHealthDetailedAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2S Vpn Gateway. - /// - /// - /// The parameters are supplied to disconnect p2s vpn connections. - /// - public static void BeginDisconnectP2sVpnConnections(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request) - { - operations.BeginDisconnectP2sVpnConnectionsAsync(resourceGroupName, p2sVpnGatewayName, request).GetAwaiter().GetResult(); - } - - /// - /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2S Vpn Gateway. - /// - /// - /// The parameters are supplied to disconnect p2s vpn connections. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDisconnectP2sVpnConnectionsAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string p2sVpnGatewayName, P2SVpnConnectionRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDisconnectP2sVpnConnectionsWithHttpMessagesAsync(resourceGroupName, p2sVpnGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the P2SVpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IP2sVpnGatewaysOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the P2SVpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IP2sVpnGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the P2SVpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IP2sVpnGatewaysOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the P2SVpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IP2sVpnGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Retrieves the details of a virtual wan p2s vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway Get(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + return ((IP2SVpnGatewaysOperations)operations).GetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the details of a virtual wan p2s vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway CreateOrUpdate(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters) + { + return ((IP2SVpnGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates virtual wan p2s vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway UpdateTags(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters) + { + return ((IP2SVpnGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates virtual wan p2s vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a virtual wan p2s vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static void Delete(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + ((IP2SVpnGatewaysOperations)operations).DeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a virtual wan p2s vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the P2SVpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IP2SVpnGatewaysOperations operations, string resourceGroupName) + { + return ((IP2SVpnGatewaysOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the P2SVpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the P2SVpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IP2SVpnGatewaysOperations operations) + { + return ((IP2SVpnGatewaysOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the P2SVpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IP2SVpnGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the primary of the p2s vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway Reset(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + return ((IP2SVpnGatewaysOperations)operations).ResetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Resets the primary of the p2s vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + public static VpnProfileResponse GenerateVpnProfile(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters) + { + return ((IP2SVpnGatewaysOperations)operations).GenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateVpnProfileAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + public static P2SVpnGateway GetP2SVpnConnectionHealth(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + return ((IP2SVpnGatewaysOperations)operations).GetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetP2SVpnConnectionHealthAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetP2SVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + public static P2SVpnConnectionHealth GetP2SVpnConnectionHealthDetailed(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request) + { + return ((IP2SVpnGatewaysOperations)operations).GetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).GetAwaiter().GetResult(); + } + + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetP2SVpnConnectionHealthDetailedAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2S Vpn Gateway. + /// + public static void DisconnectP2SVpnConnections(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request) + { + ((IP2SVpnGatewaysOperations)operations).DisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request).GetAwaiter().GetResult(); + } + + /// + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2S Vpn Gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DisconnectP2SVpnConnectionsAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DisconnectP2SVpnConnectionsWithHttpMessagesAsync(resourceGroupName, p2SVpnGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway BeginCreateOrUpdate(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters) + { + return ((IP2SVpnGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates virtual wan p2s vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway BeginUpdateTags(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters) + { + return ((IP2SVpnGatewaysOperations)operations).BeginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates virtual wan p2s vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a virtual wan p2s vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static void BeginDelete(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + ((IP2SVpnGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a virtual wan p2s vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Resets the primary of the p2s vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + public static P2SVpnGateway BeginReset(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + return ((IP2SVpnGatewaysOperations)operations).BeginResetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Resets the primary of the p2s vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + public static VpnProfileResponse BeginGenerateVpnProfile(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters) + { + return ((IP2SVpnGatewaysOperations)operations).BeginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGenerateVpnProfileAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + public static P2SVpnGateway BeginGetP2SVpnConnectionHealth(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + return ((IP2SVpnGatewaysOperations)operations).BeginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetP2SVpnConnectionHealthAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetP2SVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + public static P2SVpnConnectionHealth BeginGetP2SVpnConnectionHealthDetailed(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request) + { + return ((IP2SVpnGatewaysOperations)operations).BeginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).GetAwaiter().GetResult(); + } + + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetP2SVpnConnectionHealthDetailedAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetP2SVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2S Vpn Gateway. + /// + public static void BeginDisconnectP2SVpnConnections(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request) + { + ((IP2SVpnGatewaysOperations)operations).BeginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request).GetAwaiter().GetResult(); + } + + /// + /// Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2S Vpn Gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDisconnectP2SVpnConnectionsAsync(this IP2SVpnGatewaysOperations operations, string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDisconnectP2SVpnConnectionsWithHttpMessagesAsync(resourceGroupName, p2SVpnGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the P2SVpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IP2SVpnGatewaysOperations operations, string nextPageLink) + { + return ((IP2SVpnGatewaysOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the P2SVpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IP2SVpnGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the P2SVpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IP2SVpnGatewaysOperations operations, string nextPageLink) + { + return ((IP2SVpnGatewaysOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the P2SVpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IP2SVpnGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperations.cs b/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperations.cs index 4fb7ff04e8d8..cfd264cfd5d8 100644 --- a/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PacketCapturesOperations operations. /// - internal partial class PacketCapturesOperations : IServiceOperations, IPacketCapturesOperations + internal partial class PacketCapturesOperations : Microsoft.Rest.IServiceOperations, IPacketCapturesOperations { /// /// Initializes a new instance of the PacketCapturesOperations class. @@ -36,13 +24,13 @@ internal partial class PacketCapturesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PacketCapturesOperations(NetworkManagementClient client) + internal PacketCapturesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,16 +54,16 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// Parameters that define the create packet capture operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -96,13 +84,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -111,47 +99,59 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (packetCaptureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "packetCaptureName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -161,25 +161,24 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -191,50 +190,51 @@ internal PacketCapturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -244,9 +244,10 @@ internal PacketCapturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -257,25 +258,29 @@ internal PacketCapturesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified packet capture session. /// @@ -289,16 +294,16 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// The name of the packet capture session. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -314,16 +319,16 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// The name of the packet capture session. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -339,16 +344,16 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// The name given to the packet capture session. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -366,13 +371,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -381,41 +386,52 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -425,25 +441,24 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -455,50 +470,51 @@ internal PacketCapturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -508,9 +524,10 @@ internal PacketCapturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -521,25 +538,29 @@ internal PacketCapturesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create and start a packet capture on the specified VM. /// @@ -561,13 +582,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -576,56 +597,68 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (networkWatcherName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + parameters.Validate(); } - if (packetCaptureName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } - if (parameters != null) + + if (packetCaptureName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "packetCaptureName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -635,25 +668,24 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -665,56 +697,57 @@ internal PacketCapturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -724,9 +757,10 @@ internal PacketCapturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -737,25 +771,29 @@ internal PacketCapturesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified packet capture session. /// @@ -774,10 +812,10 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -786,47 +824,59 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (packetCaptureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "packetCaptureName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -836,25 +886,24 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -866,50 +915,51 @@ internal PacketCapturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -919,20 +969,25 @@ internal PacketCapturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops a specified packet capture session. /// @@ -951,10 +1006,10 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -963,47 +1018,59 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (packetCaptureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "packetCaptureName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1013,25 +1080,24 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1043,50 +1109,51 @@ internal PacketCapturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1096,20 +1163,25 @@ internal PacketCapturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Query the status of a running packet capture session. /// @@ -1128,13 +1200,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1143,47 +1215,59 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetStatusWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkWatcherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkWatcherName"); } + if (packetCaptureName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "packetCaptureName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1193,25 +1277,24 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1223,50 +1306,51 @@ internal PacketCapturesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1276,9 +1360,10 @@ internal PacketCapturesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1289,16 +1374,16 @@ internal PacketCapturesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1307,24 +1392,28 @@ internal PacketCapturesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperationsExtensions.cs index 01f2b435288e..b89ee4601930 100644 --- a/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PacketCapturesOperationsExtensions.cs @@ -1,481 +1,448 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PacketCapturesOperations. + /// Extension methods for PacketCapturesOperations /// public static partial class PacketCapturesOperationsExtensions { - /// - /// Create and start a packet capture on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// Parameters that define the create packet capture operation. - /// - public static PacketCaptureResult Create(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters) - { - return operations.CreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create and start a packet capture on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// Parameters that define the create packet capture operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a packet capture session by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - public static PacketCaptureResult Get(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) - { - return operations.GetAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); - } - - /// - /// Gets a packet capture session by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Create and start a packet capture on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static PacketCaptureResult Create(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters) + { + return ((IPacketCapturesOperations)operations).CreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - public static void Delete(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + /// + /// Create and start a packet capture on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a packet capture session by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static PacketCaptureResult Get(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + return ((IPacketCapturesOperations)operations).GetAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a packet capture session by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static void Delete(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + ((IPacketCapturesOperations)operations).DeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Stops a specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - public static void Stop(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) - { - operations.StopAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stops a specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static void Stop(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + ((IPacketCapturesOperations)operations).StopAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Stops a specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task StopAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Stops a specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Query the status of a running packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the packet capture session. + /// + public static PacketCaptureQueryStatusResult GetStatus(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + return ((IPacketCapturesOperations)operations).GetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Query the status of a running packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the packet capture session. - /// - public static PacketCaptureQueryStatusResult GetStatus(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + /// + /// Query the status of a running packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetStatusAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all packet capture sessions within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Watcher resource. + /// + public static System.Collections.Generic.IEnumerable List(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName) + { + return ((IPacketCapturesOperations)operations).ListAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + } - /// - /// Query the status of a running packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task GetStatusAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all packet capture sessions within the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create and start a packet capture on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static PacketCaptureResult BeginCreate(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters) + { + return ((IPacketCapturesOperations)operations).BeginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all packet capture sessions within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Watcher resource. - /// - public static IEnumerable List(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName) + /// + /// Create and start a packet capture on the specified VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkWatcherName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static void BeginDelete(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + ((IPacketCapturesOperations)operations).BeginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Lists all packet capture sessions within the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkWatcherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stops a specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + public static void BeginStop(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + ((IPacketCapturesOperations)operations).BeginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Create and start a packet capture on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// Parameters that define the create packet capture operation. - /// - public static PacketCaptureResult BeginCreate(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters) - { - return operations.BeginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).GetAwaiter().GetResult(); - } + /// + /// Stops a specified packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// The name of the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Query the status of a running packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the packet capture session. + /// + public static PacketCaptureQueryStatusResult BeginGetStatus(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) + { + return ((IPacketCapturesOperations)operations).BeginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); + } - /// - /// Create and start a packet capture on the specified VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// Parameters that define the create packet capture operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, PacketCapture parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Query the status of a running packet capture session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Watcher resource. + /// + /// + /// The name given to the packet capture session. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetStatusAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes the specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - public static void BeginDelete(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) - { - operations.BeginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stops a specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - public static void BeginStop(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) - { - operations.BeginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); - } - - /// - /// Stops a specified packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network watcher. - /// - /// - /// The name of the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Query the status of a running packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the packet capture session. - /// - public static PacketCaptureQueryStatusResult BeginGetStatus(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName) - { - return operations.BeginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).GetAwaiter().GetResult(); - } - - /// - /// Query the status of a running packet capture session. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Watcher resource. - /// - /// - /// The name given to the packet capture session. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetStatusAsync(this IPacketCapturesOperations operations, string resourceGroupName, string networkWatcherName, string packetCaptureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetStatusWithHttpMessagesAsync(resourceGroupName, networkWatcherName, packetCaptureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperations.cs index 87df5ba5e1e4..461f37547eac 100644 --- a/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PeerExpressRouteCircuitConnectionsOperations operations. /// - internal partial class PeerExpressRouteCircuitConnectionsOperations : IServiceOperations, IPeerExpressRouteCircuitConnectionsOperations + internal partial class PeerExpressRouteCircuitConnectionsOperations : Microsoft.Rest.IServiceOperations, IPeerExpressRouteCircuitConnectionsOperations { /// /// Initializes a new instance of the PeerExpressRouteCircuitConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class PeerExpressRouteCircuitConnectionsOperations : IServiceOp /// /// Thrown when a required parameter is null /// - internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient client) + internal PeerExpressRouteCircuitConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -72,13 +60,13 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -87,53 +75,66 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -143,25 +144,24 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -173,55 +173,56 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -231,9 +232,10 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -244,25 +246,29 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all global reach peer connections associated with a private peering in /// an express route circuit. @@ -282,13 +288,13 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -297,47 +303,59 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -347,25 +365,24 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -377,55 +394,56 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -435,9 +453,10 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -448,25 +467,29 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all global reach peer connections associated with a private peering in /// an express route circuit. @@ -480,13 +503,13 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -495,51 +518,54 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -551,55 +577,56 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -609,9 +636,10 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -622,24 +650,28 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperationsExtensions.cs index 9b9fb99d68b9..aadd2f379e11 100644 --- a/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PeerExpressRouteCircuitConnectionsOperationsExtensions.cs @@ -1,163 +1,151 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PeerExpressRouteCircuitConnectionsOperations. + /// Extension methods for PeerExpressRouteCircuitConnectionsOperations /// public static partial class PeerExpressRouteCircuitConnectionsOperationsExtensions { - /// - /// Gets the specified Peer Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the peer express route circuit connection. - /// - public static PeerExpressRouteCircuitConnection Get(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) - { - return operations.GetAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Peer Express Route Circuit Connection from the specified - /// express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The name of the peer express route circuit connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets the specified Peer Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the peer express route circuit connection. + /// + public static PeerExpressRouteCircuitConnection Get(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + return ((IPeerExpressRouteCircuitConnectionsOperations)operations).GetAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Gets all global reach peer connections associated with a private peering in - /// an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - public static IPage List(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// Gets the specified Peer Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the peer express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The name of the peering. + /// + public static Microsoft.Rest.Azure.IPage List(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName) + { + return ((IPeerExpressRouteCircuitConnectionsOperations)operations).ListAsync(resourceGroupName, circuitName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Gets all global reach peer connections associated with a private peering in - /// an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPeerExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPeerExpressRouteCircuitConnectionsOperations operations, string nextPageLink) + { + return ((IPeerExpressRouteCircuitConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all global reach peer connections associated with a private peering in - /// an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPeerExpressRouteCircuitConnectionsOperations operations, string nextPageLink) + /// + /// Gets all global reach peer connections associated with a private peering in + /// an express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPeerExpressRouteCircuitConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all global reach peer connections associated with a private peering in - /// an express route circuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPeerExpressRouteCircuitConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperations.cs b/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperations.cs index 05eb011b0533..f1cd7076a32a 100644 --- a/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateDnsZoneGroupsOperations operations. /// - internal partial class PrivateDnsZoneGroupsOperations : IServiceOperations, IPrivateDnsZoneGroupsOperations + internal partial class PrivateDnsZoneGroupsOperations : Microsoft.Rest.IServiceOperations, IPrivateDnsZoneGroupsOperations { /// /// Initializes a new instance of the PrivateDnsZoneGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class PrivateDnsZoneGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) + internal PrivateDnsZoneGroupsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// The name of the private dns zone group. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -94,13 +82,13 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -109,47 +97,59 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } + if (privateDnsZoneGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateDnsZoneGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateDnsZoneGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointName", privateEndpointName); tracingParameters.Add("privateDnsZoneGroupName", privateDnsZoneGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); _url = _url.Replace("{privateDnsZoneGroupName}", System.Uri.EscapeDataString(privateDnsZoneGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -159,25 +159,24 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -189,55 +188,56 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -247,9 +247,10 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -260,28 +261,31 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates or updates a private dns zone group in the specified private - /// endpoint. + /// Creates or updates a private dns zone group in the specified private endpoint. /// /// /// The name of the resource group. @@ -297,16 +301,16 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -324,13 +328,13 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -339,41 +343,52 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string privateEndpointName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string privateEndpointName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("privateEndpointName", privateEndpointName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups").ToString(); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -383,25 +398,24 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -413,50 +427,51 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -466,9 +481,10 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -479,25 +495,29 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified private dns zone group. /// @@ -516,10 +536,10 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -528,47 +548,59 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } + if (privateDnsZoneGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateDnsZoneGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateDnsZoneGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointName", privateEndpointName); tracingParameters.Add("privateDnsZoneGroupName", privateDnsZoneGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); _url = _url.Replace("{privateDnsZoneGroupName}", System.Uri.EscapeDataString(privateDnsZoneGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -578,25 +610,24 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -608,55 +639,56 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -666,20 +698,25 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a private dns zone group in the specified private /// endpoint. @@ -703,13 +740,13 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -718,52 +755,65 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } + if (privateDnsZoneGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateDnsZoneGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateDnsZoneGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointName", privateEndpointName); tracingParameters.Add("privateDnsZoneGroupName", privateDnsZoneGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); _url = _url.Replace("{privateDnsZoneGroupName}", System.Uri.EscapeDataString(privateDnsZoneGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -773,25 +823,24 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -803,61 +852,62 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -867,9 +917,10 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -880,16 +931,16 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -898,25 +949,29 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private dns zone groups in a private endpoint. /// @@ -929,13 +984,13 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -944,51 +999,54 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1000,50 +1058,51 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1053,9 +1112,10 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1066,24 +1126,28 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperationsExtensions.cs index e80b1b6a567d..8e080c3677f4 100644 --- a/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PrivateDnsZoneGroupsOperationsExtensions.cs @@ -1,345 +1,313 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PrivateDnsZoneGroupsOperations. + /// Extension methods for PrivateDnsZoneGroupsOperations /// public static partial class PrivateDnsZoneGroupsOperationsExtensions { - /// - /// Deletes the specified private dns zone group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - public static void Delete(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName) - { - operations.DeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified private dns zone group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the private dns zone group resource by specified private dns zone - /// group name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - public static PrivateDnsZoneGroup Get(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName) - { - return operations.GetAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets the private dns zone group resource by specified private dns zone - /// group name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a private dns zone group in the specified private - /// endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// Parameters supplied to the create or update private dns zone group - /// operation. - /// - public static PrivateDnsZoneGroup CreateOrUpdate(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified private dns zone group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + public static void Delete(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName) + { + ((IPrivateDnsZoneGroupsOperations)operations).DeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a private dns zone group in the specified private - /// endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// Parameters supplied to the create or update private dns zone group - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified private dns zone group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the private dns zone group resource by specified private dns zone + /// group name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + public static PrivateDnsZoneGroup Get(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName) + { + return ((IPrivateDnsZoneGroupsOperations)operations).GetAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all private dns zone groups in a private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IPrivateDnsZoneGroupsOperations operations, string privateEndpointName, string resourceGroupName) + /// + /// Gets the private dns zone group resource by specified private dns zone + /// group name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(privateEndpointName, resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a private dns zone group in the specified private + /// endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + public static PrivateDnsZoneGroup CreateOrUpdate(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters) + { + return ((IPrivateDnsZoneGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all private dns zone groups in a private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPrivateDnsZoneGroupsOperations operations, string privateEndpointName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a private dns zone group in the specified private + /// endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(privateEndpointName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all private dns zone groups in a private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IPrivateDnsZoneGroupsOperations operations, string privateEndpointName, string resourceGroupName) + { + return ((IPrivateDnsZoneGroupsOperations)operations).ListAsync(privateEndpointName, resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified private dns zone group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - public static void BeginDelete(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName) + /// + /// Gets all private dns zone groups in a private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPrivateDnsZoneGroupsOperations operations, string privateEndpointName, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(privateEndpointName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified private dns zone group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + public static void BeginDelete(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName) + { + ((IPrivateDnsZoneGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified private dns zone group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified private dns zone group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a private dns zone group in the specified private + /// endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + public static PrivateDnsZoneGroup BeginCreateOrUpdate(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters) + { + return ((IPrivateDnsZoneGroupsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a private dns zone group in the specified private - /// endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// Parameters supplied to the create or update private dns zone group - /// operation. - /// - public static PrivateDnsZoneGroup BeginCreateOrUpdate(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters) + /// + /// Creates or updates a private dns zone group in the specified private + /// endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The name of the private dns zone group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all private dns zone groups in a private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPrivateDnsZoneGroupsOperations operations, string nextPageLink) + { + return ((IPrivateDnsZoneGroupsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a private dns zone group in the specified private - /// endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The name of the private dns zone group. - /// - /// - /// Parameters supplied to the create or update private dns zone group - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IPrivateDnsZoneGroupsOperations operations, string resourceGroupName, string privateEndpointName, string privateDnsZoneGroupName, PrivateDnsZoneGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all private dns zone groups in a private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPrivateDnsZoneGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all private dns zone groups in a private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPrivateDnsZoneGroupsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all private dns zone groups in a private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPrivateDnsZoneGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperations.cs b/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperations.cs index a43924f1ae8b..eafa40437847 100644 --- a/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateEndpointsOperations operations. /// - internal partial class PrivateEndpointsOperations : IServiceOperations, IPrivateEndpointsOperations + internal partial class PrivateEndpointsOperations : Microsoft.Rest.IServiceOperations, IPrivateEndpointsOperations { /// /// Initializes a new instance of the PrivateEndpointsOperations class. @@ -36,13 +24,13 @@ internal partial class PrivateEndpointsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PrivateEndpointsOperations(NetworkManagementClient client) + internal PrivateEndpointsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// The name of the private endpoint. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointName", privateEndpointName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,50 +183,51 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -237,9 +237,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -250,25 +251,29 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an private endpoint in the specified resource group. /// @@ -282,16 +287,16 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update private endpoint operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -306,13 +311,13 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -321,35 +326,45 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -359,25 +374,24 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -389,50 +403,51 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -442,9 +457,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -455,25 +471,29 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private endpoints in a subscription. /// @@ -483,13 +503,13 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -498,29 +518,38 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -530,25 +559,24 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -560,50 +588,51 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -613,9 +642,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -626,25 +656,29 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified private endpoint. /// @@ -660,10 +694,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -672,41 +706,52 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointName", privateEndpointName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -716,25 +761,24 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -746,50 +790,51 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -799,20 +844,25 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an private endpoint in the specified resource group. /// @@ -831,13 +881,13 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -846,46 +896,58 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (privateEndpointName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (privateEndpointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointName", privateEndpointName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -895,25 +957,24 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -925,56 +986,57 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -984,9 +1046,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -997,16 +1060,16 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1015,25 +1078,29 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private endpoints in a resource group. /// @@ -1046,13 +1113,13 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1061,51 +1128,54 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1117,50 +1187,51 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1170,9 +1241,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1183,25 +1255,29 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private endpoints in a subscription. /// @@ -1214,13 +1290,13 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1229,51 +1305,54 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1285,50 +1364,51 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1338,9 +1418,10 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1351,24 +1432,28 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperationsExtensions.cs index ceb8c5a55736..e9decf475258 100644 --- a/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PrivateEndpointsOperationsExtensions.cs @@ -1,367 +1,337 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PrivateEndpointsOperations. + /// Extension methods for PrivateEndpointsOperations /// public static partial class PrivateEndpointsOperationsExtensions { - /// - /// Deletes the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - public static void Delete(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName) - { - operations.DeleteAsync(resourceGroupName, privateEndpointName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified private endpoint by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// Expands referenced resources. - /// - public static PrivateEndpoint Get(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, privateEndpointName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified private endpoint by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateEndpointName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an private endpoint in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// Parameters supplied to the create or update private endpoint operation. - /// - public static PrivateEndpoint CreateOrUpdate(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an private endpoint in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// Parameters supplied to the create or update private endpoint operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all private endpoints in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IPrivateEndpointsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all private endpoints in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + public static void Delete(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName) + { + ((IPrivateEndpointsOperations)operations).DeleteAsync(resourceGroupName, privateEndpointName).GetAwaiter().GetResult(); + } - /// - /// Gets all private endpoints in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IPrivateEndpointsOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all private endpoints in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IPrivateEndpointsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified private endpoint by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// Expands referenced resources. + /// + public static PrivateEndpoint Get(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, string expand = default(string)) + { + return ((IPrivateEndpointsOperations)operations).GetAsync(resourceGroupName, privateEndpointName, expand).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - public static void BeginDelete(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName) + /// + /// Gets the specified private endpoint by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateEndpointName, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, privateEndpointName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates an private endpoint in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + public static PrivateEndpoint CreateOrUpdate(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters) + { + return ((IPrivateEndpointsOperations)operations).CreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an private endpoint in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Gets all private endpoints in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IPrivateEndpointsOperations operations, string resourceGroupName) + { + return ((IPrivateEndpointsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates an private endpoint in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// Parameters supplied to the create or update private endpoint operation. - /// - public static PrivateEndpoint BeginCreateOrUpdate(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters) + /// + /// Gets all private endpoints in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all private endpoints in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IPrivateEndpointsOperations operations) + { + return ((IPrivateEndpointsOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Creates or updates an private endpoint in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private endpoint. - /// - /// - /// Parameters supplied to the create or update private endpoint operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all private endpoints in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IPrivateEndpointsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + public static void BeginDelete(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName) + { + ((IPrivateEndpointsOperations)operations).BeginDeleteAsync(resourceGroupName, privateEndpointName).GetAwaiter().GetResult(); + } - /// - /// Gets all private endpoints in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPrivateEndpointsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified private endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an private endpoint in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + public static PrivateEndpoint BeginCreateOrUpdate(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters) + { + return ((IPrivateEndpointsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all private endpoints in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPrivateEndpointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates an private endpoint in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private endpoint. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string privateEndpointName, PrivateEndpoint parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateEndpointName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all private endpoints in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPrivateEndpointsOperations operations, string nextPageLink) + { + return ((IPrivateEndpointsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all private endpoints in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IPrivateEndpointsOperations operations, string nextPageLink) + /// + /// Gets all private endpoints in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPrivateEndpointsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all private endpoints in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IPrivateEndpointsOperations operations, string nextPageLink) + { + return ((IPrivateEndpointsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all private endpoints in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IPrivateEndpointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all private endpoints in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IPrivateEndpointsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperations.cs b/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperations.cs index 56c57e8f14db..5ea4ee82c23d 100644 --- a/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PrivateLinkServicesOperations operations. /// - internal partial class PrivateLinkServicesOperations : IServiceOperations, IPrivateLinkServicesOperations + internal partial class PrivateLinkServicesOperations : Microsoft.Rest.IServiceOperations, IPrivateLinkServicesOperations { /// /// Initializes a new instance of the PrivateLinkServicesOperations class. @@ -36,13 +24,13 @@ internal partial class PrivateLinkServicesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PrivateLinkServicesOperations(NetworkManagementClient client) + internal PrivateLinkServicesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// The name of the private link service. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,50 +183,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -237,9 +237,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -250,25 +251,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an private link service in the specified resource group. /// @@ -282,16 +287,16 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update private link service operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -306,13 +311,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -321,35 +326,45 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -359,25 +374,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -389,50 +403,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -442,9 +457,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -455,25 +471,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private link service in a subscription. /// @@ -483,13 +503,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -498,29 +518,38 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -530,25 +559,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -560,50 +588,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -613,9 +642,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -626,25 +656,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specific private end point connection by specific private link /// service in the resource group. @@ -667,13 +701,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -682,48 +716,61 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } + if (peConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("peConnectionName", peConnectionName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{peConnectionName}", System.Uri.EscapeDataString(peConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -737,25 +784,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -767,50 +813,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -820,9 +867,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -833,25 +881,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Approve or reject private end point connection for a private link service /// in a subscription. @@ -874,13 +926,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -889,52 +941,65 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } + if (peConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peConnectionName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("peConnectionName", peConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePrivateEndpointConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdatePrivateEndpointConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{peConnectionName}", System.Uri.EscapeDataString(peConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -944,25 +1009,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -974,56 +1038,57 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1033,9 +1098,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1046,28 +1112,31 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete private end point connection for a private link service in a - /// subscription. + /// Delete private end point connection for a private link service in a subscription. /// /// /// The name of the resource group. @@ -1079,16 +1148,16 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// The name of the private end point connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1106,13 +1175,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1121,41 +1190,52 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnections", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnections", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1165,25 +1245,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1195,50 +1274,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1248,9 +1328,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1261,25 +1342,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Checks whether the subscription is visible to private link service. /// @@ -1290,21 +1375,20 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// The request body of CheckPrivateLinkService API call. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Checks whether the subscription is visible to private link service in the - /// specified resource group. + /// Checks whether the subscription is visible to private link service in the specified resource group. /// /// /// The location of the domain name. @@ -1316,16 +1400,16 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// The request body of CheckPrivateLinkService API call. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1341,13 +1425,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1356,35 +1440,45 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAutoApprovedPrivateLinkServicesWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServices", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServices", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1394,25 +1488,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1424,55 +1517,56 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1482,9 +1576,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1495,25 +1590,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all of the private link service ids that can be linked to a Private /// Endpoint with auto approved in this subscription in this region. @@ -1530,13 +1629,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1545,41 +1644,52 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServicesByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServicesByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1589,25 +1699,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1619,55 +1728,56 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1677,9 +1787,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1690,25 +1801,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified private link service. /// @@ -1724,10 +1839,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1736,41 +1851,52 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1780,25 +1906,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1810,50 +1935,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1863,20 +1989,25 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates an private link service in the specified resource group. /// @@ -1895,13 +2026,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1910,46 +2041,58 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PrivateLinkService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (serviceName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1959,25 +2102,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1989,56 +2131,57 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2048,9 +2191,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2061,16 +2205,16 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2079,25 +2223,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete private end point connection for a private link service in a /// subscription. @@ -2117,10 +2265,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2129,47 +2277,59 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceName"); } + if (peConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("peConnectionName", peConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{peConnectionName}", System.Uri.EscapeDataString(peConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2179,25 +2339,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2209,50 +2368,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2262,20 +2422,25 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Checks whether the subscription is visible to private link service. /// @@ -2291,13 +2456,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2306,40 +2471,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(string location, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (parameters == null) + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCheckPrivateLinkServiceVisibility", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCheckPrivateLinkServiceVisibility", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2349,25 +2525,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2379,61 +2554,62 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2443,9 +2619,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2456,25 +2633,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Checks whether the subscription is visible to private link service in the /// specified resource group. @@ -2494,13 +2675,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2509,46 +2690,58 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceGroupName == null) + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (parameters == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCheckPrivateLinkServiceVisibilityByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCheckPrivateLinkServiceVisibilityByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2558,25 +2751,24 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2588,61 +2780,62 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2652,9 +2845,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2665,25 +2859,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private link services in a resource group. /// @@ -2696,13 +2894,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2711,51 +2909,54 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2767,50 +2968,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2820,9 +3022,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2833,25 +3036,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private link service in a subscription. /// @@ -2864,13 +3071,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2879,51 +3086,54 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2935,50 +3145,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2988,9 +3199,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3001,25 +3213,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all private end point connections for a specific private link service. /// @@ -3032,13 +3248,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3047,51 +3263,54 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnectionsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnectionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3103,50 +3322,51 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3156,9 +3376,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3169,25 +3390,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all of the private link service ids that can be linked to a Private /// Endpoint with auto approved in this subscription in this region. @@ -3201,13 +3426,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3216,51 +3441,54 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAutoApprovedPrivateLinkServicesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServicesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServicesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3272,55 +3500,56 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3330,9 +3559,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3343,25 +3573,29 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Returns all of the private link service ids that can be linked to a Private /// Endpoint with auto approved in this subscription in this region. @@ -3375,13 +3609,13 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3390,51 +3624,54 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAutoApprovedPrivateLinkServicesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServicesByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAutoApprovedPrivateLinkServicesByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3446,55 +3683,56 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3504,9 +3742,10 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3517,24 +3756,28 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperationsExtensions.cs index 38c4e3974227..aedc1b1b1ed9 100644 --- a/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PrivateLinkServicesOperationsExtensions.cs @@ -1,965 +1,891 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PrivateLinkServicesOperations. + /// Extension methods for PrivateLinkServicesOperations /// public static partial class PrivateLinkServicesOperationsExtensions { - /// - /// Deletes the specified private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - public static void Delete(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) - { - operations.DeleteAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified private link service by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// Expands referenced resources. - /// - public static PrivateLinkService Get(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, serviceName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified private link service by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an private link service in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// Parameters supplied to the create or update private link service operation. - /// - public static PrivateLinkService CreateOrUpdate(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an private link service in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// Parameters supplied to the create or update private link service operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all private link services in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IPrivateLinkServicesOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all private link services in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all private link service in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IPrivateLinkServicesOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all private link service in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IPrivateLinkServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the specific private end point connection by specific private link - /// service in the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// Expands referenced resources. - /// - public static PrivateEndpointConnection GetPrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string)) - { - return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, expand).GetAwaiter().GetResult(); - } - - /// - /// Get the specific private end point connection by specific private link - /// service in the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Approve or reject private end point connection for a private link service - /// in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// Parameters supplied to approve or reject the private end point connection. - /// - public static PrivateEndpointConnection UpdatePrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters) - { - return operations.UpdatePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Approve or reject private end point connection for a private link service - /// in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// Parameters supplied to approve or reject the private end point connection. - /// - /// - /// The cancellation token. - /// - public static async Task UpdatePrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdatePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete private end point connection for a private link service in a - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - public static void DeletePrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName) - { - operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Delete private end point connection for a private link service in a - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeletePrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all private end point connections for a specific private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - public static IPage ListPrivateEndpointConnections(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) - { - return operations.ListPrivateEndpointConnectionsAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all private end point connections for a specific private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPrivateEndpointConnectionsAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPrivateEndpointConnectionsWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks whether the subscription is visible to private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - public static PrivateLinkServiceVisibility CheckPrivateLinkServiceVisibility(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters) - { - return operations.CheckPrivateLinkServiceVisibilityAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the subscription is visible to private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - /// - /// The cancellation token. - /// - public static async Task CheckPrivateLinkServiceVisibilityAsync(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks whether the subscription is visible to private link service in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - public static PrivateLinkServiceVisibility CheckPrivateLinkServiceVisibilityByResourceGroup(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) - { - return operations.CheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the subscription is visible to private link service in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - /// - /// The cancellation token. - /// - public static async Task CheckPrivateLinkServiceVisibilityByResourceGroupAsync(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - public static IPage ListAutoApprovedPrivateLinkServices(this IPrivateLinkServicesOperations operations, string location) - { - return operations.ListAutoApprovedPrivateLinkServicesAsync(location).GetAwaiter().GetResult(); - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAutoApprovedPrivateLinkServicesAsync(this IPrivateLinkServicesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAutoApprovedPrivateLinkServicesWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - public static IPage ListAutoApprovedPrivateLinkServicesByResourceGroup(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName) - { - return operations.ListAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAutoApprovedPrivateLinkServicesByResourceGroupAsync(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAutoApprovedPrivateLinkServicesByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - public static void BeginDelete(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) - { - operations.BeginDeleteAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates an private link service in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// Parameters supplied to the create or update private link service operation. - /// - public static PrivateLinkService BeginCreateOrUpdate(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an private link service in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// Parameters supplied to the create or update private link service operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete private end point connection for a private link service in a - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - public static void BeginDeletePrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName) - { - operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Delete private end point connection for a private link service in a - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeletePrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Checks whether the subscription is visible to private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - public static PrivateLinkServiceVisibility BeginCheckPrivateLinkServiceVisibility(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters) - { - return operations.BeginCheckPrivateLinkServiceVisibilityAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the subscription is visible to private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCheckPrivateLinkServiceVisibilityAsync(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks whether the subscription is visible to private link service in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - public static PrivateLinkServiceVisibility BeginCheckPrivateLinkServiceVisibilityByResourceGroup(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) - { - return operations.BeginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Checks whether the subscription is visible to private link service in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the domain name. - /// - /// - /// The name of the resource group. - /// - /// - /// The request body of CheckPrivateLinkService API call. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all private link services in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPrivateLinkServicesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all private link services in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all private link service in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IPrivateLinkServicesOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all private link service in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all private end point connections for a specific private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListPrivateEndpointConnectionsNext(this IPrivateLinkServicesOperations operations, string nextPageLink) - { - return operations.ListPrivateEndpointConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all private end point connections for a specific private link service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPrivateEndpointConnectionsNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAutoApprovedPrivateLinkServicesNext(this IPrivateLinkServicesOperations operations, string nextPageLink) - { - return operations.ListAutoApprovedPrivateLinkServicesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAutoApprovedPrivateLinkServicesNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAutoApprovedPrivateLinkServicesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAutoApprovedPrivateLinkServicesByResourceGroupNext(this IPrivateLinkServicesOperations operations, string nextPageLink) - { - return operations.ListAutoApprovedPrivateLinkServicesByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns all of the private link service ids that can be linked to a Private - /// Endpoint with auto approved in this subscription in this region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAutoApprovedPrivateLinkServicesByResourceGroupNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAutoApprovedPrivateLinkServicesByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Deletes the specified private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + public static void Delete(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) + { + ((IPrivateLinkServicesOperations)operations).DeleteAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified private link service by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// Expands referenced resources. + /// + public static PrivateLinkService Get(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string expand = default(string)) + { + return ((IPrivateLinkServicesOperations)operations).GetAsync(resourceGroupName, serviceName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified private link service by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an private link service in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + public static PrivateLinkService CreateOrUpdate(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters) + { + return ((IPrivateLinkServicesOperations)operations).CreateOrUpdateAsync(resourceGroupName, serviceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an private link service in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all private link services in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IPrivateLinkServicesOperations operations, string resourceGroupName) + { + return ((IPrivateLinkServicesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all private link services in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all private link service in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IPrivateLinkServicesOperations operations) + { + return ((IPrivateLinkServicesOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all private link service in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IPrivateLinkServicesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get the specific private end point connection by specific private link + /// service in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// Expands referenced resources. + /// + public static PrivateEndpointConnection GetPrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string)) + { + return ((IPrivateLinkServicesOperations)operations).GetPrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, expand).GetAwaiter().GetResult(); + } + + /// + /// Get the specific private end point connection by specific private link + /// service in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetPrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Approve or reject private end point connection for a private link service + /// in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + public static PrivateEndpointConnection UpdatePrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters) + { + return ((IPrivateLinkServicesOperations)operations).UpdatePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Approve or reject private end point connection for a private link service + /// in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdatePrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdatePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + public static void DeletePrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName) + { + ((IPrivateLinkServicesOperations)operations).DeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeletePrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + public static Microsoft.Rest.Azure.IPage ListPrivateEndpointConnections(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) + { + return ((IPrivateLinkServicesOperations)operations).ListPrivateEndpointConnectionsAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListPrivateEndpointConnectionsAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListPrivateEndpointConnectionsWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks whether the subscription is visible to private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + public static PrivateLinkServiceVisibility CheckPrivateLinkServiceVisibility(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters) + { + return ((IPrivateLinkServicesOperations)operations).CheckPrivateLinkServiceVisibilityAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the subscription is visible to private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckPrivateLinkServiceVisibilityAsync(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + public static PrivateLinkServiceVisibility CheckPrivateLinkServiceVisibilityByResourceGroup(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) + { + return ((IPrivateLinkServicesOperations)operations).CheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckPrivateLinkServiceVisibilityByResourceGroupAsync(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + public static Microsoft.Rest.Azure.IPage ListAutoApprovedPrivateLinkServices(this IPrivateLinkServicesOperations operations, string location) + { + return ((IPrivateLinkServicesOperations)operations).ListAutoApprovedPrivateLinkServicesAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAutoApprovedPrivateLinkServicesAsync(this IPrivateLinkServicesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAutoApprovedPrivateLinkServicesWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListAutoApprovedPrivateLinkServicesByResourceGroup(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName) + { + return ((IPrivateLinkServicesOperations)operations).ListAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAutoApprovedPrivateLinkServicesByResourceGroupAsync(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAutoApprovedPrivateLinkServicesByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + public static void BeginDelete(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) + { + ((IPrivateLinkServicesOperations)operations).BeginDeleteAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates an private link service in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + public static PrivateLinkService BeginCreateOrUpdate(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters) + { + return ((IPrivateLinkServicesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an private link service in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, PrivateLinkService parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + public static void BeginDeletePrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName) + { + ((IPrivateLinkServicesOperations)operations).BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeletePrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Checks whether the subscription is visible to private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + public static PrivateLinkServiceVisibility BeginCheckPrivateLinkServiceVisibility(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters) + { + return ((IPrivateLinkServicesOperations)operations).BeginCheckPrivateLinkServiceVisibilityAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the subscription is visible to private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCheckPrivateLinkServiceVisibilityAsync(this IPrivateLinkServicesOperations operations, string location, CheckPrivateLinkServiceVisibilityRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCheckPrivateLinkServiceVisibilityWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + public static PrivateLinkServiceVisibility BeginCheckPrivateLinkServiceVisibilityByResourceGroup(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) + { + return ((IPrivateLinkServicesOperations)operations).BeginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Checks whether the subscription is visible to private link service in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the domain name. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(this IPrivateLinkServicesOperations operations, string location, string resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCheckPrivateLinkServiceVisibilityByResourceGroupWithHttpMessagesAsync(location, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all private link services in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPrivateLinkServicesOperations operations, string nextPageLink) + { + return ((IPrivateLinkServicesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all private link services in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all private link service in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IPrivateLinkServicesOperations operations, string nextPageLink) + { + return ((IPrivateLinkServicesOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all private link service in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListPrivateEndpointConnectionsNext(this IPrivateLinkServicesOperations operations, string nextPageLink) + { + return ((IPrivateLinkServicesOperations)operations).ListPrivateEndpointConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListPrivateEndpointConnectionsNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAutoApprovedPrivateLinkServicesNext(this IPrivateLinkServicesOperations operations, string nextPageLink) + { + return ((IPrivateLinkServicesOperations)operations).ListAutoApprovedPrivateLinkServicesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAutoApprovedPrivateLinkServicesNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAutoApprovedPrivateLinkServicesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAutoApprovedPrivateLinkServicesByResourceGroupNext(this IPrivateLinkServicesOperations operations, string nextPageLink) + { + return ((IPrivateLinkServicesOperations)operations).ListAutoApprovedPrivateLinkServicesByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns all of the private link service ids that can be linked to a Private + /// Endpoint with auto approved in this subscription in this region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAutoApprovedPrivateLinkServicesByResourceGroupNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAutoApprovedPrivateLinkServicesByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperations.cs b/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperations.cs index fbaf34c09970..3934c60b4d10 100644 --- a/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PublicIPAddressesOperations operations. /// - internal partial class PublicIPAddressesOperations : IServiceOperations, IPublicIPAddressesOperations + internal partial class PublicIPAddressesOperations : Microsoft.Rest.IServiceOperations, IPublicIPAddressesOperations { /// /// Initializes a new instance of the PublicIPAddressesOperations class. @@ -36,13 +24,13 @@ internal partial class PublicIPAddressesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PublicIPAddressesOperations(NetworkManagementClient client) + internal PublicIPAddressesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServicePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServicePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudServiceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServicePublicIPAddresses", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServicePublicIPAddresses", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all public IP addresses in a role instance IP /// configuration in a cloud service. @@ -269,13 +273,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -284,59 +288,73 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServiceRoleInstancePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServiceRoleInstancePublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudServiceName"); } + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleInstanceName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (ipConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("roleInstanceName", roleInstanceName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("ipConfigurationName", ipConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstancePublicIPAddresses", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstancePublicIPAddresses", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -346,25 +364,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -376,55 +393,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -434,9 +452,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -447,25 +466,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified public IP address in a cloud service. /// @@ -496,13 +519,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -511,44 +534,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetCloudServicePublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetCloudServicePublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "cloudServiceName"); } + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleInstanceName"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (ipConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigurationName"); } + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("roleInstanceName", roleInstanceName); @@ -557,11 +592,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetCloudServicePublicIPAddress", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCloudServicePublicIPAddress", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); @@ -569,8 +607,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -584,25 +623,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -614,55 +652,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -672,9 +711,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -685,25 +725,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified public IP address. /// @@ -714,16 +758,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// The name of the public IP address. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -744,13 +788,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -759,42 +803,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -808,25 +864,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -838,55 +893,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -896,9 +952,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -909,25 +966,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a static or dynamic public IP address. /// @@ -941,16 +1002,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update public IP address operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -971,13 +1032,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -986,46 +1047,57 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (publicIpAddressName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1035,25 +1107,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1065,61 +1136,62 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1129,9 +1201,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1142,25 +1215,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the public IP addresses in a subscription. /// @@ -1170,13 +1247,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1185,29 +1262,38 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1217,25 +1303,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1247,55 +1332,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1305,9 +1391,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1318,25 +1405,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all public IP addresses in a resource group. /// @@ -1349,13 +1440,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1364,35 +1455,45 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1402,25 +1503,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1432,55 +1532,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1490,9 +1591,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1503,25 +1605,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the Ddos Protection Status of a Public IP Address /// @@ -1532,16 +1638,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// The name of the public IP address. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1560,13 +1666,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1575,41 +1681,52 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetPublicIPAddresses", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetPublicIPAddresses", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1619,25 +1736,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1649,55 +1765,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1707,9 +1824,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1720,25 +1838,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all public IP addresses in a virtual machine IP /// configuration in a virtual machine scale set. @@ -1764,13 +1886,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1779,59 +1901,73 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (ipConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigurationName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("ipConfigurationName", ipConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMPublicIPAddresses", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMPublicIPAddresses", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1841,25 +1977,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1871,55 +2006,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1929,9 +2065,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1942,25 +2079,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get the specified public IP address in a virtual machine scale set. /// @@ -1991,13 +2132,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2006,44 +2147,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } + if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (ipConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigurationName"); } + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2018-10-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); @@ -2052,11 +2205,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetPublicIPAddress", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetPublicIPAddress", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); @@ -2064,8 +2220,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2079,25 +2236,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2109,55 +2265,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2167,9 +2324,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2180,25 +2338,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified public IP address. /// @@ -2214,10 +2376,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2226,41 +2388,52 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2270,25 +2443,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2300,55 +2472,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2358,33 +2531,38 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a static or dynamic public IP address. /// @@ -2403,13 +2581,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2418,46 +2596,58 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (publicIpAddressName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2467,25 +2657,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2497,61 +2686,62 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2561,9 +2751,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2574,16 +2765,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2592,25 +2783,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the Ddos Protection Status of a Public IP Address /// @@ -2626,13 +2821,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2641,41 +2836,52 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDdosProtectionStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDdosProtectionStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2685,25 +2891,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2715,55 +2920,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2773,9 +2979,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2786,38 +2993,42 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all public IP addresses on a cloud service level. /// @@ -2830,13 +3041,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2845,51 +3056,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServicePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServicePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServicePublicIPAddressesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServicePublicIPAddressesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2901,55 +3115,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2959,9 +3174,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2972,25 +3188,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all public IP addresses in a role instance IP /// configuration in a cloud service. @@ -3004,13 +3224,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3019,51 +3239,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCloudServiceRoleInstancePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListCloudServiceRoleInstancePublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstancePublicIPAddressesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCloudServiceRoleInstancePublicIPAddressesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3075,55 +3298,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3133,9 +3357,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3146,25 +3371,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the public IP addresses in a subscription. /// @@ -3177,13 +3406,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3192,51 +3421,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3248,55 +3480,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3306,9 +3539,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3319,25 +3553,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all public IP addresses in a resource group. /// @@ -3350,13 +3588,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3365,51 +3603,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3421,55 +3662,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3479,9 +3721,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3492,25 +3735,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all public IP addresses on a virtual machine scale /// set level. @@ -3524,13 +3771,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3539,51 +3786,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetPublicIPAddressesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetPublicIPAddressesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3595,55 +3845,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3653,9 +3904,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3666,25 +3918,29 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about all public IP addresses in a virtual machine IP /// configuration in a virtual machine scale set. @@ -3698,13 +3954,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3713,51 +3969,54 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMPublicIPAddressesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMPublicIPAddressesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3769,55 +4028,56 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3827,9 +4087,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3840,24 +4101,28 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperationsExtensions.cs index be777e6f50ea..24f449b2180d 100644 --- a/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PublicIPAddressesOperationsExtensions.cs @@ -1,983 +1,934 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PublicIPAddressesOperations. + /// Extension methods for PublicIPAddressesOperations /// public static partial class PublicIPAddressesOperationsExtensions { - /// - /// Gets information about all public IP addresses on a cloud service level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - public static IPage ListCloudServicePublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName) - { - return operations.ListCloudServicePublicIPAddressesAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses on a cloud service level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServicePublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCloudServicePublicIPAddressesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses in a role instance IP - /// configuration in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The name of role instance. - /// - /// - /// The network interface name. - /// - /// - /// The IP configuration name. - /// - public static IPage ListCloudServiceRoleInstancePublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName) - { - return operations.ListCloudServiceRoleInstancePublicIPAddressesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses in a role instance IP - /// configuration in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The name of role instance. - /// - /// - /// The network interface name. - /// - /// - /// The IP configuration name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServiceRoleInstancePublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCloudServiceRoleInstancePublicIPAddressesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the specified public IP address in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The role instance name. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the IP configuration. - /// - /// - /// The name of the public IP Address. - /// - /// - /// Expands referenced resources. - /// - public static PublicIPAddress GetCloudServicePublicIPAddress(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string)) - { - return operations.GetCloudServicePublicIPAddressAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).GetAwaiter().GetResult(); - } - - /// - /// Get the specified public IP address in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The role instance name. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the IP configuration. - /// - /// - /// The name of the public IP Address. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetCloudServicePublicIPAddressAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetCloudServicePublicIPAddressWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - public static PublicIPAddressesDeleteHeaders Delete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) - { - return operations.DeleteAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Gets the specified public IP address in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Expands referenced resources. - /// - public static PublicIPAddress Get(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, publicIpAddressName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified public IP address in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a static or dynamic public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. - /// - public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a static or dynamic public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates public IP address tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to update public IP address tags. - /// - public static PublicIPAddress UpdateTags(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates public IP address tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to update public IP address tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the public IP addresses in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IPublicIPAddressesOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all the public IP addresses in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all public IP addresses in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all public IP addresses in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Ddos Protection Status of a Public IP Address - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - public static PublicIpDdosProtectionStatusResult DdosProtectionStatus(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) - { - return operations.DdosProtectionStatusAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); - } - - /// - /// Gets the Ddos Protection Status of a Public IP Address - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// The cancellation token. - /// - public static async Task DdosProtectionStatusAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses on a virtual machine scale - /// set level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - public static IPage ListVirtualMachineScaleSetPublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) - { - return operations.ListVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses on a virtual machine scale - /// set level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetPublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses in a virtual machine IP - /// configuration in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The network interface name. - /// - /// - /// The IP configuration name. - /// - public static IPage ListVirtualMachineScaleSetVMPublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName) - { - return operations.ListVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses in a virtual machine IP - /// configuration in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The network interface name. - /// - /// - /// The IP configuration name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetVMPublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the specified public IP address in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the IP configuration. - /// - /// - /// The name of the public IP Address. - /// - /// - /// Expands referenced resources. - /// - public static PublicIPAddress GetVirtualMachineScaleSetPublicIPAddress(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string)) - { - return operations.GetVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).GetAwaiter().GetResult(); - } - - /// - /// Get the specified public IP address in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// The name of the IP configuration. - /// - /// - /// The name of the public IP Address. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetVirtualMachineScaleSetPublicIPAddressAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - public static PublicIPAddressesDeleteHeaders BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) - { - return operations.BeginDeleteAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Creates or updates a static or dynamic public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. - /// - public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a static or dynamic public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Ddos Protection Status of a Public IP Address - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - public static PublicIpDdosProtectionStatusResult BeginDdosProtectionStatus(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) - { - return operations.BeginDdosProtectionStatusAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); - } - - /// - /// Gets the Ddos Protection Status of a Public IP Address - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDdosProtectionStatusAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses on a cloud service level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListCloudServicePublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) - { - return operations.ListCloudServicePublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses on a cloud service level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServicePublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCloudServicePublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses in a role instance IP - /// configuration in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListCloudServiceRoleInstancePublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) - { - return operations.ListCloudServiceRoleInstancePublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses in a role instance IP - /// configuration in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCloudServiceRoleInstancePublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCloudServiceRoleInstancePublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the public IP addresses in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IPublicIPAddressesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the public IP addresses in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all public IP addresses in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPublicIPAddressesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all public IP addresses in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses on a virtual machine scale - /// set level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListVirtualMachineScaleSetPublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) - { - return operations.ListVirtualMachineScaleSetPublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses on a virtual machine scale - /// set level. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetPublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetPublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about all public IP addresses in a virtual machine IP - /// configuration in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListVirtualMachineScaleSetVMPublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) - { - return operations.ListVirtualMachineScaleSetVMPublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets information about all public IP addresses in a virtual machine IP - /// configuration in a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVirtualMachineScaleSetVMPublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Gets information about all public IP addresses on a cloud service level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServicePublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName) + { + return ((IPublicIPAddressesOperations)operations).ListCloudServicePublicIPAddressesAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses on a cloud service level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServicePublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServicePublicIPAddressesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The name of role instance. + /// + /// + /// The network interface name. + /// + /// + /// The IP configuration name. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServiceRoleInstancePublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName) + { + return ((IPublicIPAddressesOperations)operations).ListCloudServiceRoleInstancePublicIPAddressesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The name of role instance. + /// + /// + /// The network interface name. + /// + /// + /// The IP configuration name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServiceRoleInstancePublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServiceRoleInstancePublicIPAddressesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get the specified public IP address in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The role instance name. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the IP configuration. + /// + /// + /// The name of the public IP Address. + /// + /// + /// Expands referenced resources. + /// + public static PublicIPAddress GetCloudServicePublicIPAddress(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string)) + { + return ((IPublicIPAddressesOperations)operations).GetCloudServicePublicIPAddressAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).GetAwaiter().GetResult(); + } + + /// + /// Get the specified public IP address in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The role instance name. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the IP configuration. + /// + /// + /// The name of the public IP Address. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetCloudServicePublicIPAddressAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string cloudServiceName, string roleInstanceName, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetCloudServicePublicIPAddressWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIPAddressesDeleteHeaders Delete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) + { + return ((IPublicIPAddressesOperations)operations).DeleteAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Gets the specified public IP address in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// Expands referenced resources. + /// + public static PublicIPAddress Get(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string)) + { + return ((IPublicIPAddressesOperations)operations).GetAsync(resourceGroupName, publicIpAddressName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified public IP address in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a static or dynamic public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) + { + return ((IPublicIPAddressesOperations)operations).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a static or dynamic public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates public IP address tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIPAddress UpdateTags(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, TagsObject parameters) + { + return ((IPublicIPAddressesOperations)operations).UpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates public IP address tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the public IP addresses in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IPublicIPAddressesOperations operations) + { + return ((IPublicIPAddressesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the public IP addresses in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IPublicIPAddressesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all public IP addresses in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) + { + return ((IPublicIPAddressesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all public IP addresses in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Ddos Protection Status of a Public IP Address + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIpDdosProtectionStatusResult DdosProtectionStatus(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) + { + return ((IPublicIPAddressesOperations)operations).DdosProtectionStatusAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); + } + + /// + /// Gets the Ddos Protection Status of a Public IP Address + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DdosProtectionStatusAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetPublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) + { + return ((IPublicIPAddressesOperations)operations).ListVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetPublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The network interface name. + /// + /// + /// The IP configuration name. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMPublicIPAddresses(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName) + { + return ((IPublicIPAddressesOperations)operations).ListVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The network interface name. + /// + /// + /// The IP configuration name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetVMPublicIPAddressesAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get the specified public IP address in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the IP configuration. + /// + /// + /// The name of the public IP Address. + /// + /// + /// Expands referenced resources. + /// + public static PublicIPAddress GetVirtualMachineScaleSetPublicIPAddress(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string)) + { + return ((IPublicIPAddressesOperations)operations).GetVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).GetAwaiter().GetResult(); + } + + /// + /// Get the specified public IP address in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the IP configuration. + /// + /// + /// The name of the public IP Address. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVirtualMachineScaleSetPublicIPAddressAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIPAddressesDeleteHeaders BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) + { + return ((IPublicIPAddressesOperations)operations).BeginDeleteAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates a static or dynamic public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) + { + return ((IPublicIPAddressesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a static or dynamic public IP address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Ddos Protection Status of a Public IP Address + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + public static PublicIpDdosProtectionStatusResult BeginDdosProtectionStatus(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) + { + return ((IPublicIPAddressesOperations)operations).BeginDdosProtectionStatusAsync(resourceGroupName, publicIpAddressName).GetAwaiter().GetResult(); + } + + /// + /// Gets the Ddos Protection Status of a Public IP Address + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP address. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDdosProtectionStatusAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses on a cloud service level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServicePublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) + { + return ((IPublicIPAddressesOperations)operations).ListCloudServicePublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses on a cloud service level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServicePublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServicePublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCloudServiceRoleInstancePublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) + { + return ((IPublicIPAddressesOperations)operations).ListCloudServiceRoleInstancePublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses in a role instance IP + /// configuration in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCloudServiceRoleInstancePublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCloudServiceRoleInstancePublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the public IP addresses in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IPublicIPAddressesOperations operations, string nextPageLink) + { + return ((IPublicIPAddressesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the public IP addresses in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all public IP addresses in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPublicIPAddressesOperations operations, string nextPageLink) + { + return ((IPublicIPAddressesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all public IP addresses in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetPublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) + { + return ((IPublicIPAddressesOperations)operations).ListVirtualMachineScaleSetPublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetPublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetPublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMPublicIPAddressesNext(this IPublicIPAddressesOperations operations, string nextPageLink) + { + return ((IPublicIPAddressesOperations)operations).ListVirtualMachineScaleSetVMPublicIPAddressesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVirtualMachineScaleSetVMPublicIPAddressesNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperations.cs b/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperations.cs index d6fa407e3b8e..d47e7e53005b 100644 --- a/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// PublicIPPrefixesOperations operations. /// - internal partial class PublicIPPrefixesOperations : IServiceOperations, IPublicIPPrefixesOperations + internal partial class PublicIPPrefixesOperations : Microsoft.Rest.IServiceOperations, IPublicIPPrefixesOperations { /// /// Initializes a new instance of the PublicIPPrefixesOperations class. @@ -36,13 +24,13 @@ internal partial class PublicIPPrefixesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PublicIPPrefixesOperations(NetworkManagementClient client) + internal PublicIPPrefixesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// The name of the PublicIpPrefix. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (publicIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a static or dynamic public IP prefix. /// @@ -287,16 +292,16 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update public IP prefix operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (publicIpPrefixName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (publicIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the public IP prefixes in a subscription. /// @@ -516,13 +537,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,29 +552,38 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +593,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +622,56 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +681,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +695,29 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all public IP prefixes in a resource group. /// @@ -695,13 +730,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,35 +745,45 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified public IP prefix. /// @@ -883,10 +933,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (publicIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a static or dynamic public IP prefix. /// @@ -1059,13 +1125,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,46 +1140,58 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (publicIpPrefixName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (publicIpPrefixName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpPrefixName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1123,25 +1201,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1153,61 +1230,62 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1217,9 +1295,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1230,16 +1309,16 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1248,25 +1327,29 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the public IP prefixes in a subscription. /// @@ -1279,13 +1362,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1294,51 +1377,54 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1350,55 +1436,56 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1408,9 +1495,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1421,25 +1509,29 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all public IP prefixes in a resource group. /// @@ -1452,13 +1544,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,51 +1559,54 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1523,55 +1618,56 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1677,10 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1594,24 +1691,28 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperationsExtensions.cs index 1d530bd43edb..d10b142d9f5a 100644 --- a/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/PublicIPPrefixesOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PublicIPPrefixesOperations. + /// Extension methods for PublicIPPrefixesOperations /// public static partial class PublicIPPrefixesOperationsExtensions { - /// - /// Deletes the specified public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the PublicIpPrefix. - /// - public static void Delete(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName) - { - operations.DeleteAsync(resourceGroupName, publicIpPrefixName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the PublicIpPrefix. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified public IP prefix in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Expands referenced resources. - /// - public static PublicIPPrefix Get(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, publicIpPrefixName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + public static void Delete(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName) + { + ((IPublicIPPrefixesOperations)operations).DeleteAsync(resourceGroupName, publicIpPrefixName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified public IP prefix in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Expands referenced resources. + /// + public static PublicIPPrefix Get(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, string expand = default(string)) + { + return ((IPublicIPPrefixesOperations)operations).GetAsync(resourceGroupName, publicIpPrefixName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a static or dynamic public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Parameters supplied to the create or update public IP prefix operation. - /// - public static PublicIPPrefix CreateOrUpdate(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters) + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + public static PublicIPPrefix CreateOrUpdate(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters) + { + return ((IPublicIPPrefixesOperations)operations).CreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a static or dynamic public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Parameters supplied to the create or update public IP prefix operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates public IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + public static PublicIPPrefix UpdateTags(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters) + { + return ((IPublicIPPrefixesOperations)operations).UpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates public IP prefix tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Parameters supplied to update public IP prefix tags. - /// - public static PublicIPPrefix UpdateTags(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters) + /// + /// Updates public IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IPublicIPPrefixesOperations operations) + { + return ((IPublicIPPrefixesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Updates public IP prefix tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Parameters supplied to update public IP prefix tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IPublicIPPrefixesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IPublicIPPrefixesOperations operations, string resourceGroupName) + { + return ((IPublicIPPrefixesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all the public IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IPublicIPPrefixesOperations operations) + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + public static void BeginDelete(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName) + { + ((IPublicIPPrefixesOperations)operations).BeginDeleteAsync(resourceGroupName, publicIpPrefixName).GetAwaiter().GetResult(); + } - /// - /// Gets all the public IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IPublicIPPrefixesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + public static PublicIPPrefix BeginCreateOrUpdate(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters) + { + return ((IPublicIPPrefixesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all public IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IPublicIPPrefixesOperations operations, string resourceGroupName) + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IPublicIPPrefixesOperations operations, string nextPageLink) + { + return ((IPublicIPPrefixesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all public IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IPublicIPPrefixesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPublicIPPrefixesOperations operations, string nextPageLink) + { + return ((IPublicIPPrefixesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the PublicIpPrefix. - /// - public static void BeginDelete(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName) + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPublicIPPrefixesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, publicIpPrefixName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the PublicIpPrefix. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a static or dynamic public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Parameters supplied to the create or update public IP prefix operation. - /// - public static PublicIPPrefix BeginCreateOrUpdate(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a static or dynamic public IP prefix. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP prefix. - /// - /// - /// Parameters supplied to the create or update public IP prefix operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the public IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IPublicIPPrefixesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the public IP prefixes in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IPublicIPPrefixesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all public IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPublicIPPrefixesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all public IP prefixes in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPublicIPPrefixesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperations.cs index d5844c21abc8..8d3603405e4b 100644 --- a/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ResourceNavigationLinksOperations operations. /// - internal partial class ResourceNavigationLinksOperations : IServiceOperations, IResourceNavigationLinksOperations + internal partial class ResourceNavigationLinksOperations : Microsoft.Rest.IServiceOperations, IResourceNavigationLinksOperations { /// /// Initializes a new instance of the ResourceNavigationLinksOperations class. @@ -36,13 +24,13 @@ internal partial class ResourceNavigationLinksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ResourceNavigationLinksOperations(NetworkManagementClient client) + internal ResourceNavigationLinksOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,24 +235,28 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperationsExtensions.cs index 06291c1ae57a..3ae584eb6457 100644 --- a/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ResourceNavigationLinksOperationsExtensions.cs @@ -1,71 +1,61 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ResourceNavigationLinksOperations. + /// Extension methods for ResourceNavigationLinksOperations /// public static partial class ResourceNavigationLinksOperationsExtensions { - /// - /// Gets a list of resource navigation links for a subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - public static ResourceNavigationLinksListResult List(this IResourceNavigationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) - { - return operations.ListAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); - } + /// + /// Gets a list of resource navigation links for a subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static ResourceNavigationLinksListResult List(this IResourceNavigationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) + { + return ((IResourceNavigationLinksOperations)operations).ListAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of resource navigation links for a subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IResourceNavigationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of resource navigation links for a subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IResourceNavigationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperations.cs index d6035aa5b969..a1f1dcb4701a 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RouteFilterRulesOperations operations. /// - internal partial class RouteFilterRulesOperations : IServiceOperations, IRouteFilterRulesOperations + internal partial class RouteFilterRulesOperations : Microsoft.Rest.IServiceOperations, IRouteFilterRulesOperations { /// /// Initializes a new instance of the RouteFilterRulesOperations class. @@ -36,13 +24,13 @@ internal partial class RouteFilterRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RouteFilterRulesOperations(NetworkManagementClient client) + internal RouteFilterRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// The name of the rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } + if (ruleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a route in the specified route filter. /// @@ -294,16 +299,16 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update route filter rule operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -321,13 +326,13 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -336,41 +341,52 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByRouteFilterWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByRouteFilterWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByRouteFilter", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByRouteFilter", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -380,25 +396,24 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -410,55 +425,56 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +484,10 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,25 +498,29 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified rule from a route filter. /// @@ -518,10 +539,10 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -530,47 +551,59 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } + if (ruleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -580,25 +613,24 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -610,55 +642,56 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -668,20 +701,25 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a route in the specified route filter. /// @@ -703,13 +741,13 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -718,56 +756,65 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (routeFilterRuleParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterRuleParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } + if (ruleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - if (routeFilterRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterRuleParameters"); - } - if (routeFilterRuleParameters != null) - { - routeFilterRuleParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); - tracingParameters.Add("routeFilterRuleParameters", routeFilterRuleParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("routeFilterRuleParameters", routeFilterRuleParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -777,25 +824,24 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -807,61 +853,62 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(routeFilterRuleParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeFilterRuleParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeFilterRuleParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -871,9 +918,10 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -884,16 +932,16 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -902,25 +950,29 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all RouteFilterRules in a route filter. /// @@ -933,13 +985,13 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -948,51 +1000,54 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByRouteFilterNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByRouteFilterNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByRouteFilterNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByRouteFilterNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1004,55 +1059,56 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1062,9 +1118,10 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1075,24 +1132,28 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperationsExtensions.cs index 981707b7a41d..386b3decdd88 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteFilterRulesOperationsExtensions.cs @@ -1,335 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RouteFilterRulesOperations. + /// Extension methods for RouteFilterRulesOperations /// public static partial class RouteFilterRulesOperationsExtensions { - /// - /// Deletes the specified rule from a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the rule. - /// - public static void Delete(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName) - { - operations.DeleteAsync(resourceGroupName, routeFilterName, ruleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified rule from a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the rule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified rule from a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the rule. - /// - public static RouteFilterRule Get(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName) - { - return operations.GetAsync(resourceGroupName, routeFilterName, ruleName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified rule from a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the create or update route filter rule operation. - /// - public static RouteFilterRule CreateOrUpdate(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified rule from a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the rule. + /// + public static void Delete(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName) + { + ((IRouteFilterRulesOperations)operations).DeleteAsync(resourceGroupName, routeFilterName, ruleName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the create or update route filter rule operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified rule from a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified rule from a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the rule. + /// + public static RouteFilterRule Get(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName) + { + return ((IRouteFilterRulesOperations)operations).GetAsync(resourceGroupName, routeFilterName, ruleName).GetAwaiter().GetResult(); + } - /// - /// Gets all RouteFilterRules in a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - public static IPage ListByRouteFilter(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName) + /// + /// Gets the specified rule from a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByRouteFilterAsync(resourceGroupName, routeFilterName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a route in the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the route filter rule. + /// + public static RouteFilterRule CreateOrUpdate(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters) + { + return ((IRouteFilterRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all RouteFilterRules in a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByRouteFilterAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a route in the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the route filter rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByRouteFilterWithHttpMessagesAsync(resourceGroupName, routeFilterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all RouteFilterRules in a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + public static Microsoft.Rest.Azure.IPage ListByRouteFilter(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName) + { + return ((IRouteFilterRulesOperations)operations).ListByRouteFilterAsync(resourceGroupName, routeFilterName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified rule from a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the rule. - /// - public static void BeginDelete(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName) + /// + /// Gets all RouteFilterRules in a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByRouteFilterAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByRouteFilterWithHttpMessagesAsync(resourceGroupName, routeFilterName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, routeFilterName, ruleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified rule from a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the rule. + /// + public static void BeginDelete(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName) + { + ((IRouteFilterRulesOperations)operations).BeginDeleteAsync(resourceGroupName, routeFilterName, ruleName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified rule from a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified rule from a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a route in the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the route filter rule. + /// + public static RouteFilterRule BeginCreateOrUpdate(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters) + { + return ((IRouteFilterRulesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the create or update route filter rule operation. - /// - public static RouteFilterRule BeginCreateOrUpdate(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters) + /// + /// Creates or updates a route in the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The name of the route filter rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all RouteFilterRules in a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByRouteFilterNext(this IRouteFilterRulesOperations operations, string nextPageLink) + { + return ((IRouteFilterRulesOperations)operations).ListByRouteFilterNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the create or update route filter rule operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all RouteFilterRules in a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByRouteFilterNextAsync(this IRouteFilterRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByRouteFilterNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all RouteFilterRules in a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByRouteFilterNext(this IRouteFilterRulesOperations operations, string nextPageLink) - { - return operations.ListByRouteFilterNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all RouteFilterRules in a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByRouteFilterNextAsync(this IRouteFilterRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByRouteFilterNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperations.cs b/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperations.cs index 676330ac52a3..6fbff51da366 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RouteFiltersOperations operations. /// - internal partial class RouteFiltersOperations : IServiceOperations, IRouteFiltersOperations + internal partial class RouteFiltersOperations : Microsoft.Rest.IServiceOperations, IRouteFiltersOperations { /// /// Initializes a new instance of the RouteFiltersOperations class. @@ -36,13 +24,13 @@ internal partial class RouteFiltersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RouteFiltersOperations(NetworkManagementClient client) + internal RouteFiltersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// The name of the route filter. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a route filter in a specified resource group. /// @@ -287,16 +292,16 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// Parameters supplied to the create or update route filter operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (routeFilterName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route filters in a resource group. /// @@ -519,13 +540,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -534,35 +555,45 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -572,25 +603,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -602,55 +632,56 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -660,9 +691,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -673,25 +705,29 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route filters in a subscription. /// @@ -701,13 +737,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -716,29 +752,38 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified route filter. /// @@ -883,10 +933,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a route filter in a specified resource group. /// @@ -1059,13 +1125,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,46 +1140,58 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (routeFilterParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterParameters"); } - if (routeFilterName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (routeFilterParameters == null) + + if (routeFilterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeFilterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); - tracingParameters.Add("routeFilterParameters", routeFilterParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("routeFilterParameters", routeFilterParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1123,25 +1201,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1153,61 +1230,62 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(routeFilterParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeFilterParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeFilterParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1217,9 +1295,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1230,16 +1309,16 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1248,25 +1327,29 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route filters in a resource group. /// @@ -1279,13 +1362,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1294,51 +1377,54 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1350,55 +1436,56 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1408,9 +1495,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1421,25 +1509,29 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route filters in a subscription. /// @@ -1452,13 +1544,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,51 +1559,54 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1523,55 +1618,56 @@ internal RouteFiltersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1677,10 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1594,24 +1691,28 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperationsExtensions.cs index 01e7971501c6..0b6b1f84d9f6 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteFiltersOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RouteFiltersOperations. + /// Extension methods for RouteFiltersOperations /// public static partial class RouteFiltersOperationsExtensions { - /// - /// Deletes the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - public static void Delete(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName) - { - operations.DeleteAsync(resourceGroupName, routeFilterName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Expands referenced express route bgp peering resources. - /// - public static RouteFilter Get(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, routeFilterName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + public static void Delete(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName) + { + ((IRouteFiltersOperations)operations).DeleteAsync(resourceGroupName, routeFilterName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Expands referenced express route bgp peering resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeFilterName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// Expands referenced express route bgp peering resources. + /// + public static RouteFilter Get(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, string expand = default(string)) + { + return ((IRouteFiltersOperations)operations).GetAsync(resourceGroupName, routeFilterName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route filter in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the create or update route filter operation. - /// - public static RouteFilter CreateOrUpdate(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters) + /// + /// Gets the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// Expands referenced express route bgp peering resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeFilterName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a route filter in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + public static RouteFilter CreateOrUpdate(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters) + { + return ((IRouteFiltersOperations)operations).CreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route filter in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the create or update route filter operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a route filter in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates tags of a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + public static RouteFilter UpdateTags(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, TagsObject parameters) + { + return ((IRouteFiltersOperations)operations).UpdateTagsAsync(resourceGroupName, routeFilterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to update route filter tags. - /// - public static RouteFilter UpdateTags(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, TagsObject parameters) + /// + /// Updates tags of a route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, routeFilterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, routeFilterName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all route filters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IRouteFiltersOperations operations, string resourceGroupName) + { + return ((IRouteFiltersOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to update route filter tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all route filters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IRouteFiltersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, routeFilterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all route filters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IRouteFiltersOperations operations) + { + return ((IRouteFiltersOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all route filters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IRouteFiltersOperations operations, string resourceGroupName) + /// + /// Gets all route filters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRouteFiltersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + public static void BeginDelete(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName) + { + ((IRouteFiltersOperations)operations).BeginDeleteAsync(resourceGroupName, routeFilterName).GetAwaiter().GetResult(); + } - /// - /// Gets all route filters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IRouteFiltersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified route filter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a route filter in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + public static RouteFilter BeginCreateOrUpdate(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters) + { + return ((IRouteFiltersOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all route filters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IRouteFiltersOperations operations) + /// + /// Creates or updates a route filter in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route filter. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all route filters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IRouteFiltersOperations operations, string nextPageLink) + { + return ((IRouteFiltersOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all route filters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRouteFiltersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all route filters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IRouteFiltersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all route filters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRouteFiltersOperations operations, string nextPageLink) + { + return ((IRouteFiltersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - public static void BeginDelete(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName) + /// + /// Gets all route filters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRouteFiltersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, routeFilterName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeFilterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a route filter in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the create or update route filter operation. - /// - public static RouteFilter BeginCreateOrUpdate(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a route filter in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the create or update route filter operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all route filters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IRouteFiltersOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all route filters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IRouteFiltersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all route filters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRouteFiltersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all route filters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRouteFiltersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/RouteMapsOperations.cs b/src/Network/Network.Management.Sdk/Generated/RouteMapsOperations.cs index bacb52ba0419..442b3d6f85eb 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteMapsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteMapsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RouteMapsOperations operations. /// - internal partial class RouteMapsOperations : IServiceOperations, IRouteMapsOperations + internal partial class RouteMapsOperations : Microsoft.Rest.IServiceOperations, IRouteMapsOperations { /// /// Initializes a new instance of the RouteMapsOperations class. @@ -36,13 +24,13 @@ internal partial class RouteMapsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RouteMapsOperations(NetworkManagementClient client) + internal RouteMapsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,7 +42,7 @@ internal RouteMapsOperations(NetworkManagementClient client) /// Retrieves the details of a RouteMap. /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -68,13 +56,13 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeMapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeMapName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeMapName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeMapName", routeMapName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeMapName}", System.Uri.EscapeDataString(routeMapName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal RouteMapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal RouteMapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal RouteMapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,30 +235,34 @@ internal RouteMapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// Creates a RouteMap if it doesn't exist else updates the existing one. /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -269,23 +274,23 @@ internal RouteMapsOperations(NetworkManagementClient client) /// Parameters supplied to create or update a RouteMap. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Deletes a RouteMap. /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -294,23 +299,23 @@ internal RouteMapsOperations(NetworkManagementClient client) /// The name of the RouteMap. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the details of all RouteMaps. /// /// - /// The resource group name of the RouteMap's resource group'. + /// The resource group name of the RouteMap's resource group'. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -321,13 +326,13 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -336,41 +341,52 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -380,25 +396,24 @@ internal RouteMapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -410,55 +425,56 @@ internal RouteMapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +484,10 @@ internal RouteMapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,30 +498,34 @@ internal RouteMapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// Creates a RouteMap if it doesn't exist else updates the existing one. /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -521,13 +542,13 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -536,52 +557,65 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (routeMapParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeMapParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeMapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeMapName"); - } - if (routeMapParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeMapParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeMapName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeMapName", routeMapName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("routeMapParameters", routeMapParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeMapName}", System.Uri.EscapeDataString(routeMapName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -591,25 +625,24 @@ internal RouteMapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -621,61 +654,62 @@ internal RouteMapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(routeMapParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeMapParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeMapParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -685,9 +719,10 @@ internal RouteMapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -698,16 +733,16 @@ internal RouteMapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -716,30 +751,34 @@ internal RouteMapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a RouteMap. /// /// - /// The resource group name of the RouteMap's resource group. + /// The resource group name of the RouteMap's resource group. /// /// /// The name of the VirtualHub containing the RouteMap. @@ -753,10 +792,10 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -765,47 +804,59 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeMapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeMapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeMapName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeMapName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeMapName", routeMapName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeMapName}", System.Uri.EscapeDataString(routeMapName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -815,25 +866,24 @@ internal RouteMapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -845,55 +895,56 @@ internal RouteMapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -903,20 +954,25 @@ internal RouteMapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all RouteMaps. /// @@ -929,13 +985,13 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -944,51 +1000,54 @@ internal RouteMapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1000,55 +1059,56 @@ internal RouteMapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1058,9 +1118,10 @@ internal RouteMapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1071,24 +1132,28 @@ internal RouteMapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/RouteMapsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/RouteMapsOperationsExtensions.cs index 71ea2937ac48..8bac54373dba 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteMapsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteMapsOperationsExtensions.cs @@ -1,335 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RouteMapsOperations. + /// Extension methods for RouteMapsOperations /// public static partial class RouteMapsOperationsExtensions { - /// - /// Retrieves the details of a RouteMap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - public static RouteMap Get(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, routeMapName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a RouteMap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a RouteMap if it doesn't exist else updates the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// Parameters supplied to create or update a RouteMap. - /// - public static RouteMap CreateOrUpdate(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a RouteMap if it doesn't exist else updates the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// Parameters supplied to create or update a RouteMap. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a RouteMap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - public static void Delete(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, routeMapName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a RouteMap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + public static RouteMap Get(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName) + { + return ((IRouteMapsOperations)operations).GetAsync(resourceGroupName, virtualHubName, routeMapName).GetAwaiter().GetResult(); + } - /// - /// Deletes a RouteMap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a RouteMap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + public static RouteMap CreateOrUpdate(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters) + { + return ((IRouteMapsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all RouteMaps. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group'. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - public static IPage List(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName) + /// + /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a RouteMap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + public static void Delete(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName) + { + ((IRouteMapsOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, routeMapName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all RouteMaps. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group'. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a RouteMap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all RouteMaps. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group'. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + public static Microsoft.Rest.Azure.IPage List(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IRouteMapsOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Creates a RouteMap if it doesn't exist else updates the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// Parameters supplied to create or update a RouteMap. - /// - public static RouteMap BeginCreateOrUpdate(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters) + /// + /// Retrieves the details of all RouteMaps. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group'. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + public static RouteMap BeginCreateOrUpdate(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters) + { + return ((IRouteMapsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a RouteMap if it doesn't exist else updates the existing one. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// Parameters supplied to create or update a RouteMap. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a RouteMap if it doesn't exist else updates the existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, RouteMap routeMapParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a RouteMap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + public static void BeginDelete(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName) + { + ((IRouteMapsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, routeMapName).GetAwaiter().GetResult(); + } - /// - /// Deletes a RouteMap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - public static void BeginDelete(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, routeMapName).GetAwaiter().GetResult(); - } + /// + /// Deletes a RouteMap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RouteMap's resource group. + /// + /// + /// The name of the VirtualHub containing the RouteMap. + /// + /// + /// The name of the RouteMap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all RouteMaps. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRouteMapsOperations operations, string nextPageLink) + { + return ((IRouteMapsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a RouteMap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RouteMap's resource group. - /// - /// - /// The name of the VirtualHub containing the RouteMap. - /// - /// - /// The name of the RouteMap. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRouteMapsOperations operations, string resourceGroupName, string virtualHubName, string routeMapName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all RouteMaps. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRouteMapsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves the details of all RouteMaps. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRouteMapsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all RouteMaps. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRouteMapsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/RouteTablesOperations.cs b/src/Network/Network.Management.Sdk/Generated/RouteTablesOperations.cs index 1c5b59a6f9c9..2ae5040155dc 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteTablesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteTablesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RouteTablesOperations operations. /// - internal partial class RouteTablesOperations : IServiceOperations, IRouteTablesOperations + internal partial class RouteTablesOperations : Microsoft.Rest.IServiceOperations, IRouteTablesOperations { /// /// Initializes a new instance of the RouteTablesOperations class. @@ -36,13 +24,13 @@ internal partial class RouteTablesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RouteTablesOperations(NetworkManagementClient client) + internal RouteTablesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal RouteTablesOperations(NetworkManagementClient client) /// The name of the route table. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal RouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or updates a route table in a specified resource group. /// @@ -287,16 +292,16 @@ internal RouteTablesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update route table operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (routeTableName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal RouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route tables in a resource group. /// @@ -519,13 +540,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -534,35 +555,45 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -572,25 +603,24 @@ internal RouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -602,55 +632,56 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -660,9 +691,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -673,25 +705,29 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route tables in a subscription. /// @@ -701,13 +737,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -716,29 +752,38 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal RouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified route table. /// @@ -883,10 +933,10 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,41 +945,52 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -939,25 +1000,24 @@ internal RouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -969,55 +1029,56 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1027,20 +1088,25 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or updates a route table in a specified resource group. /// @@ -1059,13 +1125,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1074,46 +1140,58 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (routeTableName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1123,25 +1201,24 @@ internal RouteTablesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1153,61 +1230,62 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1217,9 +1295,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1230,16 +1309,16 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1248,25 +1327,29 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route tables in a resource group. /// @@ -1279,13 +1362,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1294,51 +1377,54 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1350,55 +1436,56 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1408,9 +1495,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1421,25 +1509,29 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all route tables in a subscription. /// @@ -1452,13 +1544,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,51 +1559,54 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1523,55 +1618,56 @@ internal RouteTablesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1677,10 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1594,24 +1691,28 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/RouteTablesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/RouteTablesOperationsExtensions.cs index f1244c1bc7a5..f71f70ed57f7 100644 --- a/src/Network/Network.Management.Sdk/Generated/RouteTablesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/RouteTablesOperationsExtensions.cs @@ -1,413 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RouteTablesOperations. + /// Extension methods for RouteTablesOperations /// public static partial class RouteTablesOperationsExtensions { - /// - /// Deletes the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - public static void Delete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) - { - operations.DeleteAsync(resourceGroupName, routeTableName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Expands referenced resources. - /// - public static RouteTable Get(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, routeTableName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + public static void Delete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) + { + ((IRouteTablesOperations)operations).DeleteAsync(resourceGroupName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Expands referenced resources. + /// + public static RouteTable Get(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string)) + { + return ((IRouteTablesOperations)operations).GetAsync(resourceGroupName, routeTableName, expand).GetAwaiter().GetResult(); + } - /// - /// Create or updates a route table in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// - public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) + /// + /// Gets the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or updates a route table in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) + { + return ((IRouteTablesOperations)operations).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or updates a route table in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or updates a route table in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates a route table tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + public static RouteTable UpdateTags(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, TagsObject parameters) + { + return ((IRouteTablesOperations)operations).UpdateTagsAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a route table tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to update route table tags. - /// - public static RouteTable UpdateTags(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, TagsObject parameters) + /// + /// Updates a route table tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all route tables in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IRouteTablesOperations operations, string resourceGroupName) + { + return ((IRouteTablesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Updates a route table tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to update route table tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all route tables in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all route tables in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IRouteTablesOperations operations) + { + return ((IRouteTablesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all route tables in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IRouteTablesOperations operations, string resourceGroupName) + /// + /// Gets all route tables in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IRouteTablesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) + { + ((IRouteTablesOperations)operations).BeginDeleteAsync(resourceGroupName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or updates a route table in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) + { + return ((IRouteTablesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IRouteTablesOperations operations) + /// + /// Create or updates a route table in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all route tables in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRouteTablesOperations operations, string nextPageLink) + { + return ((IRouteTablesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all route tables in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IRouteTablesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all route tables in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all route tables in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IRouteTablesOperations operations, string nextPageLink) + { + return ((IRouteTablesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) + /// + /// Gets all route tables in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, routeTableName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or updates a route table in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// - public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or updates a route table in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all route tables in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRouteTablesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all route tables in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all route tables in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IRouteTablesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all route tables in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/RoutesOperations.cs b/src/Network/Network.Management.Sdk/Generated/RoutesOperations.cs index c5a5ff31a900..2da34c991254 100644 --- a/src/Network/Network.Management.Sdk/Generated/RoutesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/RoutesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RoutesOperations operations. /// - internal partial class RoutesOperations : IServiceOperations, IRoutesOperations + internal partial class RoutesOperations : Microsoft.Rest.IServiceOperations, IRoutesOperations { /// /// Initializes a new instance of the RoutesOperations class. @@ -36,13 +24,13 @@ internal partial class RoutesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RoutesOperations(NetworkManagementClient client) + internal RoutesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal RoutesOperations(NetworkManagementClient client) /// The name of the route. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal RoutesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + if (routeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal RoutesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal RoutesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a route in the specified route table. /// @@ -294,16 +299,16 @@ internal RoutesOperations(NetworkManagementClient client) /// Parameters supplied to the create or update route operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -321,13 +326,13 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -336,41 +341,52 @@ internal RoutesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -380,25 +396,24 @@ internal RoutesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -410,55 +425,56 @@ internal RoutesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +484,10 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,25 +498,29 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified route from a route table. /// @@ -518,10 +539,10 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -530,47 +551,59 @@ internal RoutesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + if (routeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -580,25 +613,24 @@ internal RoutesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -610,55 +642,56 @@ internal RoutesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -668,20 +701,25 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a route in the specified route table. /// @@ -703,13 +741,13 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -718,56 +756,65 @@ internal RoutesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (routeParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + if (routeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); - } - if (routeParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeParameters"); - } - if (routeParameters != null) - { - routeParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); - tracingParameters.Add("routeParameters", routeParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("routeParameters", routeParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -777,25 +824,24 @@ internal RoutesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -807,61 +853,62 @@ internal RoutesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(routeParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -871,9 +918,10 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -884,16 +932,16 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -902,25 +950,29 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all routes in a route table. /// @@ -933,13 +985,13 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -948,51 +1000,54 @@ internal RoutesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1004,55 +1059,56 @@ internal RoutesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1062,9 +1118,10 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1075,24 +1132,28 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/RoutesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/RoutesOperationsExtensions.cs index bfb3b73d3846..57aef548385a 100644 --- a/src/Network/Network.Management.Sdk/Generated/RoutesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/RoutesOperationsExtensions.cs @@ -1,335 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RoutesOperations. + /// Extension methods for RoutesOperations /// public static partial class RoutesOperationsExtensions { - /// - /// Deletes the specified route from a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - public static void Delete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) - { - operations.DeleteAsync(resourceGroupName, routeTableName, routeName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified route from a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified route from a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) - { - return operations.GetAsync(resourceGroupName, routeTableName, routeName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified route from a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a route in the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// - public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified route from a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + public static void Delete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + { + ((IRoutesOperations)operations).DeleteAsync(resourceGroupName, routeTableName, routeName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route in the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified route from a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified route from a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + { + return ((IRoutesOperations)operations).GetAsync(resourceGroupName, routeTableName, routeName).GetAwaiter().GetResult(); + } - /// - /// Gets all routes in a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - public static IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) + /// + /// Gets the specified route from a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, routeTableName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a route in the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + { + return ((IRoutesOperations)operations).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all routes in a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a route in the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all routes in a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + public static Microsoft.Rest.Azure.IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) + { + return ((IRoutesOperations)operations).ListAsync(resourceGroupName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified route from a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + /// + /// Gets all routes in a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, routeTableName, routeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified route from a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + { + ((IRoutesOperations)operations).BeginDeleteAsync(resourceGroupName, routeTableName, routeName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified route from a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified route from a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a route in the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + { + return ((IRoutesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route in the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// - public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + /// + /// Creates or updates a route in the specified route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// The name of the route. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all routes in a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRoutesOperations operations, string nextPageLink) + { + return ((IRoutesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a route in the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all routes in a route table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRoutesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all routes in a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRoutesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all routes in a route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRoutesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperations.cs b/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperations.cs index 813f0f604804..ce2fabfe76e6 100644 --- a/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RoutingIntentOperations operations. /// - internal partial class RoutingIntentOperations : IServiceOperations, IRoutingIntentOperations + internal partial class RoutingIntentOperations : Microsoft.Rest.IServiceOperations, IRoutingIntentOperations { /// /// Initializes a new instance of the RoutingIntentOperations class. @@ -36,13 +24,13 @@ internal partial class RoutingIntentOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RoutingIntentOperations(NetworkManagementClient client) + internal RoutingIntentOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal RoutingIntentOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates a RoutingIntent resource if it doesn't exist else updates the - /// existing RoutingIntent. + /// Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. /// /// /// The resource group name of the RoutingIntent. @@ -67,16 +54,16 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// Parameters supplied to create or update RoutingIntent. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -97,13 +84,13 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -112,47 +99,59 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routingIntentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routingIntentName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routingIntentName", routingIntentName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routingIntentName}", System.Uri.EscapeDataString(routingIntentName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -162,25 +161,24 @@ internal RoutingIntentOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -192,55 +190,56 @@ internal RoutingIntentOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -250,9 +249,10 @@ internal RoutingIntentOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -263,25 +263,29 @@ internal RoutingIntentOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a RoutingIntent. /// @@ -295,16 +299,16 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// The name of the RoutingIntent. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -323,13 +327,13 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -338,41 +342,52 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -382,25 +397,24 @@ internal RoutingIntentOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -412,55 +426,56 @@ internal RoutingIntentOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -470,9 +485,10 @@ internal RoutingIntentOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -483,27 +499,31 @@ internal RoutingIntentOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// Creates a RoutingIntent resource if it doesn't exist else updates the /// existing RoutingIntent. /// /// @@ -524,13 +544,13 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -539,52 +559,65 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (routingIntentParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routingIntentParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routingIntentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentName"); - } - if (routingIntentParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routingIntentName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routingIntentName", routingIntentName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("routingIntentParameters", routingIntentParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routingIntentName}", System.Uri.EscapeDataString(routingIntentName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -594,25 +627,24 @@ internal RoutingIntentOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -624,61 +656,62 @@ internal RoutingIntentOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(routingIntentParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routingIntentParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routingIntentParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -688,9 +721,10 @@ internal RoutingIntentOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -701,16 +735,16 @@ internal RoutingIntentOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -719,25 +753,29 @@ internal RoutingIntentOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a RoutingIntent. /// @@ -756,10 +794,10 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -768,47 +806,59 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routingIntentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routingIntentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routingIntentName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routingIntentName", routingIntentName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routingIntentName}", System.Uri.EscapeDataString(routingIntentName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -818,25 +868,24 @@ internal RoutingIntentOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -848,55 +897,56 @@ internal RoutingIntentOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -906,20 +956,25 @@ internal RoutingIntentOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all RoutingIntent child resources of the /// VirtualHub. @@ -933,13 +988,13 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -948,51 +1003,54 @@ internal RoutingIntentOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1004,55 +1062,56 @@ internal RoutingIntentOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1062,9 +1121,10 @@ internal RoutingIntentOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1075,24 +1135,28 @@ internal RoutingIntentOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperationsExtensions.cs index a9be8eebdc33..92601b55dd0b 100644 --- a/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/RoutingIntentOperationsExtensions.cs @@ -1,343 +1,315 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RoutingIntentOperations. + /// Extension methods for RoutingIntentOperations /// public static partial class RoutingIntentOperationsExtensions { - /// - /// Creates a RoutingIntent resource if it doesn't exist else updates the - /// existing RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the per VirtualHub singleton Routing Intent resource. - /// - /// - /// Parameters supplied to create or update RoutingIntent. - /// - public static RoutingIntent CreateOrUpdate(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a RoutingIntent resource if it doesn't exist else updates the - /// existing RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the per VirtualHub singleton Routing Intent resource. - /// - /// - /// Parameters supplied to create or update RoutingIntent. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the details of a RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RoutingIntent. - /// - public static RoutingIntent Get(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, routingIntentName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RoutingIntent. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RoutingIntent. - /// - public static void Delete(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, routingIntentName).GetAwaiter().GetResult(); - } + /// + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the per VirtualHub singleton Routing Intent resource. + /// + public static RoutingIntent CreateOrUpdate(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters) + { + return ((IRoutingIntentOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RoutingIntent. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the per VirtualHub singleton Routing Intent resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Retrieves the details of a RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RoutingIntent. + /// + public static RoutingIntent Get(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName) + { + return ((IRoutingIntentOperations)operations).GetAsync(resourceGroupName, virtualHubName, routingIntentName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all RoutingIntent child resources of the - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static IPage List(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName) + /// + /// Retrieves the details of a RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RoutingIntent. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RoutingIntent. + /// + public static void Delete(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName) + { + ((IRoutingIntentOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, routingIntentName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all RoutingIntent child resources of the - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RoutingIntent. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all RoutingIntent child resources of the + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage List(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IRoutingIntentOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Creates a RoutingIntent resource if it doesn't exist else updates the - /// existing RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the per VirtualHub singleton Routing Intent resource. - /// - /// - /// Parameters supplied to create or update RoutingIntent. - /// - public static RoutingIntent BeginCreateOrUpdate(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters) + /// + /// Retrieves the details of all RoutingIntent child resources of the + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the per VirtualHub singleton Routing Intent resource. + /// + public static RoutingIntent BeginCreateOrUpdate(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters) + { + return ((IRoutingIntentOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a RoutingIntent resource if it doesn't exist else updates the - /// existing RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the per VirtualHub singleton Routing Intent resource. - /// - /// - /// Parameters supplied to create or update RoutingIntent. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a RoutingIntent resource if it doesn't exist else updates the + /// existing RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the per VirtualHub singleton Routing Intent resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, RoutingIntent routingIntentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RoutingIntent. + /// + public static void BeginDelete(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName) + { + ((IRoutingIntentOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, routingIntentName).GetAwaiter().GetResult(); + } - /// - /// Deletes a RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RoutingIntent. - /// - public static void BeginDelete(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, routingIntentName).GetAwaiter().GetResult(); - } + /// + /// Deletes a RoutingIntent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the RoutingIntent. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the RoutingIntent. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all RoutingIntent child resources of the + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRoutingIntentOperations operations, string nextPageLink) + { + return ((IRoutingIntentOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a RoutingIntent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the RoutingIntent. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the RoutingIntent. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRoutingIntentOperations operations, string resourceGroupName, string virtualHubName, string routingIntentName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all RoutingIntent child resources of the + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRoutingIntentOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routingIntentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves the details of all RoutingIntent child resources of the - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRoutingIntentOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all RoutingIntent child resources of the - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRoutingIntentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperations.cs index d21e15f30658..4a3eb71ecfcd 100644 --- a/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ScopeConnectionsOperations operations. /// - internal partial class ScopeConnectionsOperations : IServiceOperations, IScopeConnectionsOperations + internal partial class ScopeConnectionsOperations : Microsoft.Rest.IServiceOperations, IScopeConnectionsOperations { /// /// Initializes a new instance of the ScopeConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class ScopeConnectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ScopeConnectionsOperations(NetworkManagementClient client) + internal ScopeConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,9 +41,6 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// Creates or updates scope connection from Network Manager /// - /// - /// Scope connection to be created/updated. - /// /// /// The name of the resource group. /// @@ -65,19 +50,22 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// Name for the cross-tenant connection. /// + /// + /// Scope connection to be created/updated. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -86,52 +74,65 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, ScopeConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (scopeConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scopeConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("scopeConnectionName", scopeConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{scopeConnectionName}", System.Uri.EscapeDataString(scopeConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -141,25 +142,24 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -171,61 +171,62 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -235,9 +236,10 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -248,16 +250,16 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -266,25 +268,29 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get specified scope connection created by this Network Manager. /// @@ -303,13 +309,13 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -318,47 +324,59 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (scopeConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scopeConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("scopeConnectionName", scopeConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{scopeConnectionName}", System.Uri.EscapeDataString(scopeConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -368,25 +386,24 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -398,55 +415,56 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -456,9 +474,10 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -469,25 +488,29 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete the pending scope connection created by this network manager. /// @@ -506,10 +529,10 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -518,47 +541,59 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (scopeConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scopeConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("scopeConnectionName", scopeConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{scopeConnectionName}", System.Uri.EscapeDataString(scopeConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -568,25 +603,24 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -598,55 +632,56 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -656,20 +691,25 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all scope connections created by this network manager. /// @@ -695,13 +735,13 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,61 +750,73 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -775,25 +827,24 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -805,55 +856,56 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -863,9 +915,10 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -876,25 +929,29 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all scope connections created by this network manager. /// @@ -907,13 +964,13 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -922,51 +979,54 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -978,55 +1038,56 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1036,9 +1097,10 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1049,24 +1111,28 @@ internal ScopeConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperationsExtensions.cs index a09347ad417f..4b388fbcdec7 100644 --- a/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ScopeConnectionsOperationsExtensions.cs @@ -1,260 +1,240 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ScopeConnectionsOperations. + /// Extension methods for ScopeConnectionsOperations /// public static partial class ScopeConnectionsOperationsExtensions { - /// - /// Creates or updates scope connection from Network Manager - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope connection to be created/updated. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Name for the cross-tenant connection. - /// - public static ScopeConnection CreateOrUpdate(this IScopeConnectionsOperations operations, ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName) - { - return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates scope connection from Network Manager - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope connection to be created/updated. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Name for the cross-tenant connection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IScopeConnectionsOperations operations, ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get specified scope connection created by this Network Manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Name for the cross-tenant connection. - /// - public static ScopeConnection Get(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); - } + /// + /// Creates or updates scope connection from Network Manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + public static ScopeConnection CreateOrUpdate(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, ScopeConnection parameters) + { + return ((IScopeConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, scopeConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Get specified scope connection created by this Network Manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Name for the cross-tenant connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates scope connection from Network Manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, ScopeConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get specified scope connection created by this Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + public static ScopeConnection Get(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName) + { + return ((IScopeConnectionsOperations)operations).GetAsync(resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); + } - /// - /// Delete the pending scope connection created by this network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Name for the cross-tenant connection. - /// - public static void Delete(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName) + /// + /// Get specified scope connection created by this Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete the pending scope connection created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + public static void Delete(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName) + { + ((IScopeConnectionsOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); + } - /// - /// Delete the pending scope connection created by this network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Name for the cross-tenant connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List all scope connections created by this network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); - } + /// + /// Delete the pending scope connection created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List all scope connections created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return ((IScopeConnectionsOperations)operations).ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// List all scope connections created by this network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all scope connections created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all scope connections created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IScopeConnectionsOperations operations, string nextPageLink) + { + return ((IScopeConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all scope connections created by this network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IScopeConnectionsOperations operations, string nextPageLink) + /// + /// List all scope connections created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IScopeConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all scope connections created by this network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IScopeConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/SdkInfo_NetworkManagementClient.cs b/src/Network/Network.Management.Sdk/Generated/SdkInfo_NetworkManagementClient.cs deleted file mode 100644 index e019615911c9..000000000000 --- a/src/Network/Network.Management.Sdk/Generated/SdkInfo_NetworkManagementClient.cs +++ /dev/null @@ -1,178 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_NetworkManagementClient - { - get - { - return new Tuple[] - { - new Tuple("Compute", "NetworkInterfaces", "2018-10-01"), - new Tuple("Compute", "NetworkInterfaces", "2023-06-01"), - new Tuple("Compute", "PublicIPAddresses", "2018-10-01"), - new Tuple("Compute", "PublicIPAddresses", "2023-06-01"), - new Tuple("Compute", "VipSwap", "2023-06-01"), - new Tuple("Management", "ManagementGroupNetworkManagerConnections", "2023-06-01"), - new Tuple("Network", "AdminRuleCollections", "2023-06-01"), - new Tuple("Network", "AdminRules", "2023-06-01"), - new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2023-06-01"), - new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2023-06-01"), - new Tuple("Network", "ApplicationGatewayWafDynamicManifests", "2023-06-01"), - new Tuple("Network", "ApplicationGatewayWafDynamicManifestsDefault", "2023-06-01"), - new Tuple("Network", "ApplicationGateways", "2023-06-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2023-06-01"), - new Tuple("Network", "AvailableDelegations", "2023-06-01"), - new Tuple("Network", "AvailableEndpointServices", "2023-06-01"), - new Tuple("Network", "AvailablePrivateEndpointTypes", "2023-06-01"), - new Tuple("Network", "AvailableResourceGroupDelegations", "2023-06-01"), - new Tuple("Network", "AvailableServiceAliases", "2023-06-01"), - new Tuple("Network", "AzureFirewallFqdnTags", "2023-06-01"), - new Tuple("Network", "AzureFirewalls", "2023-06-01"), - new Tuple("Network", "BastionHosts", "2023-06-01"), - new Tuple("Network", "BgpServiceCommunities", "2023-06-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2023-06-01"), - new Tuple("Network", "ConfigurationPolicyGroups", "2023-06-01"), - new Tuple("Network", "ConnectionMonitors", "2023-06-01"), - new Tuple("Network", "ConnectivityConfigurations", "2023-06-01"), - new Tuple("Network", "CustomIPPrefixes", "2023-06-01"), - new Tuple("Network", "DdosCustomPolicies", "2023-06-01"), - new Tuple("Network", "DdosProtectionPlans", "2023-06-01"), - new Tuple("Network", "DefaultSecurityRules", "2023-06-01"), - new Tuple("Network", "DeleteBastionShareableLink", "2023-06-01"), - new Tuple("Network", "DeleteBastionShareableLinkByToken", "2023-06-01"), - new Tuple("Network", "DisconnectActiveSessions", "2023-06-01"), - new Tuple("Network", "DscpConfiguration", "2023-06-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2023-06-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2023-06-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2023-06-01"), - new Tuple("Network", "ExpressRouteCircuits", "2023-06-01"), - new Tuple("Network", "ExpressRouteConnections", "2023-06-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2023-06-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2023-06-01"), - new Tuple("Network", "ExpressRouteGateways", "2023-06-01"), - new Tuple("Network", "ExpressRouteLinks", "2023-06-01"), - new Tuple("Network", "ExpressRoutePortAuthorizations", "2023-06-01"), - new Tuple("Network", "ExpressRoutePorts", "2023-06-01"), - new Tuple("Network", "ExpressRoutePortsLocations", "2023-06-01"), - new Tuple("Network", "ExpressRouteProviderPort", "2023-06-01"), - new Tuple("Network", "ExpressRouteProviderPortsLocation", "2023-06-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2023-06-01"), - new Tuple("Network", "FirewallPolicies", "2023-06-01"), - new Tuple("Network", "FirewallPolicyIdpsSignatures", "2023-06-01"), - new Tuple("Network", "FirewallPolicyIdpsSignaturesFilterValues", "2023-06-01"), - new Tuple("Network", "FirewallPolicyIdpsSignaturesOverrides", "2023-06-01"), - new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2023-06-01"), - new Tuple("Network", "FlowLogs", "2023-06-01"), - new Tuple("Network", "GetActiveSessions", "2023-06-01"), - new Tuple("Network", "GetBastionShareableLink", "2023-06-01"), - new Tuple("Network", "HubRouteTables", "2023-06-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2023-06-01"), - new Tuple("Network", "InboundNatRules", "2023-06-01"), - new Tuple("Network", "InboundSecurityRule", "2023-06-01"), - new Tuple("Network", "IpAllocations", "2023-06-01"), - new Tuple("Network", "IpGroups", "2023-06-01"), - new Tuple("Network", "ListActiveConnectivityConfigurations", "2023-06-01"), - new Tuple("Network", "ListActiveSecurityAdminRules", "2023-06-01"), - new Tuple("Network", "ListNetworkManagerEffectiveConnectivityConfigurations", "2023-06-01"), - new Tuple("Network", "ListNetworkManagerEffectiveSecurityAdminRules", "2023-06-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2023-06-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2023-06-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2023-06-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2023-06-01"), - new Tuple("Network", "LoadBalancerOutboundRules", "2023-06-01"), - new Tuple("Network", "LoadBalancerProbes", "2023-06-01"), - new Tuple("Network", "LoadBalancers", "2023-06-01"), - new Tuple("Network", "LocalNetworkGateways", "2023-06-01"), - new Tuple("Network", "NatGateways", "2023-06-01"), - new Tuple("Network", "NatRules", "2023-06-01"), - new Tuple("Network", "NetworkGroups", "2023-06-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2023-06-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2023-06-01"), - new Tuple("Network", "NetworkInterfaceTapConfigurations", "2023-06-01"), - new Tuple("Network", "NetworkInterfaces", "2023-06-01"), - new Tuple("Network", "NetworkManagerCommits", "2023-06-01"), - new Tuple("Network", "NetworkManagerDeploymentStatus", "2023-06-01"), - new Tuple("Network", "NetworkManagers", "2023-06-01"), - new Tuple("Network", "NetworkProfiles", "2023-06-01"), - new Tuple("Network", "NetworkSecurityGroups", "2023-06-01"), - new Tuple("Network", "NetworkVirtualApplianceConnections", "2023-06-01"), - new Tuple("Network", "NetworkVirtualAppliances", "2023-06-01"), - new Tuple("Network", "NetworkWatchers", "2023-06-01"), - new Tuple("Network", "Operations", "2023-06-01"), - new Tuple("Network", "P2SVpnGateways", "2023-06-01"), - new Tuple("Network", "P2sVpnGateways", "2023-06-01"), - new Tuple("Network", "PacketCaptures", "2023-06-01"), - new Tuple("Network", "PeerExpressRouteCircuitConnections", "2023-06-01"), - new Tuple("Network", "PrivateDnsZoneGroups", "2023-06-01"), - new Tuple("Network", "PrivateEndpoints", "2023-06-01"), - new Tuple("Network", "PrivateLinkServices", "2023-06-01"), - new Tuple("Network", "PublicIPAddresses", "2023-06-01"), - new Tuple("Network", "PublicIPPrefixes", "2023-06-01"), - new Tuple("Network", "PutBastionShareableLink", "2023-06-01"), - new Tuple("Network", "ResourceNavigationLinks", "2023-06-01"), - new Tuple("Network", "RouteFilterRules", "2023-06-01"), - new Tuple("Network", "RouteFilters", "2023-06-01"), - new Tuple("Network", "RouteMaps", "2023-06-01"), - new Tuple("Network", "RouteTables", "2023-06-01"), - new Tuple("Network", "Routes", "2023-06-01"), - new Tuple("Network", "RoutingIntent", "2023-06-01"), - new Tuple("Network", "ScopeConnections", "2023-06-01"), - new Tuple("Network", "SecurityAdminConfigurations", "2023-06-01"), - new Tuple("Network", "SecurityPartnerProviders", "2023-06-01"), - new Tuple("Network", "SecurityRules", "2023-06-01"), - new Tuple("Network", "ServiceAssociationLinks", "2023-06-01"), - new Tuple("Network", "ServiceEndpointPolicies", "2023-06-01"), - new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2023-06-01"), - new Tuple("Network", "ServiceTagInformation", "2023-06-01"), - new Tuple("Network", "ServiceTags", "2023-06-01"), - new Tuple("Network", "StaticMembers", "2023-06-01"), - new Tuple("Network", "Subnets", "2023-06-01"), - new Tuple("Network", "SubscriptionNetworkManagerConnections", "2023-06-01"), - new Tuple("Network", "SupportedSecurityProviders", "2023-06-01"), - new Tuple("Network", "Usages", "2023-06-01"), - new Tuple("Network", "VirtualApplianceSites", "2023-06-01"), - new Tuple("Network", "VirtualApplianceSkus", "2023-06-01"), - new Tuple("Network", "VirtualHubBgpConnection", "2023-06-01"), - new Tuple("Network", "VirtualHubBgpConnections", "2023-06-01"), - new Tuple("Network", "VirtualHubIpConfiguration", "2023-06-01"), - new Tuple("Network", "VirtualHubRouteTableV2s", "2023-06-01"), - new Tuple("Network", "VirtualHubs", "2023-06-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2023-06-01"), - new Tuple("Network", "VirtualNetworkGatewayNatRules", "2023-06-01"), - new Tuple("Network", "VirtualNetworkGateways", "2023-06-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2023-06-01"), - new Tuple("Network", "VirtualNetworkTaps", "2023-06-01"), - new Tuple("Network", "VirtualNetworks", "2023-06-01"), - new Tuple("Network", "VirtualRouterPeerings", "2023-06-01"), - new Tuple("Network", "VirtualRouters", "2023-06-01"), - new Tuple("Network", "VirtualWans", "2023-06-01"), - new Tuple("Network", "VpnConnections", "2023-06-01"), - new Tuple("Network", "VpnGateways", "2023-06-01"), - new Tuple("Network", "VpnLinkConnections", "2023-06-01"), - new Tuple("Network", "VpnServerConfigurations", "2023-06-01"), - new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2023-06-01"), - new Tuple("Network", "VpnSiteLinkConnections", "2023-06-01"), - new Tuple("Network", "VpnSiteLinks", "2023-06-01"), - new Tuple("Network", "VpnSites", "2023-06-01"), - new Tuple("Network", "VpnSitesConfiguration", "2023-06-01"), - new Tuple("Network", "WebApplicationFirewallPolicies", "2023-06-01"), - new Tuple("Network", "WebCategories", "2023-06-01"), - new Tuple("Network", "configurationPolicyGroups", "2023-06-01"), - new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2023-06-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperations.cs index 8bf2eb3cbaa4..434904b4948a 100644 --- a/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SecurityAdminConfigurationsOperations operations. /// - internal partial class SecurityAdminConfigurationsOperations : IServiceOperations, ISecurityAdminConfigurationsOperations + internal partial class SecurityAdminConfigurationsOperations : Microsoft.Rest.IServiceOperations, ISecurityAdminConfigurationsOperations { /// /// Initializes a new instance of the SecurityAdminConfigurationsOperations class. @@ -36,13 +24,13 @@ internal partial class SecurityAdminConfigurationsOperations : IServiceOperation /// /// Thrown when a required parameter is null /// - internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) + internal SecurityAdminConfigurationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -76,13 +64,13 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -91,61 +79,73 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -156,25 +156,24 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -186,55 +185,56 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -244,9 +244,10 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -257,25 +258,29 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves a network manager security admin configuration. /// @@ -294,13 +299,13 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -309,47 +314,59 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -359,25 +376,24 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -389,55 +405,56 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -447,9 +464,10 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -460,31 +478,32 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a network manager security admin configuration. /// - /// - /// The security admin configuration to create or update - /// /// /// The name of the resource group. /// @@ -494,19 +513,22 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// The name of the network manager Security Configuration. /// + /// + /// The security admin configuration to create or update + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -515,52 +537,65 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(SecurityAdminConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, SecurityAdminConfiguration securityAdminConfiguration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (securityAdminConfiguration == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityAdminConfiguration"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityAdminConfiguration"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("securityAdminConfiguration", securityAdminConfiguration); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); + + tracingParameters.Add("securityAdminConfiguration", securityAdminConfiguration); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -570,25 +605,24 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -600,61 +634,62 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(securityAdminConfiguration != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityAdminConfiguration, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(securityAdminConfiguration, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -664,9 +699,10 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -677,16 +713,16 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -695,25 +731,29 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a network manager security admin configuration. /// @@ -732,16 +772,16 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// in the background, prior to the delete. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -767,10 +807,10 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -779,80 +819,92 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("force", force); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); - List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -864,55 +916,56 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -922,33 +975,38 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the network manager security admin configurations in a network /// manager, in a paginated format. @@ -962,13 +1020,13 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -977,51 +1035,54 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1033,55 +1094,56 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1091,9 +1153,10 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1104,24 +1167,28 @@ internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperationsExtensions.cs index c926d414774e..ab23d41e7006 100644 --- a/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/SecurityAdminConfigurationsOperationsExtensions.cs @@ -1,333 +1,312 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SecurityAdminConfigurationsOperations. + /// Extension methods for SecurityAdminConfigurationsOperations /// public static partial class SecurityAdminConfigurationsOperationsExtensions { - /// - /// Lists all the network manager security admin configurations in a network - /// manager, in a paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Lists all the network manager security admin configurations in a network - /// manager, in a paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return ((ISecurityAdminConfigurationsOperations)operations).ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Retrieves a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - public static SecurityAdminConfiguration Get(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + public static SecurityAdminConfiguration Get(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return ((ISecurityAdminConfigurationsOperations)operations).GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + public static SecurityAdminConfiguration CreateOrUpdate(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, SecurityAdminConfiguration securityAdminConfiguration) + { + return ((ISecurityAdminConfigurationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, configurationName, securityAdminConfiguration).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The security admin configuration to create or update - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - public static SecurityAdminConfiguration CreateOrUpdate(this ISecurityAdminConfigurationsOperations operations, SecurityAdminConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, SecurityAdminConfiguration securityAdminConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, securityAdminConfiguration, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static SecurityAdminConfigurationsDeleteHeaders Delete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return ((ISecurityAdminConfigurationsOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The security admin configuration to create or update - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISecurityAdminConfigurationsOperations operations, SecurityAdminConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static SecurityAdminConfigurationsDeleteHeaders BeginDelete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return ((ISecurityAdminConfigurationsOperations)operations).BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); + } - /// - /// Deletes a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static SecurityAdminConfigurationsDeleteHeaders Delete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager Security Configuration. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityAdminConfigurationsOperations operations, string nextPageLink) + { + return ((ISecurityAdminConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISecurityAdminConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// Deletes a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - public static SecurityAdminConfigurationsDeleteHeaders BeginDelete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) - { - return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).GetAwaiter().GetResult(); - } - - /// - /// Deletes a network manager security admin configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager Security Configuration. - /// - /// - /// Deletes the resource even if it is part of a deployed configuration. If the - /// configuration has been deployed, the service will do a cleanup deployment - /// in the background, prior to the delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists all the network manager security admin configurations in a network - /// manager, in a paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISecurityAdminConfigurationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the network manager security admin configurations in a network - /// manager, in a paginated format. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISecurityAdminConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperations.cs b/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperations.cs index a2a01e1ced17..88e3b746505f 100644 --- a/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SecurityPartnerProvidersOperations operations. /// - internal partial class SecurityPartnerProvidersOperations : IServiceOperations, ISecurityPartnerProvidersOperations + internal partial class SecurityPartnerProvidersOperations : Microsoft.Rest.IServiceOperations, ISecurityPartnerProvidersOperations { /// /// Initializes a new instance of the SecurityPartnerProvidersOperations class. @@ -36,13 +24,13 @@ internal partial class SecurityPartnerProvidersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SecurityPartnerProvidersOperations(NetworkManagementClient client) + internal SecurityPartnerProvidersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// The name of the Security Partner Provider. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (securityPartnerProviderName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityPartnerProviderName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityPartnerProviderName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("securityPartnerProviderName", securityPartnerProviderName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{securityPartnerProviderName}", System.Uri.EscapeDataString(securityPartnerProviderName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Security Partner Provider. /// @@ -280,16 +284,16 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -310,13 +314,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -325,46 +329,57 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (securityPartnerProviderName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityPartnerProviderName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (securityPartnerProviderName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityPartnerProviderName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("securityPartnerProviderName", securityPartnerProviderName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{securityPartnerProviderName}", System.Uri.EscapeDataString(securityPartnerProviderName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -374,25 +389,24 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -404,61 +418,62 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -468,9 +483,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -481,25 +497,29 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Security Partner Providers in a resource group. /// @@ -512,13 +532,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -527,35 +547,45 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +595,24 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +624,56 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +683,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +697,29 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Security Partner Providers in a subscription. /// @@ -694,13 +729,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -709,29 +744,38 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +785,24 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,55 +814,56 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,9 +873,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -842,25 +887,29 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Security Partner Provider. /// @@ -876,10 +925,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -888,41 +937,52 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (securityPartnerProviderName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityPartnerProviderName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityPartnerProviderName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("securityPartnerProviderName", securityPartnerProviderName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{securityPartnerProviderName}", System.Uri.EscapeDataString(securityPartnerProviderName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -932,25 +992,24 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -962,55 +1021,56 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1020,20 +1080,25 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Security Partner Provider. /// @@ -1053,13 +1118,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1068,46 +1133,58 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (securityPartnerProviderName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityPartnerProviderName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (securityPartnerProviderName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityPartnerProviderName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("securityPartnerProviderName", securityPartnerProviderName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{securityPartnerProviderName}", System.Uri.EscapeDataString(securityPartnerProviderName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1117,25 +1194,24 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1147,61 +1223,62 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1211,9 +1288,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1224,16 +1302,16 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1242,25 +1320,29 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Security Partner Providers in a resource group. /// @@ -1273,13 +1355,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1288,51 +1370,54 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1344,55 +1429,56 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1402,9 +1488,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1415,25 +1502,29 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Security Partner Providers in a subscription. /// @@ -1446,13 +1537,13 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1461,51 +1552,54 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1517,55 +1611,56 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1575,9 +1670,10 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1588,24 +1684,28 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperationsExtensions.cs index 1fbb83503274..90396ba43c24 100644 --- a/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/SecurityPartnerProvidersOperationsExtensions.cs @@ -1,411 +1,370 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SecurityPartnerProvidersOperations. + /// Extension methods for SecurityPartnerProvidersOperations /// public static partial class SecurityPartnerProvidersOperationsExtensions { - /// - /// Deletes the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - public static void Delete(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName) - { - operations.DeleteAsync(resourceGroupName, securityPartnerProviderName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - public static SecurityPartnerProvider Get(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName) - { - return operations.GetAsync(resourceGroupName, securityPartnerProviderName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + public static void Delete(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName) + { + ((ISecurityPartnerProvidersOperations)operations).DeleteAsync(resourceGroupName, securityPartnerProviderName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + public static SecurityPartnerProvider Get(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName) + { + return ((ISecurityPartnerProvidersOperations)operations).GetAsync(resourceGroupName, securityPartnerProviderName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// Parameters supplied to the create or update Security Partner Provider - /// operation. - /// - public static SecurityPartnerProvider CreateOrUpdate(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters) + /// + /// Gets the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + public static SecurityPartnerProvider CreateOrUpdate(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters) + { + return ((ISecurityPartnerProvidersOperations)operations).CreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// Parameters supplied to the create or update Security Partner Provider - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates tags of a Security Partner Provider resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + public static SecurityPartnerProvider UpdateTags(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, TagsObject parameters) + { + return ((ISecurityPartnerProvidersOperations)operations).UpdateTagsAsync(resourceGroupName, securityPartnerProviderName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a Security Partner Provider resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// Parameters supplied to update Security Partner Provider tags. - /// - public static SecurityPartnerProvider UpdateTags(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, TagsObject parameters) + /// + /// Updates tags of a Security Partner Provider resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, securityPartnerProviderName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Security Partner Providers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ISecurityPartnerProvidersOperations operations, string resourceGroupName) + { + return ((ISecurityPartnerProvidersOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a Security Partner Provider resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// Parameters supplied to update Security Partner Provider tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Security Partner Providers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the Security Partner Providers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this ISecurityPartnerProvidersOperations operations) + { + return ((ISecurityPartnerProvidersOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all Security Partner Providers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this ISecurityPartnerProvidersOperations operations, string resourceGroupName) + /// + /// Gets all the Security Partner Providers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISecurityPartnerProvidersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + public static void BeginDelete(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName) + { + ((ISecurityPartnerProvidersOperations)operations).BeginDeleteAsync(resourceGroupName, securityPartnerProviderName).GetAwaiter().GetResult(); + } - /// - /// Lists all Security Partner Providers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + public static SecurityPartnerProvider BeginCreateOrUpdate(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters) + { + return ((ISecurityPartnerProvidersOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all the Security Partner Providers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this ISecurityPartnerProvidersOperations operations) + /// + /// Creates or updates the specified Security Partner Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Security Partner Provider. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Security Partner Providers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ISecurityPartnerProvidersOperations operations, string nextPageLink) + { + return ((ISecurityPartnerProvidersOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the Security Partner Providers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISecurityPartnerProvidersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Security Partner Providers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this ISecurityPartnerProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the Security Partner Providers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityPartnerProvidersOperations operations, string nextPageLink) + { + return ((ISecurityPartnerProvidersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - public static void BeginDelete(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName) + /// + /// Gets all the Security Partner Providers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISecurityPartnerProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, securityPartnerProviderName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// Parameters supplied to the create or update Security Partner Provider - /// operation. - /// - public static SecurityPartnerProvider BeginCreateOrUpdate(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified Security Partner Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Security Partner Provider. - /// - /// - /// Parameters supplied to the create or update Security Partner Provider - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ISecurityPartnerProvidersOperations operations, string resourceGroupName, string securityPartnerProviderName, SecurityPartnerProvider parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, securityPartnerProviderName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all Security Partner Providers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this ISecurityPartnerProvidersOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Security Partner Providers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this ISecurityPartnerProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the Security Partner Providers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISecurityPartnerProvidersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Security Partner Providers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISecurityPartnerProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperations.cs index a51154e92e7f..1dc987b09af0 100644 --- a/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SecurityRulesOperations operations. /// - internal partial class SecurityRulesOperations : IServiceOperations, ISecurityRulesOperations + internal partial class SecurityRulesOperations : Microsoft.Rest.IServiceOperations, ISecurityRulesOperations { /// /// Initializes a new instance of the SecurityRulesOperations class. @@ -36,13 +24,13 @@ internal partial class SecurityRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SecurityRulesOperations(NetworkManagementClient client) + internal SecurityRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// The name of the security rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (securityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal SecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a security rule in the specified network security group. /// @@ -295,16 +300,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +327,13 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +342,52 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +426,56 @@ internal SecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +485,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,25 +499,29 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified network security rule. /// @@ -519,10 +540,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,47 +552,59 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (securityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -581,25 +614,24 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -611,55 +643,56 @@ internal SecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -669,20 +702,25 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a security rule in the specified network security group. /// @@ -705,13 +743,13 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -720,56 +758,65 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (securityRuleParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (securityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); - } - if (securityRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleParameters"); - } - if (securityRuleParameters != null) - { - securityRuleParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); - tracingParameters.Add("securityRuleParameters", securityRuleParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("securityRuleParameters", securityRuleParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -779,25 +826,24 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -809,61 +855,62 @@ internal SecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(securityRuleParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityRuleParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(securityRuleParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -873,9 +920,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -886,16 +934,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -904,25 +952,29 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all security rules in a network security group. /// @@ -935,13 +987,13 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -950,51 +1002,54 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1006,55 +1061,56 @@ internal SecurityRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1064,9 +1120,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1077,24 +1134,28 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperationsExtensions.cs index 73a6f6d3a154..2147bbd2fd8a 100644 --- a/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/SecurityRulesOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SecurityRulesOperations. + /// Extension methods for SecurityRulesOperations /// public static partial class SecurityRulesOperationsExtensions { - /// - /// Deletes the specified network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - public static void Delete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) - { - operations.DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get the specified network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) - { - return operations.GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).GetAwaiter().GetResult(); - } - - /// - /// Get the specified network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a security rule in the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + public static void Delete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + { + ((ISecurityRulesOperations)operations).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a security rule in the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get the specified network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + { + return ((ISecurityRulesOperations)operations).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).GetAwaiter().GetResult(); + } - /// - /// Gets all security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - public static IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) + /// + /// Get the specified network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a security rule in the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + { + return ((ISecurityRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a security rule in the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static Microsoft.Rest.Azure.IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) + { + return ((ISecurityRulesOperations)operations).ListAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + /// + /// Gets all security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + { + ((ISecurityRulesOperations)operations).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified network security rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified network security rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a security rule in the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + { + return ((ISecurityRulesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a security rule in the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + /// + /// Creates or updates a security rule in the specified network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + /// + /// The name of the security rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityRulesOperations operations, string nextPageLink) + { + return ((ISecurityRulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a security rule in the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all security rules in a network security group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISecurityRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISecurityRulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all security rules in a network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISecurityRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperations.cs index c5a0f475c9c2..9e824e6c1f37 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceAssociationLinksOperations operations. /// - internal partial class ServiceAssociationLinksOperations : IServiceOperations, IServiceAssociationLinksOperations + internal partial class ServiceAssociationLinksOperations : Microsoft.Rest.IServiceOperations, IServiceAssociationLinksOperations { /// /// Initializes a new instance of the ServiceAssociationLinksOperations class. @@ -36,13 +24,13 @@ internal partial class ServiceAssociationLinksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ServiceAssociationLinksOperations(NetworkManagementClient client) + internal ServiceAssociationLinksOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,24 +235,28 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperationsExtensions.cs index f5b506f6c519..488c3f8a2256 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceAssociationLinksOperationsExtensions.cs @@ -1,71 +1,61 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ServiceAssociationLinksOperations. + /// Extension methods for ServiceAssociationLinksOperations /// public static partial class ServiceAssociationLinksOperationsExtensions { - /// - /// Gets a list of service association links for a subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - public static ServiceAssociationLinksListResult List(this IServiceAssociationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) - { - return operations.ListAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); - } + /// + /// Gets a list of service association links for a subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static ServiceAssociationLinksListResult List(this IServiceAssociationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) + { + return ((IServiceAssociationLinksOperations)operations).ListAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of service association links for a subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IServiceAssociationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of service association links for a subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IServiceAssociationLinksOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperations.cs index a682f2d09e42..09830bb74d95 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceEndpointPoliciesOperations operations. /// - internal partial class ServiceEndpointPoliciesOperations : IServiceOperations, IServiceEndpointPoliciesOperations + internal partial class ServiceEndpointPoliciesOperations : Microsoft.Rest.IServiceOperations, IServiceEndpointPoliciesOperations { /// /// Initializes a new instance of the ServiceEndpointPoliciesOperations class. @@ -36,13 +24,13 @@ internal partial class ServiceEndpointPoliciesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) + internal ServiceEndpointPoliciesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// The name of the service endpoint policy. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a service Endpoint Policies. /// @@ -288,16 +293,16 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -318,13 +323,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -333,46 +338,57 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (serviceEndpointPolicyName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -382,25 +398,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -412,61 +427,62 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -476,9 +492,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -489,25 +506,29 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the service endpoint policies in a subscription. /// @@ -517,13 +538,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -532,29 +553,38 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -564,25 +594,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -594,55 +623,56 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -652,9 +682,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -665,25 +696,29 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all service endpoint Policies in a resource group. /// @@ -696,13 +731,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -711,35 +746,45 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -749,25 +794,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -779,55 +823,56 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -837,9 +882,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -850,25 +896,29 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified service endpoint policy. /// @@ -884,10 +934,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -896,41 +946,52 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -940,25 +1001,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -970,55 +1030,56 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1028,20 +1089,25 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a service Endpoint Policies. /// @@ -1061,13 +1127,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1076,46 +1142,58 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (serviceEndpointPolicyName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1125,25 +1203,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1155,61 +1232,62 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1219,9 +1297,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1232,16 +1311,16 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1250,25 +1329,29 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the service endpoint policies in a subscription. /// @@ -1281,13 +1364,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1296,51 +1379,54 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1352,55 +1438,56 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1410,9 +1497,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1423,25 +1511,29 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all service endpoint Policies in a resource group. /// @@ -1454,13 +1546,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1469,51 +1561,54 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1525,55 +1620,56 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1583,9 +1679,10 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1596,24 +1693,28 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperationsExtensions.cs index b90898aeb463..4fc4e461ed92 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPoliciesOperationsExtensions.cs @@ -1,417 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ServiceEndpointPoliciesOperations. + /// Extension methods for ServiceEndpointPoliciesOperations /// public static partial class ServiceEndpointPoliciesOperationsExtensions { - /// - /// Deletes the specified service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - public static void Delete(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName) - { - operations.DeleteAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified service Endpoint Policies in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Expands referenced resources. - /// - public static ServiceEndpointPolicy Get(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, serviceEndpointPolicyName, expand).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static void Delete(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + { + ((IServiceEndpointPoliciesOperations)operations).DeleteAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified service Endpoint Policies in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Expands referenced resources. + /// + public static ServiceEndpointPolicy Get(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string)) + { + return ((IServiceEndpointPoliciesOperations)operations).GetAsync(resourceGroupName, serviceEndpointPolicyName, expand).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a service Endpoint Policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - public static ServiceEndpointPolicy CreateOrUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters) + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static ServiceEndpointPolicy CreateOrUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters) + { + return ((IServiceEndpointPoliciesOperations)operations).CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a service Endpoint Policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates tags of a service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static ServiceEndpointPolicy UpdateTags(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters) + { + return ((IServiceEndpointPoliciesOperations)operations).UpdateTagsAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates tags of a service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Parameters supplied to update service endpoint policy tags. - /// - public static ServiceEndpointPolicy UpdateTags(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters) + /// + /// Updates tags of a service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IServiceEndpointPoliciesOperations operations) + { + return ((IServiceEndpointPoliciesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Updates tags of a service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Parameters supplied to update service endpoint policy tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IServiceEndpointPoliciesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all service endpoint Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IServiceEndpointPoliciesOperations operations, string resourceGroupName) + { + return ((IServiceEndpointPoliciesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all the service endpoint policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IServiceEndpointPoliciesOperations operations) + /// + /// Gets all service endpoint Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static void BeginDelete(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + { + ((IServiceEndpointPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + } - /// - /// Gets all the service endpoint policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IServiceEndpointPoliciesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static ServiceEndpointPolicy BeginCreateOrUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters) + { + return ((IServiceEndpointPoliciesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all service endpoint Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IServiceEndpointPoliciesOperations operations, string resourceGroupName) + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IServiceEndpointPoliciesOperations operations, string nextPageLink) + { + return ((IServiceEndpointPoliciesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all service endpoint Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IServiceEndpointPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all service endpoint Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IServiceEndpointPoliciesOperations operations, string nextPageLink) + { + return ((IServiceEndpointPoliciesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - public static void BeginDelete(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + /// + /// Gets all service endpoint Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IServiceEndpointPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a service Endpoint Policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - public static ServiceEndpointPolicy BeginCreateOrUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a service Endpoint Policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the service endpoint policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IServiceEndpointPoliciesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the service endpoint policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IServiceEndpointPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all service endpoint Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IServiceEndpointPoliciesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all service endpoint Policies in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IServiceEndpointPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperations.cs index 554da00a32eb..4b80e6d12f1a 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceEndpointPolicyDefinitionsOperations operations. /// - internal partial class ServiceEndpointPolicyDefinitionsOperations : IServiceOperations, IServiceEndpointPolicyDefinitionsOperations + internal partial class ServiceEndpointPolicyDefinitionsOperations : Microsoft.Rest.IServiceOperations, IServiceEndpointPolicyDefinitionsOperations { /// /// Initializes a new instance of the ServiceEndpointPolicyDefinitionsOperations class. @@ -36,13 +24,13 @@ internal partial class ServiceEndpointPolicyDefinitionsOperations : IServiceOper /// /// Thrown when a required parameter is null /// - internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient client) + internal ServiceEndpointPolicyDefinitionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// The name of the service endpoint policy definition. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -94,13 +82,13 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -109,47 +97,59 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } + if (serviceEndpointPolicyDefinitionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); tracingParameters.Add("serviceEndpointPolicyDefinitionName", serviceEndpointPolicyDefinitionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); _url = _url.Replace("{serviceEndpointPolicyDefinitionName}", System.Uri.EscapeDataString(serviceEndpointPolicyDefinitionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -159,25 +159,24 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -189,55 +188,56 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -247,9 +247,10 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -260,28 +261,31 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates or updates a service endpoint policy definition in the specified - /// service endpoint policy. + /// Creates or updates a service endpoint policy definition in the specified service endpoint policy. /// /// /// The name of the resource group. @@ -297,16 +301,16 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -324,13 +328,13 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -339,41 +343,52 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -383,25 +398,24 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -413,55 +427,56 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -471,9 +486,10 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -484,25 +500,29 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified ServiceEndpoint policy definitions. /// @@ -521,10 +541,10 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -533,47 +553,59 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } + if (serviceEndpointPolicyDefinitionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); tracingParameters.Add("serviceEndpointPolicyDefinitionName", serviceEndpointPolicyDefinitionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); _url = _url.Replace("{serviceEndpointPolicyDefinitionName}", System.Uri.EscapeDataString(serviceEndpointPolicyDefinitionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -583,25 +615,24 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -613,55 +644,56 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -671,20 +703,25 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a service endpoint policy definition in the specified /// service endpoint policy. @@ -708,13 +745,13 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -723,52 +760,65 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (serviceEndpointPolicyDefinitions == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitions"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (serviceEndpointPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); } + if (serviceEndpointPolicyDefinitionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); - } - if (serviceEndpointPolicyDefinitions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitions"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); tracingParameters.Add("serviceEndpointPolicyDefinitionName", serviceEndpointPolicyDefinitionName); - tracingParameters.Add("serviceEndpointPolicyDefinitions", serviceEndpointPolicyDefinitions); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("serviceEndpointPolicyDefinitions", serviceEndpointPolicyDefinitions); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); _url = _url.Replace("{serviceEndpointPolicyDefinitionName}", System.Uri.EscapeDataString(serviceEndpointPolicyDefinitionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -778,25 +828,24 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -808,61 +857,62 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(serviceEndpointPolicyDefinitions != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(serviceEndpointPolicyDefinitions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(serviceEndpointPolicyDefinitions, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -872,9 +922,10 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -885,16 +936,16 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -903,25 +954,29 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all service endpoint policy definitions in a service end point policy. /// @@ -934,13 +989,13 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -949,51 +1004,54 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1005,55 +1063,56 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1063,9 +1122,10 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1076,24 +1136,28 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs index dc2f803a5d65..19ab322b1a3a 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs @@ -1,345 +1,313 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ServiceEndpointPolicyDefinitionsOperations. + /// Extension methods for ServiceEndpointPolicyDefinitionsOperations /// public static partial class ServiceEndpointPolicyDefinitionsOperationsExtensions { - /// - /// Deletes the specified ServiceEndpoint policy definitions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Service Endpoint Policy. - /// - /// - /// The name of the service endpoint policy definition. - /// - public static void Delete(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) - { - operations.DeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified ServiceEndpoint policy definitions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Service Endpoint Policy. - /// - /// - /// The name of the service endpoint policy definition. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get the specified service endpoint policy definitions from service endpoint - /// policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy name. - /// - /// - /// The name of the service endpoint policy definition name. - /// - public static ServiceEndpointPolicyDefinition Get(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) - { - return operations.GetAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); - } - - /// - /// Get the specified service endpoint policy definitions from service endpoint - /// policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy name. - /// - /// - /// The name of the service endpoint policy definition name. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a service endpoint policy definition in the specified - /// service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// The name of the service endpoint policy definition name. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - public static ServiceEndpointPolicyDefinition CreateOrUpdate(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions) - { - return operations.CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + public static void Delete(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + { + ((IServiceEndpointPolicyDefinitionsOperations)operations).DeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a service endpoint policy definition in the specified - /// service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// The name of the service endpoint policy definition name. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The name of the service endpoint policy definition name. + /// + public static ServiceEndpointPolicyDefinition Get(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + { + return ((IServiceEndpointPolicyDefinitionsOperations)operations).GetAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + } - /// - /// Gets all service endpoint policy definitions in a service end point policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy name. - /// - public static IPage ListByResourceGroup(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + /// + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + public static ServiceEndpointPolicyDefinition CreateOrUpdate(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions) + { + return ((IServiceEndpointPolicyDefinitionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).GetAwaiter().GetResult(); + } - /// - /// Gets all service endpoint policy definitions in a service end point policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + { + return ((IServiceEndpointPolicyDefinitionsOperations)operations).ListByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ServiceEndpoint policy definitions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Service Endpoint Policy. - /// - /// - /// The name of the service endpoint policy definition. - /// - public static void BeginDelete(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + public static void BeginDelete(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + { + ((IServiceEndpointPolicyDefinitionsOperations)operations).BeginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified ServiceEndpoint policy definitions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Service Endpoint Policy. - /// - /// - /// The name of the service endpoint policy definition. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + public static ServiceEndpointPolicyDefinition BeginCreateOrUpdate(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions) + { + return ((IServiceEndpointPolicyDefinitionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a service endpoint policy definition in the specified - /// service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// The name of the service endpoint policy definition name. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - public static ServiceEndpointPolicyDefinition BeginCreateOrUpdate(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions) + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IServiceEndpointPolicyDefinitionsOperations operations, string nextPageLink) + { + return ((IServiceEndpointPolicyDefinitionsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a service endpoint policy definition in the specified - /// service endpoint policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the service endpoint policy. - /// - /// - /// The name of the service endpoint policy definition name. - /// - /// - /// Parameters supplied to the create or update service endpoint policy - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all service endpoint policy definitions in a service end point policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IServiceEndpointPolicyDefinitionsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all service endpoint policy definitions in a service end point policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperations.cs b/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperations.cs index 2dbae8b5660a..f7aee915ddd7 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceTagInformationOperations operations. /// - internal partial class ServiceTagInformationOperations : IServiceOperations, IServiceTagInformationOperations + internal partial class ServiceTagInformationOperations : Microsoft.Rest.IServiceOperations, IServiceTagInformationOperations { /// /// Initializes a new instance of the ServiceTagInformationOperations class. @@ -36,13 +24,13 @@ internal partial class ServiceTagInformationOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ServiceTagInformationOperations(NetworkManagementClient client) + internal ServiceTagInformationOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -71,13 +59,13 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -86,44 +74,56 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("noAddressPrefixes", noAddressPrefixes); tracingParameters.Add("tagName", tagName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (noAddressPrefixes != null) { - _queryParameters.Add(string.Format("noAddressPrefixes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(noAddressPrefixes, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("noAddressPrefixes={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(noAddressPrefixes, this.Client.SerializationSettings).Trim('"')))); } if (tagName != null) { @@ -134,25 +134,24 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -164,55 +163,56 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -222,9 +222,10 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -235,25 +236,29 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of service tag information resources with pagination. /// @@ -266,13 +271,13 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -281,51 +286,54 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -337,55 +345,56 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -395,9 +404,10 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -408,24 +418,28 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperationsExtensions.cs index 9ff6673175ef..02e703a88adc 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceTagInformationOperationsExtensions.cs @@ -1,111 +1,100 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ServiceTagInformationOperations. + /// Extension methods for ServiceTagInformationOperations /// public static partial class ServiceTagInformationOperationsExtensions { - /// - /// Gets a list of service tag information resources with pagination. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location that will be used as a reference for cloud (not as a filter - /// based on location, you will get the list of service tags with prefix - /// details across all regions but limited to the cloud that your subscription - /// belongs to). - /// - /// - /// Do not return address prefixes for the tag(s). - /// - /// - /// Return tag information for a particular tag. - /// - public static IPage List(this IServiceTagInformationOperations operations, string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string)) - { - return operations.ListAsync(location, noAddressPrefixes, tagName).GetAwaiter().GetResult(); - } + /// + /// Gets a list of service tag information resources with pagination. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location that will be used as a reference for cloud (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). + /// + /// + /// Do not return address prefixes for the tag(s). + /// + /// + /// Return tag information for a particular tag. + /// + public static Microsoft.Rest.Azure.IPage List(this IServiceTagInformationOperations operations, string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string)) + { + return ((IServiceTagInformationOperations)operations).ListAsync(location, noAddressPrefixes, tagName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of service tag information resources with pagination. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location that will be used as a reference for cloud (not as a filter - /// based on location, you will get the list of service tags with prefix - /// details across all regions but limited to the cloud that your subscription - /// belongs to). - /// - /// - /// Do not return address prefixes for the tag(s). - /// - /// - /// Return tag information for a particular tag. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IServiceTagInformationOperations operations, string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of service tag information resources with pagination. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location that will be used as a reference for cloud (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). + /// + /// + /// Do not return address prefixes for the tag(s). + /// + /// + /// Return tag information for a particular tag. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IServiceTagInformationOperations operations, string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, noAddressPrefixes, tagName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, noAddressPrefixes, tagName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a list of service tag information resources with pagination. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IServiceTagInformationOperations operations, string nextPageLink) + { + return ((IServiceTagInformationOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets a list of service tag information resources with pagination. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IServiceTagInformationOperations operations, string nextPageLink) + /// + /// Gets a list of service tag information resources with pagination. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IServiceTagInformationOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets a list of service tag information resources with pagination. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IServiceTagInformationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperations.cs b/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperations.cs index 717244d43c62..516ce223a45b 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceTagsOperations operations. /// - internal partial class ServiceTagsOperations : IServiceOperations, IServiceTagsOperations + internal partial class ServiceTagsOperations : Microsoft.Rest.IServiceOperations, IServiceTagsOperations { /// /// Initializes a new instance of the ServiceTagsOperations class. @@ -36,13 +24,13 @@ internal partial class ServiceTagsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ServiceTagsOperations(NetworkManagementClient client) + internal ServiceTagsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal ServiceTagsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,35 +68,45 @@ internal ServiceTagsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -118,25 +116,24 @@ internal ServiceTagsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -148,55 +145,56 @@ internal ServiceTagsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -206,9 +204,10 @@ internal ServiceTagsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -219,24 +218,28 @@ internal ServiceTagsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperationsExtensions.cs index be01db34c7b1..9a19541c52bc 100644 --- a/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/ServiceTagsOperationsExtensions.cs @@ -1,65 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ServiceTagsOperations. + /// Extension methods for ServiceTagsOperations /// public static partial class ServiceTagsOperationsExtensions { - /// - /// Gets a list of service tag information resources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location that will be used as a reference for version (not as a filter - /// based on location, you will get the list of service tags with prefix - /// details across all regions but limited to the cloud that your subscription - /// belongs to). - /// - public static ServiceTagsListResult List(this IServiceTagsOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Gets a list of service tag information resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location that will be used as a reference for version (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). + /// + public static ServiceTagsListResult List(this IServiceTagsOperations operations, string location) + { + return ((IServiceTagsOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets a list of service tag information resources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location that will be used as a reference for version (not as a filter - /// based on location, you will get the list of service tags with prefix - /// details across all regions but limited to the cloud that your subscription - /// belongs to). - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IServiceTagsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of service tag information resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location that will be used as a reference for version (not as a filter + /// based on location, you will get the list of service tags with prefix + /// details across all regions but limited to the cloud that your subscription + /// belongs to). + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IServiceTagsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/StaticMembersOperations.cs b/src/Network/Network.Management.Sdk/Generated/StaticMembersOperations.cs index 4f9665d44927..21a62b27bed3 100644 --- a/src/Network/Network.Management.Sdk/Generated/StaticMembersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/StaticMembersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// StaticMembersOperations operations. /// - internal partial class StaticMembersOperations : IServiceOperations, IStaticMembersOperations + internal partial class StaticMembersOperations : Microsoft.Rest.IServiceOperations, IStaticMembersOperations { /// /// Initializes a new instance of the StaticMembersOperations class. @@ -36,13 +24,13 @@ internal partial class StaticMembersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal StaticMembersOperations(NetworkManagementClient client) + internal StaticMembersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -71,13 +59,13 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -86,53 +74,66 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + if (staticMemberName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticMemberName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "staticMemberName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("staticMemberName", staticMemberName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); _url = _url.Replace("{staticMemberName}", System.Uri.EscapeDataString(staticMemberName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -142,25 +143,24 @@ internal StaticMembersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -172,55 +172,56 @@ internal StaticMembersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -230,9 +231,10 @@ internal StaticMembersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -243,31 +245,32 @@ internal StaticMembersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a static member. /// - /// - /// Parameters supplied to the specify the static member to create - /// /// /// The name of the resource group. /// @@ -280,19 +283,22 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// The name of the static member. /// + /// + /// Parameters supplied to the specify the static member to create + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -301,58 +307,72 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, StaticMember parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + if (staticMemberName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticMemberName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "staticMemberName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("staticMemberName", staticMemberName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); _url = _url.Replace("{staticMemberName}", System.Uri.EscapeDataString(staticMemberName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -362,25 +382,24 @@ internal StaticMembersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -392,61 +411,62 @@ internal StaticMembersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -456,9 +476,10 @@ internal StaticMembersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -469,16 +490,16 @@ internal StaticMembersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -487,25 +508,29 @@ internal StaticMembersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a static member. /// @@ -527,10 +552,10 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -539,53 +564,66 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + if (staticMemberName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticMemberName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "staticMemberName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("staticMemberName", staticMemberName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); _url = _url.Replace("{staticMemberName}", System.Uri.EscapeDataString(staticMemberName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -595,25 +633,24 @@ internal StaticMembersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -625,55 +662,56 @@ internal StaticMembersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -683,20 +721,25 @@ internal StaticMembersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists the specified static member. /// @@ -725,13 +768,13 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -740,67 +783,80 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName"); } + if (networkGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkGroupName"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("networkGroupName", networkGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -811,25 +867,24 @@ internal StaticMembersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -841,55 +896,56 @@ internal StaticMembersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -899,9 +955,10 @@ internal StaticMembersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -912,25 +969,29 @@ internal StaticMembersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists the specified static member. /// @@ -943,13 +1004,13 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -958,51 +1019,54 @@ internal StaticMembersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1014,55 +1078,56 @@ internal StaticMembersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1072,9 +1137,10 @@ internal StaticMembersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1085,24 +1151,28 @@ internal StaticMembersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/StaticMembersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/StaticMembersOperationsExtensions.cs index f0419de43e83..dfbd5567c8c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/StaticMembersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/StaticMembersOperationsExtensions.cs @@ -1,284 +1,264 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for StaticMembersOperations. + /// Extension methods for StaticMembersOperations /// public static partial class StaticMembersOperationsExtensions { - /// - /// Gets the specified static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The name of the static member. - /// - public static StaticMember Get(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The name of the static member. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to the specify the static member to create - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The name of the static member. - /// - public static StaticMember CreateOrUpdate(this IStaticMembersOperations operations, StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) - { - return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); - } + /// + /// Gets the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + public static StaticMember Get(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) + { + return ((IStaticMembersOperations)operations).GetAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to the specify the static member to create - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The name of the static member. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IStaticMembersOperations operations, StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + public static StaticMember CreateOrUpdate(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, StaticMember parameters) + { + return ((IStaticMembersOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The name of the static member. - /// - public static void Delete(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) + /// + /// Creates or updates a static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, StaticMember parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + public static void Delete(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) + { + ((IStaticMembersOperations)operations).DeleteAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); + } - /// - /// Deletes a static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// The name of the static member. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists the specified static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken).GetAwaiter().GetResult(); - } + /// + /// Deletes a static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string)) + { + return ((IStaticMembersOperations)operations).ListAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken).GetAwaiter().GetResult(); + } - /// - /// Lists the specified static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IStaticMembersOperations operations, string nextPageLink) + { + return ((IStaticMembersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists the specified static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IStaticMembersOperations operations, string nextPageLink) + /// + /// Lists the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IStaticMembersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists the specified static member. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IStaticMembersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/SubnetsOperations.cs b/src/Network/Network.Management.Sdk/Generated/SubnetsOperations.cs index 871544212689..5dbae5d2164e 100644 --- a/src/Network/Network.Management.Sdk/Generated/SubnetsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/SubnetsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SubnetsOperations operations. /// - internal partial class SubnetsOperations : IServiceOperations, ISubnetsOperations + internal partial class SubnetsOperations : Microsoft.Rest.IServiceOperations, ISubnetsOperations { /// /// Initializes a new instance of the SubnetsOperations class. @@ -36,13 +24,13 @@ internal partial class SubnetsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SubnetsOperations(NetworkManagementClient client) + internal SubnetsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal SubnetsOperations(NetworkManagementClient client) /// The name of the subnet. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -96,13 +84,13 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -111,48 +99,61 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -166,25 +167,24 @@ internal SubnetsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -196,55 +196,56 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -254,9 +255,10 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -267,25 +269,29 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a subnet in the specified virtual network. /// @@ -302,16 +308,16 @@ internal SubnetsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update subnet operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -330,16 +336,16 @@ internal SubnetsOperations(NetworkManagementClient client) /// Parameters supplied to prepare subnet by applying network intent policies. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPrepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPrepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -358,16 +364,16 @@ internal SubnetsOperations(NetworkManagementClient client) /// Parameters supplied to unprepare subnet to remove network intent policies. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task UnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task UnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -385,13 +391,13 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -400,41 +406,52 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -444,25 +461,24 @@ internal SubnetsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -474,55 +490,56 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -532,9 +549,10 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -545,25 +563,29 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified subnet. /// @@ -582,10 +604,10 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -594,47 +616,59 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -644,25 +678,24 @@ internal SubnetsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -674,55 +707,56 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -732,20 +766,25 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a subnet in the specified virtual network. /// @@ -767,13 +806,13 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -782,52 +821,65 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (subnetParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); - } - if (subnetParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("subnetParameters", subnetParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("subnetParameters", subnetParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -837,25 +889,24 @@ internal SubnetsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -867,61 +918,62 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(subnetParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(subnetParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(subnetParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -931,9 +983,10 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -944,16 +997,16 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -962,25 +1015,29 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Prepares a subnet by applying network intent policies. /// @@ -1002,10 +1059,10 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1014,52 +1071,65 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPrepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (prepareNetworkPoliciesRequestParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "prepareNetworkPoliciesRequestParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (prepareNetworkPoliciesRequestParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "prepareNetworkPoliciesRequestParameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("prepareNetworkPoliciesRequestParameters", prepareNetworkPoliciesRequestParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("prepareNetworkPoliciesRequestParameters", prepareNetworkPoliciesRequestParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPrepareNetworkPolicies", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPrepareNetworkPolicies", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1069,25 +1139,24 @@ internal SubnetsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1099,61 +1168,62 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(prepareNetworkPoliciesRequestParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(prepareNetworkPoliciesRequestParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(prepareNetworkPoliciesRequestParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1163,20 +1233,25 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Unprepares a subnet by removing network intent policies. /// @@ -1198,10 +1273,10 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1210,52 +1285,65 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (unprepareNetworkPoliciesRequestParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "unprepareNetworkPoliciesRequestParameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); - } - if (unprepareNetworkPoliciesRequestParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "unprepareNetworkPoliciesRequestParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("unprepareNetworkPoliciesRequestParameters", unprepareNetworkPoliciesRequestParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("unprepareNetworkPoliciesRequestParameters", unprepareNetworkPoliciesRequestParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUnprepareNetworkPolicies", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUnprepareNetworkPolicies", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1265,25 +1353,24 @@ internal SubnetsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1295,61 +1382,62 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(unprepareNetworkPoliciesRequestParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(unprepareNetworkPoliciesRequestParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(unprepareNetworkPoliciesRequestParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1359,20 +1447,25 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all subnets in a virtual network. /// @@ -1385,13 +1478,13 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1400,51 +1493,54 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1456,55 +1552,56 @@ internal SubnetsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1514,9 +1611,10 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1527,24 +1625,28 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/SubnetsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/SubnetsOperationsExtensions.cs index 6c640a409b68..d361b12efd3d 100644 --- a/src/Network/Network.Management.Sdk/Generated/SubnetsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/SubnetsOperationsExtensions.cs @@ -1,537 +1,481 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SubnetsOperations. + /// Extension methods for SubnetsOperations /// public static partial class SubnetsOperationsExtensions { - /// - /// Deletes the specified subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - public static void Delete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified subnet by virtual network and resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Expands referenced resources. - /// - public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified subnet by virtual network and resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a subnet in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a subnet in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Prepares a subnet by applying network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to prepare subnet by applying network intent policies. - /// - public static void PrepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) - { - operations.PrepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); - } - - /// - /// Prepares a subnet by applying network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to prepare subnet by applying network intent policies. - /// - /// - /// The cancellation token. - /// - public static async Task PrepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PrepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static void Delete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) + { + ((ISubnetsOperations)operations).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); + } - /// - /// Unprepares a subnet by removing network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to unprepare subnet to remove network intent policies. - /// - public static void UnprepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) - { - operations.UnprepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified subnet by virtual network and resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// Expands referenced resources. + /// + public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) + { + return ((ISubnetsOperations)operations).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand).GetAwaiter().GetResult(); + } - /// - /// Unprepares a subnet by removing network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to unprepare subnet to remove network intent policies. - /// - /// - /// The cancellation token. - /// - public static async Task UnprepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the specified subnet by virtual network and resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.UnprepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates or updates a subnet in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) + { + return ((ISubnetsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all subnets in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - public static IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// Creates or updates a subnet in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Prepares a subnet by applying network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static void PrepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) + { + ((ISubnetsOperations)operations).PrepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); + } - /// - /// Gets all subnets in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Prepares a subnet by applying network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PrepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PrepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Unprepares a subnet by removing network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static void UnprepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) + { + ((ISubnetsOperations)operations).UnprepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); - } + /// + /// Unprepares a subnet by removing network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UnprepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.UnprepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all subnets in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static Microsoft.Rest.Azure.IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) + { + return ((ISubnetsOperations)operations).ListAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified subnet. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all subnets in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) + { + ((ISubnetsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a subnet in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified subnet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a subnet in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) + { + return ((ISubnetsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a subnet in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a subnet in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Prepares a subnet by applying network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static void BeginPrepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) + { + ((ISubnetsOperations)operations).BeginPrepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); + } - /// - /// Prepares a subnet by applying network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to prepare subnet by applying network intent policies. - /// - public static void BeginPrepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) - { - operations.BeginPrepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); - } + /// + /// Prepares a subnet by applying network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPrepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPrepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Unprepares a subnet by removing network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + public static void BeginUnprepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) + { + ((ISubnetsOperations)operations).BeginUnprepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); + } - /// - /// Prepares a subnet by applying network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to prepare subnet by applying network intent policies. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPrepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPrepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Unprepares a subnet by removing network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to unprepare subnet to remove network intent policies. - /// - public static void BeginUnprepareNetworkPolicies(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) - { - operations.BeginUnprepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters).GetAwaiter().GetResult(); - } + /// + /// Unprepares a subnet by removing network intent policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the subnet. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUnprepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all subnets in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISubnetsOperations operations, string nextPageLink) + { + return ((ISubnetsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Unprepares a subnet by removing network intent policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to unprepare subnet to remove network intent policies. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUnprepareNetworkPoliciesAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all subnets in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISubnetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginUnprepareNetworkPoliciesWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Gets all subnets in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISubnetsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all subnets in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISubnetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperations.cs index 1cd833163b95..d3aaeb36b76c 100644 --- a/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SubscriptionNetworkManagerConnectionsOperations operations. /// - internal partial class SubscriptionNetworkManagerConnectionsOperations : IServiceOperations, ISubscriptionNetworkManagerConnectionsOperations + internal partial class SubscriptionNetworkManagerConnectionsOperations : Microsoft.Rest.IServiceOperations, ISubscriptionNetworkManagerConnectionsOperations { /// /// Initializes a new instance of the SubscriptionNetworkManagerConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class SubscriptionNetworkManagerConnectionsOperations : IServic /// /// Thrown when a required parameter is null /// - internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient client) + internal SubscriptionNetworkManagerConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -53,25 +41,25 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// Create a network manager connection on this subscription. /// - /// - /// Network manager connection to be created/updated. - /// /// /// Name for the network manager connection. /// + /// + /// Network manager connection to be created/updated. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,40 +68,51 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string networkManagerConnectionName, NetworkManagerConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (networkManagerConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -123,25 +122,24 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,61 +151,62 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -217,9 +216,10 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -230,16 +230,16 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -248,25 +248,29 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a specified connection created by this subscription. /// @@ -279,13 +283,13 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -294,35 +298,45 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (networkManagerConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -332,25 +346,24 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -362,55 +375,56 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -420,9 +434,10 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -433,25 +448,29 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete specified connection created by this subscription. /// @@ -464,10 +483,10 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -476,35 +495,45 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string networkManagerConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (networkManagerConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -514,25 +543,24 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -544,55 +572,56 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -602,20 +631,25 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network manager connections created by this subscription. /// @@ -635,13 +669,13 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -650,49 +684,59 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (top != null) { if (top > 20) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "top", 20); } if (top < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "top", 1); } } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -703,25 +747,24 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -733,55 +776,56 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -791,9 +835,10 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -804,25 +849,29 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all network manager connections created by this subscription. /// @@ -835,13 +884,13 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -850,51 +899,54 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -906,55 +958,56 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -964,9 +1017,10 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -977,24 +1031,28 @@ internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs index 6a4ef37a690c..479387c9beec 100644 --- a/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs @@ -1,212 +1,192 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SubscriptionNetworkManagerConnectionsOperations. + /// Extension methods for SubscriptionNetworkManagerConnectionsOperations /// public static partial class SubscriptionNetworkManagerConnectionsOperationsExtensions { - /// - /// Create a network manager connection on this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Network manager connection to be created/updated. - /// - /// - /// Name for the network manager connection. - /// - public static NetworkManagerConnection CreateOrUpdate(this ISubscriptionNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string networkManagerConnectionName) - { - return operations.CreateOrUpdateAsync(parameters, networkManagerConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Create a network manager connection on this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Network manager connection to be created/updated. - /// - /// - /// Name for the network manager connection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a specified connection created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name for the network manager connection. - /// - public static NetworkManagerConnection Get(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName) - { - return operations.GetAsync(networkManagerConnectionName).GetAwaiter().GetResult(); - } + /// + /// Create a network manager connection on this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection CreateOrUpdate(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, NetworkManagerConnection parameters) + { + return ((ISubscriptionNetworkManagerConnectionsOperations)operations).CreateOrUpdateAsync(networkManagerConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Get a specified connection created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name for the network manager connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a network manager connection on this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, NetworkManagerConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(networkManagerConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get a specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection Get(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName) + { + return ((ISubscriptionNetworkManagerConnectionsOperations)operations).GetAsync(networkManagerConnectionName).GetAwaiter().GetResult(); + } - /// - /// Delete specified connection created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name for the network manager connection. - /// - public static void Delete(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName) + /// + /// Get a specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(networkManagerConnectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + public static void Delete(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName) + { + ((ISubscriptionNetworkManagerConnectionsOperations)operations).DeleteAsync(networkManagerConnectionName).GetAwaiter().GetResult(); + } - /// - /// Delete specified connection created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name for the network manager connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List all network manager connections created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage List(this ISubscriptionNetworkManagerConnectionsOperations operations, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(top, skipToken).GetAwaiter().GetResult(); - } + /// + /// Delete specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static Microsoft.Rest.Azure.IPage List(this ISubscriptionNetworkManagerConnectionsOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return ((ISubscriptionNetworkManagerConnectionsOperations)operations).ListAsync(top, skipToken).GetAwaiter().GetResult(); + } - /// - /// List all network manager connections created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// An optional query parameter which specifies the maximum number of records - /// to be returned by the server. - /// - /// - /// SkipToken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skipToken parameter that specifies a - /// starting point to use for subsequent calls. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISubscriptionNetworkManagerConnectionsOperations operations, string nextPageLink) + { + return ((ISubscriptionNetworkManagerConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all network manager connections created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISubscriptionNetworkManagerConnectionsOperations operations, string nextPageLink) + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all network manager connections created by this subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/UsagesOperations.cs b/src/Network/Network.Management.Sdk/Generated/UsagesOperations.cs index 1541695e5071..66cbb2892bba 100644 --- a/src/Network/Network.Management.Sdk/Generated/UsagesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/UsagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// UsagesOperations operations. /// - internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + internal partial class UsagesOperations : Microsoft.Rest.IServiceOperations, IUsagesOperations { /// /// Initializes a new instance of the UsagesOperations class. @@ -36,13 +24,13 @@ internal partial class UsagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal UsagesOperations(NetworkManagementClient client) + internal UsagesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,42 +65,51 @@ internal UsagesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._ ]+$")) { - throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._ ]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "location", "^[-\\w\\._ ]+$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -122,25 +119,24 @@ internal UsagesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -152,55 +148,56 @@ internal UsagesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -210,9 +207,10 @@ internal UsagesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -223,25 +221,29 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List network usages for a subscription. /// @@ -254,13 +256,13 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -269,51 +271,54 @@ internal UsagesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -325,55 +330,56 @@ internal UsagesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -383,9 +389,10 @@ internal UsagesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -396,24 +403,28 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/UsagesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/UsagesOperationsExtensions.cs index a603709361e5..ea2a2ebfda9d 100644 --- a/src/Network/Network.Management.Sdk/Generated/UsagesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/UsagesOperationsExtensions.cs @@ -1,93 +1,82 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for UsagesOperations. + /// Extension methods for UsagesOperations /// public static partial class UsagesOperationsExtensions { - /// - /// List network usages for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location where resource usage is queried. - /// - public static IPage List(this IUsagesOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// List network usages for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location where resource usage is queried. + /// + public static Microsoft.Rest.Azure.IPage List(this IUsagesOperations operations, string location) + { + return ((IUsagesOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// List network usages for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location where resource usage is queried. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IUsagesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List network usages for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location where resource usage is queried. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IUsagesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List network usages for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IUsagesOperations operations, string nextPageLink) + { + return ((IUsagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List network usages for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IUsagesOperations operations, string nextPageLink) + /// + /// List network usages for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List network usages for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VipSwapOperations.cs b/src/Network/Network.Management.Sdk/Generated/VipSwapOperations.cs index 853f618faf77..083cdd027935 100644 --- a/src/Network/Network.Management.Sdk/Generated/VipSwapOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VipSwapOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VipSwapOperations operations. /// - internal partial class VipSwapOperations : IServiceOperations, IVipSwapOperations + internal partial class VipSwapOperations : Microsoft.Rest.IServiceOperations, IVipSwapOperations { /// /// Initializes a new instance of the VipSwapOperations class. @@ -36,13 +24,13 @@ internal partial class VipSwapOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VipSwapOperations(NetworkManagementClient client) + internal VipSwapOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -67,13 +55,13 @@ internal VipSwapOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -82,44 +70,55 @@ internal VipSwapOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string groupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string groupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + string singletonResource = "swap"; + if (groupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupName"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (Client.SubscriptionId == null) + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string singletonResource = "swap"; + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("groupName", groupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("singletonResource", singletonResource); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}").ToString(); _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{singletonResource}", System.Uri.EscapeDataString(singletonResource)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -129,25 +128,24 @@ internal VipSwapOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -159,55 +157,56 @@ internal VipSwapOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -217,9 +216,10 @@ internal VipSwapOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -230,25 +230,29 @@ internal VipSwapOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Performs vip swap operation on swappable cloud services. /// @@ -263,16 +267,16 @@ internal VipSwapOperations(NetworkManagementClient client) /// swap for the specified cloud service. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task CreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(groupName, resourceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(groupName, resourceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -292,13 +296,13 @@ internal VipSwapOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -307,41 +311,52 @@ internal VipSwapOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string groupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string groupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (groupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupName"); } + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("groupName", groupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots").ToString(); _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -351,25 +366,24 @@ internal VipSwapOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -381,55 +395,56 @@ internal VipSwapOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -439,9 +454,10 @@ internal VipSwapOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -452,25 +468,29 @@ internal VipSwapOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Performs vip swap operation on swappable cloud services. /// @@ -490,10 +510,10 @@ internal VipSwapOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -502,49 +522,61 @@ internal VipSwapOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginCreateWithHttpMessagesAsync(string groupName, string resourceName, SwapResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (groupName == null) + + + string singletonResource = "swap"; + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceName == null) + + if (groupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupName"); } - if (parameters == null) + + if (resourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (Client.SubscriptionId == null) + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string singletonResource = "swap"; + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("groupName", groupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("singletonResource", singletonResource); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}").ToString(); _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{singletonResource}", System.Uri.EscapeDataString(singletonResource)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -554,25 +586,24 @@ internal VipSwapOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -584,61 +615,62 @@ internal VipSwapOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -648,19 +680,24 @@ internal VipSwapOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VipSwapOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VipSwapOperationsExtensions.cs index 4a951400208c..3a44b1e40d67 100644 --- a/src/Network/Network.Management.Sdk/Generated/VipSwapOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VipSwapOperationsExtensions.cs @@ -1,203 +1,174 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VipSwapOperations. + /// Extension methods for VipSwapOperations /// public static partial class VipSwapOperationsExtensions { - /// - /// Gets the SwapResource which identifies the slot type for the specified - /// cloud service. The slot type on a cloud service can either be Staging or - /// Production - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - public static SwapResource Get(this IVipSwapOperations operations, string groupName, string resourceName) - { - return operations.GetAsync(groupName, resourceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the SwapResource which identifies the slot type for the specified - /// cloud service. The slot type on a cloud service can either be Staging or - /// Production - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVipSwapOperations operations, string groupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(groupName, resourceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Performs vip swap operation on swappable cloud services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// SwapResource object where slot type should be the target slot after vip - /// swap for the specified cloud service. - /// - public static void Create(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters) - { - operations.CreateAsync(groupName, resourceName, parameters).GetAwaiter().GetResult(); - } + /// + /// Gets the SwapResource which identifies the slot type for the specified + /// cloud service. The slot type on a cloud service can either be Staging or + /// Production + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + public static SwapResource Get(this IVipSwapOperations operations, string groupName, string resourceName) + { + return ((IVipSwapOperations)operations).GetAsync(groupName, resourceName).GetAwaiter().GetResult(); + } - /// - /// Performs vip swap operation on swappable cloud services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// SwapResource object where slot type should be the target slot after vip - /// swap for the specified cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the SwapResource which identifies the slot type for the specified + /// cloud service. The slot type on a cloud service can either be Staging or + /// Production + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVipSwapOperations operations, string groupName, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(groupName, resourceName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.CreateWithHttpMessagesAsync(groupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Performs vip swap operation on swappable cloud services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + public static void Create(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters) + { + ((IVipSwapOperations)operations).CreateAsync(groupName, resourceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the list of SwapResource which identifies the slot type for the - /// specified cloud service. The slot type on a cloud service can either be - /// Staging or Production - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - public static SwapResourceListResult List(this IVipSwapOperations operations, string groupName, string resourceName) - { - return operations.ListAsync(groupName, resourceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of SwapResource which identifies the slot type for the - /// specified cloud service. The slot type on a cloud service can either be - /// Staging or Production - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IVipSwapOperations operations, string groupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(groupName, resourceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Performs vip swap operation on swappable cloud services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// SwapResource object where slot type should be the target slot after vip - /// swap for the specified cloud service. - /// - public static void BeginCreate(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters) - { - operations.BeginCreateAsync(groupName, resourceName, parameters).GetAwaiter().GetResult(); - } + /// + /// Performs vip swap operation on swappable cloud services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CreateWithHttpMessagesAsync(groupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the list of SwapResource which identifies the slot type for the + /// specified cloud service. The slot type on a cloud service can either be + /// Staging or Production + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + public static SwapResourceListResult List(this IVipSwapOperations operations, string groupName, string resourceName) + { + return ((IVipSwapOperations)operations).ListAsync(groupName, resourceName).GetAwaiter().GetResult(); + } - /// - /// Performs vip swap operation on swappable cloud services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cloud service. - /// - /// - /// SwapResource object where slot type should be the target slot after vip - /// swap for the specified cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the list of SwapResource which identifies the slot type for the + /// specified cloud service. The slot type on a cloud service can either be + /// Staging or Production + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IVipSwapOperations operations, string groupName, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(groupName, resourceName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginCreateWithHttpMessagesAsync(groupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Performs vip swap operation on swappable cloud services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + public static void BeginCreate(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters) + { + ((IVipSwapOperations)operations).BeginCreateAsync(groupName, resourceName, parameters).GetAwaiter().GetResult(); + } + /// + /// Performs vip swap operation on swappable cloud services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IVipSwapOperations operations, string groupName, string resourceName, SwapResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginCreateWithHttpMessagesAsync(groupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperations.cs index 62112b1d32b6..7445abb79ad6 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualApplianceSitesOperations operations. /// - internal partial class VirtualApplianceSitesOperations : IServiceOperations, IVirtualApplianceSitesOperations + internal partial class VirtualApplianceSitesOperations : Microsoft.Rest.IServiceOperations, IVirtualApplianceSitesOperations { /// /// Initializes a new instance of the VirtualApplianceSitesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualApplianceSitesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualApplianceSitesOperations(NetworkManagementClient client) + internal VirtualApplianceSitesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// The name of the site. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + if (siteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "siteName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("siteName", siteName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{siteName}", System.Uri.EscapeDataString(siteName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Network Virtual Appliance Site. /// @@ -295,16 +300,16 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -323,13 +328,13 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -338,41 +343,52 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -382,25 +398,24 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -412,55 +427,56 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -470,9 +486,10 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -483,25 +500,29 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified site from a Virtual Appliance. /// @@ -520,10 +541,10 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -532,47 +553,59 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + if (siteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "siteName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("siteName", siteName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{siteName}", System.Uri.EscapeDataString(siteName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -582,25 +615,24 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -612,55 +644,56 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -670,20 +703,25 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Network Virtual Appliance Site. /// @@ -706,13 +744,13 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -721,52 +759,65 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (networkVirtualApplianceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkVirtualApplianceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkVirtualApplianceName"); } + if (siteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "siteName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkVirtualApplianceName", networkVirtualApplianceName); tracingParameters.Add("siteName", siteName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkVirtualApplianceName}", System.Uri.EscapeDataString(networkVirtualApplianceName)); _url = _url.Replace("{siteName}", System.Uri.EscapeDataString(siteName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -776,25 +827,24 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -806,61 +856,62 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -870,9 +921,10 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -883,16 +935,16 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -901,25 +953,29 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance /// resource. @@ -933,13 +989,13 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -948,51 +1004,54 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1004,55 +1063,56 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1062,9 +1122,10 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1075,24 +1136,28 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperationsExtensions.cs index b3ee50db2861..cd9b0bbe406e 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSitesOperationsExtensions.cs @@ -1,343 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualApplianceSitesOperations. + /// Extension methods for VirtualApplianceSitesOperations /// public static partial class VirtualApplianceSitesOperationsExtensions { - /// - /// Deletes the specified site from a Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - public static void Delete(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName) - { - operations.DeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified site from a Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Virtual Appliance Site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - public static VirtualApplianceSite Get(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName) - { - return operations.GetAsync(resourceGroupName, networkVirtualApplianceName, siteName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Virtual Appliance Site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified Network Virtual Appliance Site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance Site - /// operation. - /// - public static VirtualApplianceSite CreateOrUpdate(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified site from a Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + public static void Delete(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName) + { + ((IVirtualApplianceSitesOperations)operations).DeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance Site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance Site - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified site from a Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Virtual Appliance Site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + public static VirtualApplianceSite Get(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName) + { + return ((IVirtualApplianceSitesOperations)operations).GetAsync(resourceGroupName, networkVirtualApplianceName, siteName).GetAwaiter().GetResult(); + } - /// - /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - public static IPage List(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName) + /// + /// Gets the specified Virtual Appliance Site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified Network Virtual Appliance Site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + public static VirtualApplianceSite CreateOrUpdate(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters) + { + return ((IVirtualApplianceSitesOperations)operations).CreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Network Virtual Appliance Site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName) + { + return ((IVirtualApplianceSitesOperations)operations).ListAsync(resourceGroupName, networkVirtualApplianceName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified site from a Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - public static void BeginDelete(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName) + /// + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified site from a Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + public static void BeginDelete(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName) + { + ((IVirtualApplianceSitesOperations)operations).BeginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified site from a Virtual Appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified site from a Virtual Appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Network Virtual Appliance Site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + public static VirtualApplianceSite BeginCreateOrUpdate(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters) + { + return ((IVirtualApplianceSitesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance Site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance Site - /// operation. - /// - public static VirtualApplianceSite BeginCreateOrUpdate(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters) + /// + /// Creates or updates the specified Network Virtual Appliance Site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Network Virtual Appliance. + /// + /// + /// The name of the site. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualApplianceSitesOperations operations, string nextPageLink) + { + return ((IVirtualApplianceSitesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Network Virtual Appliance Site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Network Virtual Appliance. - /// - /// - /// The name of the site. - /// - /// - /// Parameters supplied to the create or update Network Virtual Appliance Site - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualApplianceSitesOperations operations, string resourceGroupName, string networkVirtualApplianceName, string siteName, VirtualApplianceSite parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualApplianceSitesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualApplianceSitesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Network Virtual Appliance Sites in a Network Virtual Appliance - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualApplianceSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperations.cs index 04050cdaf5ed..4196ef008a10 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualApplianceSkusOperations operations. /// - internal partial class VirtualApplianceSkusOperations : IServiceOperations, IVirtualApplianceSkusOperations + internal partial class VirtualApplianceSkusOperations : Microsoft.Rest.IServiceOperations, IVirtualApplianceSkusOperations { /// /// Initializes a new instance of the VirtualApplianceSkusOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualApplianceSkusOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualApplianceSkusOperations(NetworkManagementClient client) + internal VirtualApplianceSkusOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves a single available sku for network virtual appliance. /// @@ -238,13 +240,13 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,35 +255,45 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string skuName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string skuName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (skuName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "skuName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "skuName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("skuName", skuName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{skuName}", System.Uri.EscapeDataString(skuName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -291,25 +303,24 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -321,55 +332,56 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -379,9 +391,10 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -392,25 +405,29 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all SKUs available for a virtual appliance. /// @@ -423,13 +440,13 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -438,51 +455,54 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -494,55 +514,56 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -552,9 +573,10 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -565,24 +587,28 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperationsExtensions.cs index c592c9c5643b..85fa165ec0b0 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualApplianceSkusOperationsExtensions.cs @@ -1,121 +1,109 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualApplianceSkusOperations. + /// Extension methods for VirtualApplianceSkusOperations /// public static partial class VirtualApplianceSkusOperationsExtensions { - /// - /// List all SKUs available for a virtual appliance. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVirtualApplianceSkusOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// List all SKUs available for a virtual appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualApplianceSkusOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List all SKUs available for a virtual appliance. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualApplianceSkusOperations operations) + { + return ((IVirtualApplianceSkusOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Retrieves a single available sku for network virtual appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Sku. - /// - public static NetworkVirtualApplianceSku Get(this IVirtualApplianceSkusOperations operations, string skuName) + /// + /// List all SKUs available for a virtual appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualApplianceSkusOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(skuName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves a single available sku for network virtual appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Sku. + /// + public static NetworkVirtualApplianceSku Get(this IVirtualApplianceSkusOperations operations, string skuName) + { + return ((IVirtualApplianceSkusOperations)operations).GetAsync(skuName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a single available sku for network virtual appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Sku. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualApplianceSkusOperations operations, string skuName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves a single available sku for network virtual appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Sku. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualApplianceSkusOperations operations, string skuName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(skuName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(skuName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all SKUs available for a virtual appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualApplianceSkusOperations operations, string nextPageLink) + { + return ((IVirtualApplianceSkusOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all SKUs available for a virtual appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualApplianceSkusOperations operations, string nextPageLink) + /// + /// List all SKUs available for a virtual appliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualApplianceSkusOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all SKUs available for a virtual appliance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualApplianceSkusOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperations.cs index bb34ffad22a8..70860c446653 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualHubBgpConnectionOperations operations. /// - internal partial class VirtualHubBgpConnectionOperations : IServiceOperations, IVirtualHubBgpConnectionOperations + internal partial class VirtualHubBgpConnectionOperations : Microsoft.Rest.IServiceOperations, IVirtualHubBgpConnectionOperations { /// /// Initializes a new instance of the VirtualHubBgpConnectionOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualHubBgpConnectionOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) + internal VirtualHubBgpConnectionOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,28 +235,31 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates - /// the existing VirtualHubBgpConnection. + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. /// /// /// The resource group name of the VirtualHub. @@ -270,16 +274,16 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// Parameters of Bgp connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -295,20 +299,20 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// The name of the connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates /// the existing VirtualHubBgpConnection. /// /// @@ -329,13 +333,13 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -344,56 +348,68 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (resourceGroupName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + parameters.Validate(); } - if (virtualHubName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (connectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } - if (parameters != null) + + if (connectionName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -403,25 +419,24 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -433,61 +448,62 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -497,9 +513,10 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -510,16 +527,16 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -528,25 +545,29 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualHubBgpConnection. /// @@ -565,10 +586,10 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -577,47 +598,59 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -627,25 +660,24 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -657,55 +689,56 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -715,19 +748,24 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperationsExtensions.cs index e70a247eb152..3bfd7259935c 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionOperationsExtensions.cs @@ -1,265 +1,239 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualHubBgpConnectionOperations. + /// Extension methods for VirtualHubBgpConnectionOperations /// public static partial class VirtualHubBgpConnectionOperationsExtensions { - /// - /// Retrieves the details of a Virtual Hub Bgp Connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - public static BgpConnection Get(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a Virtual Hub Bgp Connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates - /// the existing VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters of Bgp connection. - /// - public static BgpConnection CreateOrUpdate(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates - /// the existing VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters of Bgp connection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - public static void Delete(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a Virtual Hub Bgp Connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + public static BgpConnection Get(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName) + { + return ((IVirtualHubBgpConnectionOperations)operations).GetAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a Virtual Hub Bgp Connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + public static BgpConnection CreateOrUpdate(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters) + { + return ((IVirtualHubBgpConnectionOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates - /// the existing VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters of Bgp connection. - /// - public static BgpConnection BeginCreateOrUpdate(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters) + /// + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + public static void Delete(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName) + { + ((IVirtualHubBgpConnectionOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates - /// the existing VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters of Bgp connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - public static void BeginDelete(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); - } + /// + /// Deletes a VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + public static BgpConnection BeginCreateOrUpdate(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters) + { + return ((IVirtualHubBgpConnectionOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubBgpConnection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a VirtualHubBgpConnection resource if it doesn't exist else updates + /// the existing VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, BgpConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + public static void BeginDelete(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName) + { + ((IVirtualHubBgpConnectionOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, connectionName).GetAwaiter().GetResult(); + } + /// + /// Deletes a VirtualHubBgpConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualHubBgpConnectionOperations operations, string resourceGroupName, string virtualHubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperations.cs index 4cd03ca9b36d..37a8f3b4c04c 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualHubBgpConnectionsOperations operations. /// - internal partial class VirtualHubBgpConnectionsOperations : IServiceOperations, IVirtualHubBgpConnectionsOperations + internal partial class VirtualHubBgpConnectionsOperations : Microsoft.Rest.IServiceOperations, IVirtualHubBgpConnectionsOperations { /// /// Initializes a new instance of the VirtualHubBgpConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualHubBgpConnectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) + internal VirtualHubBgpConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +225,29 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves a list of routes the virtual hub bgp connection has learned. /// @@ -257,21 +261,20 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// The name of the virtual hub bgp connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>>> ListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>>> ListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse>> _response = await BeginListLearnedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse>> _response = await BeginListLearnedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Retrieves a list of routes the virtual hub bgp connection is advertising to - /// the specified peer. + /// Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. /// /// /// The name of the resource group. @@ -283,16 +286,16 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// The name of the virtual hub bgp connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>>> ListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>>> ListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse>> _response = await BeginListAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse>> _response = await BeginListAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -313,13 +316,13 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -328,47 +331,59 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>>> BeginListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>>> BeginListLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (hubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hubName", hubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListLearnedRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListLearnedRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -378,25 +393,24 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -408,55 +422,56 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -466,9 +481,10 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -479,25 +495,29 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves a list of routes the virtual hub bgp connection is advertising to /// the specified peer. @@ -517,13 +537,13 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -532,47 +552,59 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>>> BeginListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>>> BeginListAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string hubName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (hubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hubName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hubName", hubName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListAdvertisedRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListAdvertisedRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -582,25 +614,24 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -612,55 +643,56 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -670,9 +702,10 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -683,25 +716,29 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all VirtualHubBgpConnections. /// @@ -714,13 +751,13 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -729,51 +766,54 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -785,55 +825,56 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -843,9 +884,10 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -856,24 +898,28 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperationsExtensions.cs index 6046e1411500..31b453da697b 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubBgpConnectionsOperationsExtensions.cs @@ -1,289 +1,272 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualHubBgpConnectionsOperations. + /// Extension methods for VirtualHubBgpConnectionsOperations /// public static partial class VirtualHubBgpConnectionsOperationsExtensions { - /// - /// Retrieves the details of all VirtualHubBgpConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static IPage List(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string virtualHubName) - { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all VirtualHubBgpConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Retrieves the details of all VirtualHubBgpConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IVirtualHubBgpConnectionsOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a list of routes the virtual hub bgp connection has learned. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - public static IDictionary> ListLearnedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + /// + /// Retrieves the details of all VirtualHubBgpConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListLearnedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves a list of routes the virtual hub bgp connection has learned. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + public static System.Collections.Generic.IDictionary> ListLearnedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + { + return ((IVirtualHubBgpConnectionsOperations)operations).ListLearnedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a list of routes the virtual hub bgp connection has learned. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - /// - /// The cancellation token. - /// - public static async Task>> ListLearnedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves a list of routes the virtual hub bgp connection has learned. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task>> ListLearnedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListLearnedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListLearnedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + public static System.Collections.Generic.IDictionary> ListAdvertisedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + { + return ((IVirtualHubBgpConnectionsOperations)operations).ListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a list of routes the virtual hub bgp connection is advertising to - /// the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - public static IDictionary> ListAdvertisedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + /// + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task>> ListAdvertisedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves a list of routes the virtual hub bgp connection has learned. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + public static System.Collections.Generic.IDictionary> BeginListLearnedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + { + return ((IVirtualHubBgpConnectionsOperations)operations).BeginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a list of routes the virtual hub bgp connection is advertising to - /// the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - /// - /// The cancellation token. - /// - public static async Task>> ListAdvertisedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves a list of routes the virtual hub bgp connection has learned. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task>> BeginListLearnedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListLearnedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + public static System.Collections.Generic.IDictionary> BeginListAdvertisedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + { + return ((IVirtualHubBgpConnectionsOperations)operations).BeginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves a list of routes the virtual hub bgp connection has learned. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - public static IDictionary> BeginListLearnedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) + /// + /// Retrieves a list of routes the virtual hub bgp connection is advertising to + /// the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual hub. + /// + /// + /// The name of the virtual hub bgp connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task>> BeginListAdvertisedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves the details of all VirtualHubBgpConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualHubBgpConnectionsOperations operations, string nextPageLink) + { + return ((IVirtualHubBgpConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Retrieves a list of routes the virtual hub bgp connection has learned. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - /// - /// The cancellation token. - /// - public static async Task>> BeginListLearnedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all VirtualHubBgpConnections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualHubBgpConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginListLearnedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Retrieves a list of routes the virtual hub bgp connection is advertising to - /// the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - public static IDictionary> BeginListAdvertisedRoutes(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName) - { - return operations.BeginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves a list of routes the virtual hub bgp connection is advertising to - /// the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual hub. - /// - /// - /// The name of the virtual hub bgp connection. - /// - /// - /// The cancellation token. - /// - public static async Task>> BeginListAdvertisedRoutesAsync(this IVirtualHubBgpConnectionsOperations operations, string resourceGroupName, string hubName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, hubName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the details of all VirtualHubBgpConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualHubBgpConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all VirtualHubBgpConnections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualHubBgpConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperations.cs index 2a3a63449c2a..a3e70a04cd8a 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperations.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// VirtualHubIpConfigurationOperations operations. + /// VirtualHubIPConfigurationOperations operations. /// - internal partial class VirtualHubIpConfigurationOperations : IServiceOperations, IVirtualHubIpConfigurationOperations + internal partial class VirtualHubIPConfigurationOperations : Microsoft.Rest.IServiceOperations, IVirtualHubIPConfigurationOperations { /// - /// Initializes a new instance of the VirtualHubIpConfigurationOperations class. + /// Initializes a new instance of the VirtualHubIPConfigurationOperations class. /// /// /// Reference to the service client. @@ -36,13 +24,13 @@ internal partial class VirtualHubIpConfigurationOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) + internal VirtualHubIPConfigurationOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (ipConfigName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("ipConfigName", ipConfigName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{ipConfigName}", System.Uri.EscapeDataString(ipConfigName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,28 +235,31 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else - /// updates the existing VirtualHubIpConfiguration. + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. /// /// /// The resource group name of the VirtualHub. @@ -270,16 +274,16 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// Hub Ip Configuration parameters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -295,16 +299,16 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// The name of the ipconfig. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +326,13 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +341,52 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +396,24 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +425,56 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +484,10 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,27 +498,31 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else /// updates the existing VirtualHubIpConfiguration. /// /// @@ -523,13 +543,13 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,52 +558,65 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (ipConfigName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("ipConfigName", ipConfigName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{ipConfigName}", System.Uri.EscapeDataString(ipConfigName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -593,25 +626,24 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -623,61 +655,62 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -687,9 +720,10 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -700,16 +734,16 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -718,25 +752,29 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualHubIpConfiguration. /// @@ -755,10 +793,10 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -767,47 +805,59 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string ipConfigName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (ipConfigName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipConfigName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("ipConfigName", ipConfigName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{ipConfigName}", System.Uri.EscapeDataString(ipConfigName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +867,24 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +896,56 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,20 +955,25 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all VirtualHubIpConfigurations. /// @@ -931,13 +986,13 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1001,54 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1060,56 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1119,10 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1133,28 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperationsExtensions.cs index 2be2334ea3b7..c9376d46bc0a 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubIpConfigurationOperationsExtensions.cs @@ -1,339 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualHubIpConfigurationOperations. + /// Extension methods for VirtualHubIPConfigurationOperations /// - public static partial class VirtualHubIpConfigurationOperationsExtensions + public static partial class VirtualHubIPConfigurationOperationsExtensions { - /// - /// Retrieves the details of a Virtual Hub Ip configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - public static HubIpConfiguration Get(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, ipConfigName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a Virtual Hub Ip configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else - /// updates the existing VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// Hub Ip Configuration parameters. - /// - public static HubIpConfiguration CreateOrUpdate(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else - /// updates the existing VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// Hub Ip Configuration parameters. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - public static void Delete(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, ipConfigName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a Virtual Hub Ip configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + public static HubIpConfiguration Get(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName) + { + return ((IVirtualHubIPConfigurationOperations)operations).GetAsync(resourceGroupName, virtualHubName, ipConfigName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a Virtual Hub Ip configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + public static HubIpConfiguration CreateOrUpdate(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters) + { + return ((IVirtualHubIPConfigurationOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all VirtualHubIpConfigurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static IPage List(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName) + /// + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + public static void Delete(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName) + { + ((IVirtualHubIPConfigurationOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, ipConfigName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all VirtualHubIpConfigurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all VirtualHubIpConfigurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IVirtualHubIPConfigurationOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else - /// updates the existing VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// Hub Ip Configuration parameters. - /// - public static HubIpConfiguration BeginCreateOrUpdate(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters) + /// + /// Retrieves the details of all VirtualHubIpConfigurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + public static HubIpConfiguration BeginCreateOrUpdate(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters) + { + return ((IVirtualHubIPConfigurationOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else - /// updates the existing VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// Hub Ip Configuration parameters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a VirtualHubIpConfiguration resource if it doesn't exist else + /// updates the existing VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, HubIpConfiguration parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + public static void BeginDelete(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName) + { + ((IVirtualHubIPConfigurationOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - public static void BeginDelete(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName).GetAwaiter().GetResult(); - } + /// + /// Deletes a VirtualHubIpConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubBgpConnection. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the ipconfig. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualHubIPConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all VirtualHubIpConfigurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualHubIPConfigurationOperations operations, string nextPageLink) + { + return ((IVirtualHubIPConfigurationOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubIpConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubBgpConnection. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the ipconfig. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualHubIpConfigurationOperations operations, string resourceGroupName, string virtualHubName, string ipConfigName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all VirtualHubIpConfigurations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualHubIPConfigurationOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, ipConfigName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves the details of all VirtualHubIpConfigurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualHubIpConfigurationOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all VirtualHubIpConfigurations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualHubIpConfigurationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperations.cs index 025965421b53..ce7ac163d095 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperations.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// VirtualHubRouteTableV2sOperations operations. + /// VirtualHubRouteTableV2SOperations operations. /// - internal partial class VirtualHubRouteTableV2sOperations : IServiceOperations, IVirtualHubRouteTableV2sOperations + internal partial class VirtualHubRouteTableV2SOperations : Microsoft.Rest.IServiceOperations, IVirtualHubRouteTableV2SOperations { /// - /// Initializes a new instance of the VirtualHubRouteTableV2sOperations class. + /// Initializes a new instance of the VirtualHubRouteTableV2SOperations class. /// /// /// Reference to the service client. @@ -36,13 +24,13 @@ internal partial class VirtualHubRouteTableV2sOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) + internal VirtualHubRouteTableV2SOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,50 +162,51 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -216,9 +216,10 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -229,28 +230,31 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates - /// the existing VirtualHubRouteTableV2. + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. /// /// /// The resource group name of the VirtualHub. @@ -265,16 +269,16 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// Parameters supplied to create or update VirtualHubRouteTableV2. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -290,16 +294,16 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// The name of the VirtualHubRouteTableV2. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +321,13 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,41 +336,52 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -376,25 +391,24 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -406,55 +420,56 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -464,9 +479,10 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -477,27 +493,31 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates /// the existing VirtualHubRouteTableV2. /// /// @@ -518,13 +538,13 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -533,52 +553,65 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (virtualHubRouteTableV2Parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubRouteTableV2Parameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); - } - if (virtualHubRouteTableV2Parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubRouteTableV2Parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("virtualHubRouteTableV2Parameters", virtualHubRouteTableV2Parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -588,25 +621,24 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -618,56 +650,57 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(virtualHubRouteTableV2Parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubRouteTableV2Parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubRouteTableV2Parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -677,9 +710,10 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -690,16 +724,16 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -708,25 +742,29 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualHubRouteTableV2. /// @@ -745,10 +783,10 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -757,47 +795,59 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -807,25 +857,24 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -837,50 +886,51 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -890,20 +940,25 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the details of all VirtualHubRouteTableV2s. /// @@ -916,13 +971,13 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -931,51 +986,54 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -987,55 +1045,56 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1045,9 +1104,10 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1058,24 +1118,28 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs index 303dafa2824d..ddca54165b58 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs @@ -1,339 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualHubRouteTableV2sOperations. + /// Extension methods for VirtualHubRouteTableV2SOperations /// - public static partial class VirtualHubRouteTableV2sOperationsExtensions + public static partial class VirtualHubRouteTableV2SOperationsExtensions { - /// - /// Retrieves the details of a VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubRouteTableV2. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - public static VirtualHubRouteTableV2 Get(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) - { - return operations.GetAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubRouteTableV2. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates - /// the existing VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// Parameters supplied to create or update VirtualHubRouteTableV2. - /// - public static VirtualHubRouteTableV2 CreateOrUpdate(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates - /// the existing VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// Parameters supplied to create or update VirtualHubRouteTableV2. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubRouteTableV2. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - public static void Delete(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static VirtualHubRouteTableV2 Get(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + return ((IVirtualHubRouteTableV2SOperations)operations).GetAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubRouteTableV2. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static VirtualHubRouteTableV2 CreateOrUpdate(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters) + { + return ((IVirtualHubRouteTableV2SOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all VirtualHubRouteTableV2s. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static IPage List(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName) + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static void Delete(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + ((IVirtualHubRouteTableV2SOperations)operations).DeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of all VirtualHubRouteTableV2s. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IVirtualHubRouteTableV2SOperations)operations).ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates - /// the existing VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// Parameters supplied to create or update VirtualHubRouteTableV2. - /// - public static VirtualHubRouteTableV2 BeginCreateOrUpdate(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters) + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static VirtualHubRouteTableV2 BeginCreateOrUpdate(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters) + { + return ((IVirtualHubRouteTableV2SOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates - /// the existing VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// Parameters supplied to create or update VirtualHubRouteTableV2. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static void BeginDelete(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + ((IVirtualHubRouteTableV2SOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubRouteTableV2. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - public static void BeginDelete(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); - } + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualHubRouteTableV2SOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualHubRouteTableV2SOperations operations, string nextPageLink) + { + return ((IVirtualHubRouteTableV2SOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualHubRouteTableV2. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHubRouteTableV2. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The name of the VirtualHubRouteTableV2. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualHubRouteTableV2SOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves the details of all VirtualHubRouteTableV2s. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualHubRouteTableV2sOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of all VirtualHubRouteTableV2s. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualHubRouteTableV2sOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperations.cs index d3dd167724e2..ab1da8da9c4b 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualHubsOperations operations. /// - internal partial class VirtualHubsOperations : IServiceOperations, IVirtualHubsOperations + internal partial class VirtualHubsOperations : Microsoft.Rest.IServiceOperations, IVirtualHubsOperations { /// /// Initializes a new instance of the VirtualHubsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualHubsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualHubsOperations(NetworkManagementClient client) + internal VirtualHubsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,28 +225,31 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing - /// VirtualHub. + /// Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. /// /// /// The resource group name of the VirtualHub. @@ -258,16 +261,16 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// Parameters supplied to create or update VirtualHub. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -288,13 +291,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -303,46 +306,57 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (virtualHubParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualHubName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualHubParameters == null) + + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("virtualHubParameters", virtualHubParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -352,25 +366,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -382,61 +395,62 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(virtualHubParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -446,9 +460,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -459,25 +474,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualHub. /// @@ -488,16 +507,16 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// The name of the VirtualHub. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -512,13 +531,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -527,35 +546,45 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +594,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +623,56 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +682,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +696,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VirtualHubs in a subscription. /// @@ -694,13 +728,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -709,29 +743,38 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +784,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,55 +813,56 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,9 +872,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -842,28 +886,31 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets the effective routes configured for the Virtual Hub resource or the - /// specified resource . + /// Gets the effective routes configured for the Virtual Hub resource or the specified resource . /// /// /// The resource group name of the VirtualHub. @@ -875,21 +922,20 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// Parameters supplied to get the effective routes for a specific resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the inbound routes configured for the Virtual Hub on a particular - /// connection. + /// Gets the inbound routes configured for the Virtual Hub on a particular connection. /// /// /// The resource group name of the VirtualHub. @@ -901,21 +947,20 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// Parameters supplied to get the inbound routes for a connection resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetInboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetInboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the outbound routes configured for the Virtual Hub on a particular - /// connection. + /// Gets the outbound routes configured for the Virtual Hub on a particular connection. /// /// /// The resource group name of the VirtualHub. @@ -927,20 +972,20 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// Parameters supplied to get the outbound routes for a connection resource. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetOutboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetOutboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// Creates a VirtualHub resource if it doesn't exist else updates the existing /// VirtualHub. /// /// @@ -958,13 +1003,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -973,50 +1018,61 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (virtualHubParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubParameters"); } - if (resourceGroupName == null) + if (virtualHubParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + virtualHubParameters.Validate(); } - if (virtualHubName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualHubParameters == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualHubParameters != null) + + if (virtualHubName == null) { - virtualHubParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("virtualHubParameters", virtualHubParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1026,25 +1082,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1056,61 +1111,62 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(virtualHubParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1120,9 +1176,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1133,16 +1190,16 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1151,25 +1208,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualHub. /// @@ -1185,10 +1246,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1197,41 +1258,52 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1241,25 +1313,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1271,55 +1342,56 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1329,20 +1401,25 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the effective routes configured for the Virtual Hub resource or the /// specified resource . @@ -1362,13 +1439,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1377,42 +1454,54 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("effectiveRoutesParameters", effectiveRoutesParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveVirtualHubRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveVirtualHubRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1422,25 +1511,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1452,61 +1540,62 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(effectiveRoutesParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(effectiveRoutesParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(effectiveRoutesParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1516,9 +1605,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1529,25 +1619,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the inbound routes configured for the Virtual Hub on a particular /// connection. @@ -1567,13 +1661,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1582,46 +1676,58 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetInboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (getInboundRoutesParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "getInboundRoutesParameters"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualHubName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (getInboundRoutesParameters == null) + + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "getInboundRoutesParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("getInboundRoutesParameters", getInboundRoutesParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetInboundRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetInboundRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1631,25 +1737,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1661,61 +1766,62 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(getInboundRoutesParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(getInboundRoutesParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(getInboundRoutesParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1725,9 +1831,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1738,25 +1845,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the outbound routes configured for the Virtual Hub on a particular /// connection. @@ -1776,13 +1887,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1791,46 +1902,58 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetOutboundRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (getOutboundRoutesParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "getOutboundRoutesParameters"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualHubName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (getOutboundRoutesParameters == null) + + if (virtualHubName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "getOutboundRoutesParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualHubName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("getOutboundRoutesParameters", getOutboundRoutesParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetOutboundRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetOutboundRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1840,25 +1963,24 @@ internal VirtualHubsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1870,61 +1992,62 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(getOutboundRoutesParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(getOutboundRoutesParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(getOutboundRoutesParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1934,9 +2057,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1947,25 +2071,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VirtualHubs in a resource group. /// @@ -1978,13 +2106,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1993,51 +2121,54 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2049,55 +2180,56 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2107,9 +2239,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2120,25 +2253,29 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VirtualHubs in a subscription. /// @@ -2151,13 +2288,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2166,51 +2303,54 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2222,55 +2362,56 @@ internal VirtualHubsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2280,9 +2421,10 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2293,24 +2435,28 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperationsExtensions.cs index 672e1bd602e3..e6a457f03d79 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualHubsOperationsExtensions.cs @@ -1,699 +1,620 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualHubsOperations. + /// Extension methods for VirtualHubsOperations /// public static partial class VirtualHubsOperationsExtensions { - /// - /// Retrieves the details of a VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static VirtualHub Get(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName) - { - return operations.GetAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to create or update VirtualHub. - /// - public static VirtualHub CreateOrUpdate(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to create or update VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates VirtualHub tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to update VirtualHub tags. - /// - public static VirtualHub UpdateTags(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters) - { - return operations.UpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates VirtualHub tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to update VirtualHub tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static void Delete(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName) - { - operations.DeleteAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the VirtualHubs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - public static IPage ListByResourceGroup(this IVirtualHubsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VirtualHubs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVirtualHubsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VirtualHubs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVirtualHubsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the VirtualHubs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualHubsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the effective routes configured for the Virtual Hub resource or the - /// specified resource . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the effective routes for a specific resource. - /// - public static VirtualHubEffectiveRouteList GetEffectiveVirtualHubRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters)) - { - return operations.GetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the effective routes configured for the Virtual Hub resource or the - /// specified resource . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the effective routes for a specific resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetEffectiveVirtualHubRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetEffectiveVirtualHubRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the inbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the inbound routes for a connection resource. - /// - public static EffectiveRouteMapRouteList GetInboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) - { - return operations.GetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the inbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the inbound routes for a connection resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetInboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetInboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the outbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the outbound routes for a connection resource. - /// - public static EffectiveRouteMapRouteList GetOutboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) - { - return operations.GetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the outbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the outbound routes for a connection resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetOutboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOutboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to create or update VirtualHub. - /// - public static VirtualHub BeginCreateOrUpdate(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing - /// VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to create or update VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - public static void BeginDelete(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VirtualHub. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the effective routes configured for the Virtual Hub resource or the - /// specified resource . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the effective routes for a specific resource. - /// - public static VirtualHubEffectiveRouteList BeginGetEffectiveVirtualHubRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters)) - { - return operations.BeginGetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the effective routes configured for the Virtual Hub resource or the - /// specified resource . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the effective routes for a specific resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetEffectiveVirtualHubRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the inbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the inbound routes for a connection resource. - /// - public static EffectiveRouteMapRouteList BeginGetInboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) - { - return operations.BeginGetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the inbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the inbound routes for a connection resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetInboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetInboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the outbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the outbound routes for a connection resource. - /// - public static EffectiveRouteMapRouteList BeginGetOutboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) - { - return operations.BeginGetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters).GetAwaiter().GetResult(); - } - - /// - /// Gets the outbound routes configured for the Virtual Hub on a particular - /// connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to get the outbound routes for a connection resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetOutboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetOutboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VirtualHubs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVirtualHubsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VirtualHubs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVirtualHubsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VirtualHubs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualHubsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VirtualHubs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualHubsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Retrieves the details of a VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static VirtualHub Get(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName) + { + return ((IVirtualHubsOperations)operations).GetAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the details of a VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static VirtualHub CreateOrUpdate(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters) + { + return ((IVirtualHubsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates VirtualHub tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static VirtualHub UpdateTags(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters) + { + return ((IVirtualHubsOperations)operations).UpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates VirtualHub tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static void Delete(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName) + { + ((IVirtualHubsOperations)operations).DeleteAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the VirtualHubs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVirtualHubsOperations operations, string resourceGroupName) + { + return ((IVirtualHubsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the VirtualHubs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVirtualHubsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VirtualHubs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualHubsOperations operations) + { + return ((IVirtualHubsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the VirtualHubs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualHubsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static VirtualHubEffectiveRouteList GetEffectiveVirtualHubRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters)) + { + return ((IVirtualHubsOperations)operations).GetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetEffectiveVirtualHubRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetEffectiveVirtualHubRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static EffectiveRouteMapRouteList GetInboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) + { + return ((IVirtualHubsOperations)operations).GetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetInboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetInboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static EffectiveRouteMapRouteList GetOutboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) + { + return ((IVirtualHubsOperations)operations).GetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetOutboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetOutboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static VirtualHub BeginCreateOrUpdate(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters) + { + return ((IVirtualHubsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static void BeginDelete(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName) + { + ((IVirtualHubsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a VirtualHub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static VirtualHubEffectiveRouteList BeginGetEffectiveVirtualHubRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters)) + { + return ((IVirtualHubsOperations)operations).BeginGetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the effective routes configured for the Virtual Hub resource or the + /// specified resource . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetEffectiveVirtualHubRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters = default(EffectiveRoutesParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetEffectiveVirtualHubRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static EffectiveRouteMapRouteList BeginGetInboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) + { + return ((IVirtualHubsOperations)operations).BeginGetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the inbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetInboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetInboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static EffectiveRouteMapRouteList BeginGetOutboundRoutes(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) + { + return ((IVirtualHubsOperations)operations).BeginGetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the outbound routes configured for the Virtual Hub on a particular + /// connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetOutboundRoutesAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetOutboundRoutesWithHttpMessagesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VirtualHubs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVirtualHubsOperations operations, string nextPageLink) + { + return ((IVirtualHubsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the VirtualHubs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVirtualHubsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VirtualHubs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualHubsOperations operations, string nextPageLink) + { + return ((IVirtualHubsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the VirtualHubs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualHubsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperations.cs index e6dc4b4b2788..8af44e48ad43 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkGatewayConnectionsOperations operations. /// - internal partial class VirtualNetworkGatewayConnectionsOperations : IServiceOperations, IVirtualNetworkGatewayConnectionsOperations + internal partial class VirtualNetworkGatewayConnectionsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewayConnectionsOperations { /// /// Initializes a new instance of the VirtualNetworkGatewayConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualNetworkGatewayConnectionsOperations : IServiceOper /// /// Thrown when a required parameter is null /// - internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient client) + internal VirtualNetworkGatewayConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie public NetworkManagementClient Client { get; private set; } /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. + /// Creates or updates a virtual network gateway connection in the specified resource group. /// /// /// The name of the resource group. @@ -65,16 +52,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// connection operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -92,13 +79,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -107,41 +94,52 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -151,25 +149,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -181,55 +178,56 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -239,9 +237,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -252,25 +251,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified virtual network Gateway connection. /// @@ -281,16 +284,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -306,23 +309,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// Parameters supplied to update virtual network gateway connection tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// 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. + /// 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. /// /// /// The name of the resource group. @@ -335,16 +335,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// Shared key operation throughNetwork resource provider. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -364,13 +364,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -379,41 +379,52 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -423,25 +434,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -453,55 +463,56 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -511,9 +522,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -524,25 +536,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The List VirtualNetworkGatewayConnections operation retrieves all the /// virtual network gateways connections created. @@ -556,13 +572,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -571,35 +587,45 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -609,25 +635,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -639,55 +664,56 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -697,9 +723,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -710,30 +737,31 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// 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. + /// 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. /// /// /// The name of the resource group. @@ -746,21 +774,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// shared key operation through network resource provider. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Starts packet capture on virtual network gateway connection in the - /// specified resource group. + /// Starts packet capture on virtual network gateway connection in the specified resource group. /// /// /// The name of the resource group. @@ -773,21 +800,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// capture on gateway connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Stops packet capture on virtual network gateway connection in the specified - /// resource group. + /// Stops packet capture on virtual network gateway connection in the specified resource group. /// /// /// The name of the resource group. @@ -800,21 +826,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// capture on gateway connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Lists IKE Security Associations for the virtual network gateway connection - /// in the specified resource group. + /// Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. /// /// /// The name of the resource group. @@ -823,16 +848,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway Connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -845,16 +870,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway Connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -877,13 +902,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -892,50 +917,61 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayConnectionName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (virtualNetworkGatewayConnectionName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -945,25 +981,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -975,61 +1010,62 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1039,9 +1075,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1052,16 +1089,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1070,25 +1107,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified virtual network Gateway connection. /// @@ -1104,10 +1145,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1116,41 +1157,52 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1160,25 +1212,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1190,55 +1241,56 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1248,20 +1300,25 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a virtual network gateway connection tags. /// @@ -1280,13 +1337,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1295,46 +1352,57 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayConnectionName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1344,25 +1412,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1374,61 +1441,62 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1438,9 +1506,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1451,25 +1520,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual /// network gateway connection shared key for passed virtual network gateway @@ -1492,13 +1565,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1507,50 +1580,61 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayConnectionName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (virtualNetworkGatewayConnectionName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1560,25 +1644,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1590,61 +1673,62 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1654,9 +1738,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1667,16 +1752,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1685,25 +1770,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network @@ -1726,13 +1815,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1741,50 +1830,61 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayConnectionName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (virtualNetworkGatewayConnectionName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1794,25 +1894,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1824,61 +1923,62 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1888,9 +1988,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1901,25 +2002,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts packet capture on virtual network gateway connection in the /// specified resource group. @@ -1940,13 +2045,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1955,42 +2060,54 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2000,25 +2117,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2030,56 +2146,57 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2089,9 +2206,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2102,25 +2220,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops packet capture on virtual network gateway connection in the specified /// resource group. @@ -2141,13 +2263,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2156,46 +2278,58 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayConnectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2205,25 +2339,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2235,56 +2368,57 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2294,9 +2428,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2307,25 +2442,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists IKE Security Associations for the virtual network gateway connection /// in the specified resource group. @@ -2342,13 +2481,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2357,41 +2496,52 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetIkeSas", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetIkeSas", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2401,25 +2551,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2431,50 +2580,51 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2484,9 +2634,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2497,25 +2648,29 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the virtual network gateway connection specified. /// @@ -2531,10 +2686,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2543,41 +2698,52 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2587,25 +2753,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2617,50 +2782,51 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2670,20 +2836,25 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The List VirtualNetworkGatewayConnections operation retrieves all the /// virtual network gateways connections created. @@ -2697,13 +2868,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2712,51 +2883,54 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2768,55 +2942,56 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2826,9 +3001,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2839,24 +3015,28 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs index 9d19e609a31d..1281a4693df3 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs @@ -1,1021 +1,898 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworkGatewayConnectionsOperations. + /// Extension methods for VirtualNetworkGatewayConnectionsOperations /// public static partial class VirtualNetworkGatewayConnectionsOperationsExtensions { - /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// connection operation. - /// - public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// connection operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified virtual network gateway connection by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - return operations.GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified virtual network gateway connection by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified virtual network Gateway connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network Gateway connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a virtual network gateway connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to update virtual network gateway connection tags. - /// - public static VirtualNetworkGatewayConnection UpdateTags(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual network gateway connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to update virtual network gateway connection tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// - public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) - { - return operations.SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection shared key name. - /// - public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - return operations.GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection shared key name. - /// - /// - /// The cancellation token. - /// - public static async Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection reset shared key Name. - /// - /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. - /// - public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) - { - return operations.ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection reset shared key Name. - /// - /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts packet capture on virtual network gateway connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway connection. - /// - public static string StartPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) - { - return operations.StartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on virtual network gateway connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task StartPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops packet capture on virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway connection. - /// - public static string StopPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters) - { - return operations.StopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Stops packet capture on virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task StopPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists IKE Security Associations for the virtual network gateway connection - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - public static string GetIkeSas(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - return operations.GetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Lists IKE Security Associations for the virtual network gateway connection - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetIkeSasAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetIkeSasWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the virtual network gateway connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - public static void ResetConnection(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - operations.ResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Resets the virtual network gateway connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// The cancellation token. - /// - public static async Task ResetConnectionAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResetConnectionWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// connection operation. - /// - public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// connection operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified virtual network Gateway connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network Gateway connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a virtual network gateway connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to update virtual network gateway connection tags. - /// - public static VirtualNetworkGatewayConnection BeginUpdateTags(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual network gateway connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Parameters supplied to update virtual network gateway connection tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// - public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) - { - return operations.BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection reset shared key Name. - /// - /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. - /// - public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) - { - return operations.BeginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection reset shared key Name. - /// - /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts packet capture on virtual network gateway connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway connection. - /// - public static string BeginStartPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) - { - return operations.BeginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on virtual network gateway connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops packet capture on virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway connection. - /// - public static string BeginStopPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters) - { - return operations.BeginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Stops packet capture on virtual network gateway connection in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists IKE Security Associations for the virtual network gateway connection - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - public static string BeginGetIkeSas(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - return operations.BeginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Lists IKE Security Associations for the virtual network gateway connection - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetIkeSasAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the virtual network gateway connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - public static void BeginResetConnection(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) - { - operations.BeginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Resets the virtual network gateway connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway Connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetConnectionAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the specified virtual network gateway connection by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified virtual network gateway connection by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified virtual network Gateway connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + ((IVirtualNetworkGatewayConnectionsOperations)operations).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified virtual network Gateway connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a virtual network gateway connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static VirtualNetworkGatewayConnection UpdateTags(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).UpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual network gateway connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection name. + /// + public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection shared key name. + /// + public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection shared key name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection reset shared key Name. + /// + public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection reset shared key Name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts packet capture on virtual network gateway connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static string StartPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).StartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Starts packet capture on virtual network gateway connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + public static string StopPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).StopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + public static string GetIkeSas(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).GetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetIkeSasAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetIkeSasWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the virtual network gateway connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + public static void ResetConnection(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + ((IVirtualNetworkGatewayConnectionsOperations)operations).ResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Resets the virtual network gateway connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetConnectionAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ResetConnectionWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified virtual network Gateway connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified virtual network Gateway connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a virtual network gateway connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static VirtualNetworkGatewayConnection BeginUpdateTags(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual network gateway connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection name. + /// + public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection reset shared key Name. + /// + public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection reset shared key Name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts packet capture on virtual network gateway connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + public static string BeginStartPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Starts packet capture on virtual network gateway connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + public static string BeginStopPacketCapture(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Stops packet capture on virtual network gateway connection in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopPacketCaptureAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + public static string BeginGetIkeSas(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Lists IKE Security Associations for the virtual network gateway connection + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetIkeSasAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the virtual network gateway connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + public static void BeginResetConnection(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + { + ((IVirtualNetworkGatewayConnectionsOperations)operations).BeginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Resets the virtual network gateway connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway Connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetConnectionAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink) + { + return ((IVirtualNetworkGatewayConnectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperations.cs index 9779ac5764df..56e3894bad86 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkGatewayNatRulesOperations operations. /// - internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperations, IVirtualNetworkGatewayNatRulesOperations + internal partial class VirtualNetworkGatewayNatRulesOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewayNatRulesOperations { /// /// Initializes a new instance of the VirtualNetworkGatewayNatRulesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) + internal VirtualNetworkGatewayNatRulesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,28 +235,31 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. + /// Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. /// /// /// The resource group name of the Virtual Network Gateway. @@ -270,16 +274,16 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// Parameters supplied to create or Update a Nat Rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -295,16 +299,16 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// The name of the nat rule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -322,13 +326,13 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,41 +341,52 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGateway", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGateway", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +396,24 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,55 +425,56 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -469,9 +484,10 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -482,27 +498,31 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// Creates a nat rule to a scalable virtual network gateway if it doesn't /// exist else updates the existing nat rules. /// /// @@ -523,13 +543,13 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -538,52 +558,65 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (natRuleParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); - } - if (natRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("natRuleParameters", natRuleParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -593,25 +626,24 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -623,61 +655,62 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(natRuleParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(natRuleParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(natRuleParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -687,9 +720,10 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -700,16 +734,16 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -718,25 +752,29 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a nat rule. /// @@ -755,10 +793,10 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -767,47 +805,59 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "natRuleName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +867,24 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +896,56 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,20 +955,25 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all nat rules for a particular virtual network gateway. /// @@ -931,13 +986,13 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -946,51 +1001,54 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGatewayNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGatewayNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1002,55 +1060,56 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1060,9 +1119,10 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1073,24 +1133,28 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs index ee814ec18468..b36c23cc89ed 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs @@ -1,339 +1,311 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworkGatewayNatRulesOperations. + /// Extension methods for VirtualNetworkGatewayNatRulesOperations /// public static partial class VirtualNetworkGatewayNatRulesOperationsExtensions { - /// - /// Retrieves the details of a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static VirtualNetworkGatewayNatRule Get(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) - { - return operations.GetAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - public static VirtualNetworkGatewayNatRule CreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static void Delete(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static VirtualNetworkGatewayNatRule Get(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) + { + return ((IVirtualNetworkGatewayNatRulesOperations)operations).GetAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); + } - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static VirtualNetworkGatewayNatRule CreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) + { + return ((IVirtualNetworkGatewayNatRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the virtual network gateway. - /// - /// - /// The name of the gateway. - /// - public static IPage ListByVirtualNetworkGateway(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + /// + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static void Delete(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) + { + ((IVirtualNetworkGatewayNatRulesOperations)operations).DeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the virtual network gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVirtualNetworkGatewayAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVirtualNetworkGatewayWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the virtual network gateway. + /// + /// + /// The name of the gateway. + /// + public static Microsoft.Rest.Azure.IPage ListByVirtualNetworkGateway(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewayNatRulesOperations)operations).ListByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - public static VirtualNetworkGatewayNatRule BeginCreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the virtual network gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVirtualNetworkGatewayAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVirtualNetworkGatewayWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static VirtualNetworkGatewayNatRule BeginCreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) + { + return ((IVirtualNetworkGatewayNatRulesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); + } - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + public static void BeginDelete(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) + { + ((IVirtualNetworkGatewayNatRulesOperations)operations).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); + } - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static void BeginDelete(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); - } + /// + /// Deletes a nat rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVirtualNetworkGatewayNext(this IVirtualNetworkGatewayNatRulesOperations operations, string nextPageLink) + { + return ((IVirtualNetworkGatewayNatRulesOperations)operations).ListByVirtualNetworkGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVirtualNetworkGatewayNextAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVirtualNetworkGatewayNext(this IVirtualNetworkGatewayNatRulesOperations operations, string nextPageLink) - { - return operations.ListByVirtualNetworkGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVirtualNetworkGatewayNextAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperations.cs index 4ecfd1446baf..cb3ad8bfa1b5 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkGatewaysOperations operations. /// - internal partial class VirtualNetworkGatewaysOperations : IServiceOperations, IVirtualNetworkGatewaysOperations + internal partial class VirtualNetworkGatewaysOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewaysOperations { /// /// Initializes a new instance of the VirtualNetworkGatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualNetworkGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) + internal VirtualNetworkGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. + /// Creates or updates a virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -64,16 +51,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to create or update virtual network gateway operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -91,13 +78,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -106,41 +93,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -150,25 +148,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -180,55 +177,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -238,9 +236,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -251,25 +250,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified virtual network gateway. /// @@ -280,16 +283,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -305,16 +308,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update virtual network gateway tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -329,13 +332,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -344,35 +347,45 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -382,25 +395,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -412,55 +424,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -470,9 +483,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -483,25 +497,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the connections in a virtual network gateway. /// @@ -517,13 +535,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -532,41 +550,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnections", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListConnections", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -576,25 +605,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -606,55 +634,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -664,9 +693,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -677,28 +707,31 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Resets the primary of the virtual network gateway in the specified resource - /// group. + /// Resets the primary of the virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -711,21 +744,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// active-active feature enabled gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Resets the VPN client shared key of the virtual network gateway in the - /// specified resource group. + /// Resets the VPN client shared key of the virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -734,21 +766,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetVpnClientSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetVpnClientSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. + /// Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -761,21 +792,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// package operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Generates VPN profile for P2S client of the virtual network gateway in the - /// specified resource group. Used for IKEV2 and radius based authentication. + /// Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. /// /// /// The name of the resource group. @@ -788,22 +818,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// package operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// 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. + /// 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. /// /// /// The name of the resource group. @@ -812,16 +840,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -837,16 +865,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The IP address of the peer to retrieve the status of. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetBgpPeerStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetBgpPeerStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -864,13 +892,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -879,41 +907,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> SupportedVpnDevicesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SupportedVpnDevicesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SupportedVpnDevices", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "SupportedVpnDevices", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -923,25 +962,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -953,55 +991,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1011,9 +1050,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1024,28 +1064,31 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// This operation retrieves a list of routes the virtual network gateway has - /// learned, including routes learned from BGP peers. + /// This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. /// /// /// The name of the resource group. @@ -1054,21 +1097,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetLearnedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetLearnedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// This operation retrieves a list of routes the virtual network gateway is - /// advertising to the specified peer. + /// This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. /// /// /// The name of the resource group. @@ -1080,22 +1122,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The IP address of the peer. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// 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. + /// 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. /// /// /// The name of the resource group. @@ -1108,22 +1148,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// Network Gateway P2S client operation through Network resource provider. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// 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. + /// 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. /// /// /// The name of the resource group. @@ -1132,16 +1170,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The virtual network gateway name. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1163,13 +1201,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1178,46 +1216,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> VpnDeviceConfigurationScriptWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> VpnDeviceConfigurationScriptWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayConnectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "VpnDeviceConfigurationScript", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "VpnDeviceConfigurationScript", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1227,25 +1277,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1257,61 +1306,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1321,9 +1371,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1334,28 +1385,31 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Starts packet capture on virtual network gateway in the specified resource - /// group. + /// Starts packet capture on virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -1368,21 +1422,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// capture on gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Stops packet capture on virtual network gateway in the specified resource - /// group. + /// Stops packet capture on virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -1395,21 +1448,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// capture on gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get VPN client connection health detail per P2S client connection of the - /// virtual network gateway in the specified resource group. + /// Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -1418,21 +1470,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Disconnect vpn connections of virtual network gateway in the specified - /// resource group. + /// Disconnect vpn connections of virtual network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -1444,16 +1495,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The parameters are supplied to disconnect vpn connections. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1475,13 +1526,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1490,50 +1541,61 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (virtualNetworkGatewayName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1543,25 +1605,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1573,61 +1634,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1637,9 +1699,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1650,16 +1713,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1668,25 +1731,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified virtual network gateway. /// @@ -1702,10 +1769,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1714,41 +1781,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1758,25 +1836,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1788,55 +1865,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1846,20 +1924,25 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a virtual network gateway tags. /// @@ -1878,13 +1961,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1893,46 +1976,57 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1942,25 +2036,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1972,61 +2065,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2036,9 +2130,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2049,25 +2144,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the primary of the virtual network gateway in the specified resource /// group. @@ -2088,13 +2187,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2103,42 +2202,54 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("gatewayVip", gatewayVip); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (gatewayVip != null) { _queryParameters.Add(string.Format("gatewayVip={0}", System.Uri.EscapeDataString(gatewayVip))); @@ -2152,25 +2263,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2182,55 +2292,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2240,9 +2351,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2253,25 +2365,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the VPN client shared key of the virtual network gateway in the /// specified resource group. @@ -2288,10 +2404,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2300,41 +2416,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginResetVpnClientSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetVpnClientSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetVpnClientSharedKey", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2344,25 +2471,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2374,55 +2500,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2432,20 +2559,25 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Generates VPN client package for P2S client of the virtual network gateway /// in the specified resource group. @@ -2466,13 +2598,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2481,46 +2613,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGeneratevpnclientpackage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGeneratevpnclientpackage", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2530,25 +2674,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2560,61 +2703,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2624,9 +2768,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2637,25 +2782,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Generates VPN profile for P2S client of the virtual network gateway in the /// specified resource group. Used for IKEV2 and radius based authentication. @@ -2676,13 +2825,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2691,46 +2840,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateVpnProfile", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateVpnProfile", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2740,25 +2901,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2770,61 +2930,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2834,9 +2995,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2847,25 +3009,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets pre-generated VPN profile for P2S client of the virtual network /// gateway in the specified resource group. The profile needs to be generated @@ -2883,13 +3049,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2898,41 +3064,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnProfilePackageUrl", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnProfilePackageUrl", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2942,25 +3119,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2972,55 +3148,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3030,9 +3207,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3043,25 +3221,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. /// @@ -3080,13 +3262,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3095,42 +3277,54 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetBgpPeerStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("peer", peer); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetBgpPeerStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetBgpPeerStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (peer != null) { _queryParameters.Add(string.Format("peer={0}", System.Uri.EscapeDataString(peer))); @@ -3144,25 +3338,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3174,55 +3367,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3232,9 +3426,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3245,25 +3440,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// This operation retrieves a list of routes the virtual network gateway has /// learned, including routes learned from BGP peers. @@ -3280,13 +3479,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3295,41 +3494,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetLearnedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetLearnedRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetLearnedRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3339,25 +3549,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3369,55 +3578,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3427,9 +3637,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3440,25 +3651,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// This operation retrieves a list of routes the virtual network gateway is /// advertising to the specified peer. @@ -3478,13 +3693,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3493,46 +3708,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (peer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peer"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("peer", peer); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetAdvertisedRoutes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetAdvertisedRoutes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (peer != null) { _queryParameters.Add(string.Format("peer={0}", System.Uri.EscapeDataString(peer))); @@ -3546,25 +3773,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3576,55 +3802,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3634,9 +3861,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3647,25 +3875,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy /// for P2S client of virtual network gateway in the specified resource group @@ -3687,13 +3919,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3702,50 +3934,61 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (vpnclientIpsecParams == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnclientIpsecParams"); } - if (virtualNetworkGatewayName == null) + if (vpnclientIpsecParams != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + vpnclientIpsecParams.Validate(); } - if (vpnclientIpsecParams == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnclientIpsecParams"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnclientIpsecParams != null) + + if (virtualNetworkGatewayName == null) { - vpnclientIpsecParams.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("vpnclientIpsecParams", vpnclientIpsecParams); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("vpnclientIpsecParams", vpnclientIpsecParams); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSetVpnclientIpsecParameters", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSetVpnclientIpsecParameters", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3755,25 +3998,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3785,61 +4027,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnclientIpsecParams != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnclientIpsecParams, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnclientIpsecParams, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3849,9 +4092,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3862,25 +4106,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The Get VpnclientIpsecParameters operation retrieves information about the /// vpnclient ipsec policy for P2S client of virtual network gateway in the @@ -3898,13 +4146,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3913,41 +4161,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnclientIpsecParameters", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnclientIpsecParameters", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3957,25 +4216,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3987,55 +4245,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4045,9 +4304,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4058,25 +4318,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts packet capture on virtual network gateway in the specified resource /// group. @@ -4097,13 +4361,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4112,42 +4376,54 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4157,25 +4433,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4187,56 +4462,57 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4246,9 +4522,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4259,25 +4536,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops packet capture on virtual network gateway in the specified resource /// group. @@ -4298,13 +4579,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4313,46 +4594,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4362,25 +4655,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4392,56 +4684,57 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4451,9 +4744,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4464,25 +4758,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get VPN client connection health detail per P2S client connection of the /// virtual network gateway in the specified resource group. @@ -4499,13 +4797,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4514,41 +4812,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnclientConnectionHealth", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnclientConnectionHealth", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4558,25 +4867,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4588,55 +4896,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4646,9 +4955,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4659,25 +4969,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Disconnect vpn connections of virtual network gateway in the specified /// resource group. @@ -4697,10 +5011,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4709,46 +5023,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualNetworkGatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (request == null) + + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("request", request); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDisconnectVirtualNetworkGatewayVpnConnections", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDisconnectVirtualNetworkGatewayVpnConnections", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4758,25 +5084,24 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4788,61 +5113,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4852,20 +5178,25 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all virtual network gateways by resource group. /// @@ -4878,13 +5209,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4893,51 +5224,54 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4949,55 +5283,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5007,9 +5342,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -5020,25 +5356,29 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the connections in a virtual network gateway. /// @@ -5051,13 +5391,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5066,51 +5406,54 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListConnectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListConnectionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5122,55 +5465,56 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5180,9 +5524,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -5193,24 +5538,28 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 2ba20d825b05..d4817c0a44ee 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -1,1861 +1,1689 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworkGatewaysOperations. + /// Extension methods for VirtualNetworkGatewaysOperations /// public static partial class VirtualNetworkGatewaysOperationsExtensions { - /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// - public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the specified virtual network gateway by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.GetAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified virtual network gateway by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a virtual network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to update virtual network gateway tags. - /// - public static VirtualNetworkGateway UpdateTags(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to update virtual network gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all virtual network gateways by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual network gateways by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the connections in a virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static IPage ListConnections(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.ListConnectionsAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the connections in a virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListConnectionsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the primary of the virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// - public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) - { - return operations.ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).GetAwaiter().GetResult(); - } - - /// - /// Resets the primary of the virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// - /// - /// The cancellation token. - /// - public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the VPN client shared key of the virtual network gateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static void ResetVpnClientSharedKey(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - operations.ResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Resets the VPN client shared key of the virtual network gateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task ResetVpnClientSharedKeyAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResetVpnClientSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) - { - return operations.GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - /// - /// The cancellation token. - /// - public static async Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generates VPN profile for P2S client of the virtual network gateway in the - /// specified resource group. Used for IKEV2 and radius based authentication. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - public static string GenerateVpnProfile(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) - { - return operations.GenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Generates VPN profile for P2S client of the virtual network gateway in the - /// specified resource group. Used for IKEV2 and radius based authentication. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateVpnProfileAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static string GetVpnProfilePackageUrl(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.GetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetVpnProfilePackageUrlAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetVpnProfilePackageUrlWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer to retrieve the status of. - /// - public static BgpPeerStatusListResult GetBgpPeerStatus(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string)) - { - return operations.GetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); - } - - /// - /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer to retrieve the status of. - /// - /// - /// The cancellation token. - /// - public static async Task GetBgpPeerStatusAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetBgpPeerStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a xml format representation for supported vpn devices. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static string SupportedVpnDevices(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.SupportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Gets a xml format representation for supported vpn devices. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task SupportedVpnDevicesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.SupportedVpnDevicesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// This operation retrieves a list of routes the virtual network gateway has - /// learned, including routes learned from BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static GatewayRouteListResult GetLearnedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.GetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// This operation retrieves a list of routes the virtual network gateway has - /// learned, including routes learned from BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetLearnedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetLearnedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// This operation retrieves a list of routes the virtual network gateway is - /// advertising to the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer. - /// - public static GatewayRouteListResult GetAdvertisedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer) - { - return operations.GetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); - } - - /// - /// This operation retrieves a list of routes the virtual network gateway is - /// advertising to the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer. - /// - /// - /// The cancellation token. - /// - public static async Task GetAdvertisedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual - /// Network Gateway P2S client operation through Network resource provider. - /// - public static VpnClientIPsecParameters SetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) - { - return operations.SetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual - /// Network Gateway P2S client operation through Network resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task SetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.SetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway name. - /// - public static VpnClientIPsecParameters GetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.GetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway name. - /// - /// - /// The cancellation token. - /// - public static async Task GetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a xml format representation for vpn device configuration script. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection for which the - /// configuration script is generated. - /// - /// - /// Parameters supplied to the generate vpn device script operation. - /// - public static string VpnDeviceConfigurationScript(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) - { - return operations.VpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Gets a xml format representation for vpn device configuration script. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection for which the - /// configuration script is generated. - /// - /// - /// Parameters supplied to the generate vpn device script operation. - /// - /// - /// The cancellation token. - /// - public static async Task VpnDeviceConfigurationScriptAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.VpnDeviceConfigurationScriptWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway. - /// - public static string StartPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) - { - return operations.StartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway. - /// - /// - /// The cancellation token. - /// - public static async Task StartPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway. - /// - public static string StopPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) - { - return operations.StopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Stops packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway. - /// - /// - /// The cancellation token. - /// - public static async Task StopPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get VPN client connection health detail per P2S client connection of the - /// virtual network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static VpnClientConnectionHealthDetailListResult GetVpnclientConnectionHealth(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.GetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Get VPN client connection health detail per P2S client connection of the - /// virtual network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetVpnclientConnectionHealthAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetVpnclientConnectionHealthWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Disconnect vpn connections of virtual network gateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The parameters are supplied to disconnect vpn connections. - /// - public static void DisconnectVirtualNetworkGatewayVpnConnections(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request) - { - operations.DisconnectVirtualNetworkGatewayVpnConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, request).GetAwaiter().GetResult(); - } - - /// - /// Disconnect vpn connections of virtual network gateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The parameters are supplied to disconnect vpn connections. - /// - /// - /// The cancellation token. - /// - public static async Task DisconnectVirtualNetworkGatewayVpnConnectionsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// - public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a virtual network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to update virtual network gateway tags. - /// - public static VirtualNetworkGateway BeginUpdateTags(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to update virtual network gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the primary of the virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// - public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) - { - return operations.BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).GetAwaiter().GetResult(); - } - - /// - /// Resets the primary of the virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the VPN client shared key of the virtual network gateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static void BeginResetVpnClientSharedKey(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - operations.BeginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Resets the VPN client shared key of the virtual network gateway in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetVpnClientSharedKeyAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginResetVpnClientSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - public static string BeginGeneratevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) - { - return operations.BeginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generates VPN profile for P2S client of the virtual network gateway in the - /// specified resource group. Used for IKEV2 and radius based authentication. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - public static string BeginGenerateVpnProfile(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) - { - return operations.BeginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Generates VPN profile for P2S client of the virtual network gateway in the - /// specified resource group. Used for IKEV2 and radius based authentication. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGenerateVpnProfileAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static string BeginGetVpnProfilePackageUrl(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.BeginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetVpnProfilePackageUrlAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer to retrieve the status of. - /// - public static BgpPeerStatusListResult BeginGetBgpPeerStatus(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string)) - { - return operations.BeginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); - } - - /// - /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer to retrieve the status of. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetBgpPeerStatusAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetBgpPeerStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// This operation retrieves a list of routes the virtual network gateway has - /// learned, including routes learned from BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static GatewayRouteListResult BeginGetLearnedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.BeginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// This operation retrieves a list of routes the virtual network gateway has - /// learned, including routes learned from BGP peers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetLearnedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetLearnedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// This operation retrieves a list of routes the virtual network gateway is - /// advertising to the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer. - /// - public static GatewayRouteListResult BeginGetAdvertisedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer) - { - return operations.BeginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); - } - - /// - /// This operation retrieves a list of routes the virtual network gateway is - /// advertising to the specified peer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The IP address of the peer. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetAdvertisedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual - /// Network Gateway P2S client operation through Network resource provider. - /// - public static VpnClientIPsecParameters BeginSetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) - { - return operations.BeginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual - /// Network Gateway P2S client operation through Network resource provider. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway name. - /// - public static VpnClientIPsecParameters BeginGetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.BeginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// 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. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway name. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway. - /// - public static string BeginStartPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) - { - return operations.BeginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to start packet - /// capture on gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway. - /// - public static string BeginStopPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) - { - return operations.BeginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Stops packet capture on virtual network gateway in the specified resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway packet capture parameters supplied to stop packet - /// capture on gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get VPN client connection health detail per P2S client connection of the - /// virtual network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - public static VpnClientConnectionHealthDetailListResult BeginGetVpnclientConnectionHealth(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.BeginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Get VPN client connection health detail per P2S client connection of the - /// virtual network gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetVpnclientConnectionHealthAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Disconnect vpn connections of virtual network gateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The parameters are supplied to disconnect vpn connections. - /// - public static void BeginDisconnectVirtualNetworkGatewayVpnConnections(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request) - { - operations.BeginDisconnectVirtualNetworkGatewayVpnConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, request).GetAwaiter().GetResult(); - } - - /// - /// Disconnect vpn connections of virtual network gateway in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// The parameters are supplied to disconnect vpn connections. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDisconnectVirtualNetworkGatewayVpnConnectionsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all virtual network gateways by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual network gateways by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the connections in a virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListConnectionsNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) - { - return operations.ListConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the connections in a virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListConnectionsNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Creates or updates a virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the specified virtual network gateway by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified virtual network gateway by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + ((IVirtualNetworkGatewaysOperations)operations).DeleteAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a virtual network gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VirtualNetworkGateway UpdateTags(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual network gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all virtual network gateways by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) + { + return ((IVirtualNetworkGatewaysOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual network gateways by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the connections in a virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static Microsoft.Rest.Azure.IPage ListConnections(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).ListConnectionsAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the connections in a virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListConnectionsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the primary of the virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// + public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + { + return ((IVirtualNetworkGatewaysOperations)operations).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).GetAwaiter().GetResult(); + } + + /// + /// Resets the primary of the virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static void ResetVpnClientSharedKey(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + ((IVirtualNetworkGatewaysOperations)operations).ResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetVpnClientSharedKeyAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ResetVpnClientSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string GenerateVpnProfile(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).GenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateVpnProfileAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string GetVpnProfilePackageUrl(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVpnProfilePackageUrlAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVpnProfilePackageUrlWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer to retrieve the status of. + /// + public static BgpPeerStatusListResult GetBgpPeerStatus(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string)) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); + } + + /// + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer to retrieve the status of. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetBgpPeerStatusAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetBgpPeerStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a xml format representation for supported vpn devices. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string SupportedVpnDevices(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).SupportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Gets a xml format representation for supported vpn devices. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SupportedVpnDevicesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.SupportedVpnDevicesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static GatewayRouteListResult GetLearnedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetLearnedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetLearnedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer. + /// + public static GatewayRouteListResult GetAdvertisedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); + } + + /// + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAdvertisedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VpnClientIPsecParameters SetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) + { + return ((IVirtualNetworkGatewaysOperations)operations).SetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.SetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + public static VpnClientIPsecParameters GetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a xml format representation for vpn device configuration script. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection for which the + /// configuration script is generated. + /// + public static string VpnDeviceConfigurationScript(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).VpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Gets a xml format representation for vpn device configuration script. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway connection for which the + /// configuration script is generated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task VpnDeviceConfigurationScriptAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.VpnDeviceConfigurationScriptWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string StartPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) + { + return ((IVirtualNetworkGatewaysOperations)operations).StartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Starts packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Stops packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string StopPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).StopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Stops packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VpnClientConnectionHealthDetailListResult GetVpnclientConnectionHealth(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).GetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVpnclientConnectionHealthAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVpnclientConnectionHealthWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static void DisconnectVirtualNetworkGatewayVpnConnections(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request) + { + ((IVirtualNetworkGatewaysOperations)operations).DisconnectVirtualNetworkGatewayVpnConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, request).GetAwaiter().GetResult(); + } + + /// + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DisconnectVirtualNetworkGatewayVpnConnectionsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + ((IVirtualNetworkGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a virtual network gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VirtualNetworkGateway BeginUpdateTags(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual network gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the primary of the virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// + public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).GetAwaiter().GetResult(); + } + + /// + /// Resets the primary of the virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static void BeginResetVpnClientSharedKey(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + ((IVirtualNetworkGatewaysOperations)operations).BeginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Resets the VPN client shared key of the virtual network gateway in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetVpnClientSharedKeyAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginResetVpnClientSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string BeginGeneratevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string BeginGenerateVpnProfile(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Generates VPN profile for P2S client of the virtual network gateway in the + /// specified resource group. Used for IKEV2 and radius based authentication. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGenerateVpnProfileAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string BeginGetVpnProfilePackageUrl(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetVpnProfilePackageUrlAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetVpnProfilePackageUrlWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer to retrieve the status of. + /// + public static BgpPeerStatusListResult BeginGetBgpPeerStatus(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string)) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); + } + + /// + /// The GetBgpPeerStatus operation retrieves the status of all BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer to retrieve the status of. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetBgpPeerStatusAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetBgpPeerStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static GatewayRouteListResult BeginGetLearnedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// This operation retrieves a list of routes the virtual network gateway has + /// learned, including routes learned from BGP peers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetLearnedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetLearnedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer. + /// + public static GatewayRouteListResult BeginGetAdvertisedRoutes(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).GetAwaiter().GetResult(); + } + + /// + /// This operation retrieves a list of routes the virtual network gateway is + /// advertising to the specified peer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The IP address of the peer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetAdvertisedRoutesAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string peer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetAdvertisedRoutesWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, peer, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VpnClientIPsecParameters BeginSetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginSetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + public static VpnClientIPsecParameters BeginGetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string BeginStartPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters)) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Starts packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters = default(VpnPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Stops packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static string BeginStopPacketCapture(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Stops packet capture on virtual network gateway in the specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopPacketCaptureAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static VpnClientConnectionHealthDetailListResult BeginGetVpnclientConnectionHealth(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return ((IVirtualNetworkGatewaysOperations)operations).BeginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// Get VPN client connection health detail per P2S client connection of the + /// virtual network gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetVpnclientConnectionHealthAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetVpnclientConnectionHealthWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + public static void BeginDisconnectVirtualNetworkGatewayVpnConnections(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request) + { + ((IVirtualNetworkGatewaysOperations)operations).BeginDisconnectVirtualNetworkGatewayVpnConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, request).GetAwaiter().GetResult(); + } + + /// + /// Disconnect vpn connections of virtual network gateway in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDisconnectVirtualNetworkGatewayVpnConnectionsAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, P2SVpnConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDisconnectVirtualNetworkGatewayVpnConnectionsWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all virtual network gateways by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) + { + return ((IVirtualNetworkGatewaysOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual network gateways by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all the connections in a virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListConnectionsNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) + { + return ((IVirtualNetworkGatewaysOperations)operations).ListConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the connections in a virtual network gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListConnectionsNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperations.cs index 1f205e9876bf..ce50523ea00d 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkPeeringsOperations operations. /// - internal partial class VirtualNetworkPeeringsOperations : IServiceOperations, IVirtualNetworkPeeringsOperations + internal partial class VirtualNetworkPeeringsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkPeeringsOperations { /// /// Initializes a new instance of the VirtualNetworkPeeringsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualNetworkPeeringsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) + internal VirtualNetworkPeeringsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the virtual network peering. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (virtualNetworkPeeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +187,56 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +246,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -259,25 +260,29 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a peering in the specified virtual network. /// @@ -290,26 +295,25 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The name of the peering. /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// /// /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -327,13 +331,13 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -342,41 +346,52 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -386,25 +401,24 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -416,55 +430,56 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -474,9 +489,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -487,25 +503,29 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified virtual network peering. /// @@ -524,10 +544,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -536,47 +556,59 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (virtualNetworkPeeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -586,25 +618,24 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -616,55 +647,56 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -674,20 +706,25 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a peering in the specified virtual network. /// @@ -700,28 +737,27 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The name of the peering. /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// /// /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -730,57 +766,70 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (virtualNetworkPeeringParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); } - if (virtualNetworkName == null) + if (virtualNetworkPeeringParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + virtualNetworkPeeringParameters.Validate(); } - if (virtualNetworkPeeringName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkPeeringParameters == null) + + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (virtualNetworkPeeringParameters != null) + + if (virtualNetworkPeeringName == null) { - virtualNetworkPeeringParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (Client.SubscriptionId == null) + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); - tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); tracingParameters.Add("syncRemoteAddressSpace", syncRemoteAddressSpace); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (syncRemoteAddressSpace != null) { _queryParameters.Add(string.Format("syncRemoteAddressSpace={0}", System.Uri.EscapeDataString(syncRemoteAddressSpace))); @@ -794,25 +843,24 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -824,61 +872,62 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(virtualNetworkPeeringParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -888,9 +937,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -901,16 +951,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -919,25 +969,29 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all virtual network peerings in a virtual network. /// @@ -950,13 +1004,13 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -965,51 +1019,54 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1021,55 +1078,56 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1079,9 +1137,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1092,24 +1151,28 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index f6a980126589..a7fdf9ee9ec1 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -1,359 +1,323 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworkPeeringsOperations. + /// Extension methods for VirtualNetworkPeeringsOperations /// public static partial class VirtualNetworkPeeringsOperationsExtensions { - /// - /// Deletes the specified virtual network peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the virtual network peering. - /// - public static void Delete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the virtual network peering. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified virtual network peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the virtual network peering. - /// - public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) - { - return operations.GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified virtual network peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the virtual network peering. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a peering in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// - public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified virtual network peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the virtual network peering. + /// + public static void Delete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + { + ((IVirtualNetworkPeeringsOperations)operations).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified virtual network peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the virtual network peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified virtual network peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the virtual network peering. + /// + public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + { + return ((IVirtualNetworkPeeringsOperations)operations).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).GetAwaiter().GetResult(); + } - /// - /// Gets all virtual network peerings in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - public static IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// Gets the specified virtual network peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the virtual network peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a peering in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the peering. + /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// + public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string)) + { + return ((IVirtualNetworkPeeringsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + } - /// - /// Gets all virtual network peerings in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a peering in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the peering. + /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all virtual network peerings in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) + { + return ((IVirtualNetworkPeeringsOperations)operations).ListAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified virtual network peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the virtual network peering. - /// - public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + /// + /// Gets all virtual network peerings in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified virtual network peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the virtual network peering. + /// + public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + { + ((IVirtualNetworkPeeringsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified virtual network peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the virtual network peering. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified virtual network peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the virtual network peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a peering in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the peering. + /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// + public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string)) + { + return ((IVirtualNetworkPeeringsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// - public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string)) + /// + /// Creates or updates a peering in the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the peering. + /// + /// + /// Parameter indicates the intention to sync the peering with the current + /// address space on the remote vNet after it's updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all virtual network peerings in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkPeeringsOperations operations, string nextPageLink) + { + return ((IVirtualNetworkPeeringsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a peering in the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all virtual network peerings in a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualNetworkPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all virtual network peerings in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualNetworkPeeringsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual network peerings in a virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualNetworkPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperations.cs index b4633e47a4c0..239d12aac389 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworkTapsOperations operations. /// - internal partial class VirtualNetworkTapsOperations : IServiceOperations, IVirtualNetworkTapsOperations + internal partial class VirtualNetworkTapsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkTapsOperations { /// /// Initializes a new instance of the VirtualNetworkTapsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualNetworkTapsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualNetworkTapsOperations(NetworkManagementClient client) + internal VirtualNetworkTapsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// The name of the virtual network tap. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, tapName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, tapName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -87,13 +75,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -102,41 +90,52 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string tapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (tapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("tapName", tapName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{tapName}", System.Uri.EscapeDataString(tapName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -146,25 +145,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -176,55 +174,56 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -234,9 +233,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -247,25 +247,29 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Virtual Network Tap. /// @@ -279,16 +283,16 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update virtual network tap operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, tapName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, tapName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -309,13 +313,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -324,46 +328,57 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (tapParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapParameters"); } - if (tapName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (tapParameters == null) + + if (tapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("tapName", tapName); - tracingParameters.Add("tapParameters", tapParameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("tapParameters", tapParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{tapName}", System.Uri.EscapeDataString(tapName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +388,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,61 +417,62 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(tapParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tapParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(tapParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -467,9 +482,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -480,25 +496,29 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the VirtualNetworkTaps in a subscription. /// @@ -508,13 +528,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -523,29 +543,38 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -555,25 +584,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -585,55 +613,56 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -643,9 +672,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -656,25 +686,29 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the VirtualNetworkTaps in a subscription. /// @@ -687,13 +721,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -702,35 +736,45 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -740,25 +784,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -770,55 +813,56 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -828,9 +872,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -841,25 +886,29 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified virtual network tap. /// @@ -875,10 +924,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -887,41 +936,52 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (tapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("tapName", tapName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{tapName}", System.Uri.EscapeDataString(tapName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -931,25 +991,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -961,55 +1020,56 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1019,20 +1079,25 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a Virtual Network Tap. /// @@ -1051,13 +1116,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1066,46 +1131,58 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (tapName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (tapName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tapName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("tapName", tapName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{tapName}", System.Uri.EscapeDataString(tapName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1115,25 +1192,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1145,61 +1221,62 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1209,9 +1286,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1222,16 +1300,16 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1240,25 +1318,29 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the VirtualNetworkTaps in a subscription. /// @@ -1271,13 +1353,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1286,51 +1368,54 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1342,55 +1427,56 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1400,9 +1486,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1413,25 +1500,29 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the VirtualNetworkTaps in a subscription. /// @@ -1444,13 +1535,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1459,51 +1550,54 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1515,55 +1609,56 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1573,9 +1668,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1586,24 +1682,28 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperationsExtensions.cs index 43f185ddb040..6c8636ed7d99 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworkTapsOperationsExtensions.cs @@ -1,407 +1,370 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworkTapsOperations. + /// Extension methods for VirtualNetworkTapsOperations /// public static partial class VirtualNetworkTapsOperationsExtensions { - /// - /// Deletes the specified virtual network tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - public static void Delete(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName) - { - operations.DeleteAsync(resourceGroupName, tapName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, tapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets information about the specified virtual network tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of virtual network tap. - /// - public static VirtualNetworkTap Get(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName) - { - return operations.GetAsync(resourceGroupName, tapName).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified virtual network tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + public static void Delete(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName) + { + ((IVirtualNetworkTapsOperations)operations).DeleteAsync(resourceGroupName, tapName).GetAwaiter().GetResult(); + } - /// - /// Gets information about the specified virtual network tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of virtual network tap. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, tapName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified virtual network tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, tapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets information about the specified virtual network tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of virtual network tap. + /// + public static VirtualNetworkTap Get(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName) + { + return ((IVirtualNetworkTapsOperations)operations).GetAsync(resourceGroupName, tapName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Virtual Network Tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - /// - /// Parameters supplied to the create or update virtual network tap operation. - /// - public static VirtualNetworkTap CreateOrUpdate(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters) + /// + /// Gets information about the specified virtual network tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of virtual network tap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, tapName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, tapName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates a Virtual Network Tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + public static VirtualNetworkTap CreateOrUpdate(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters) + { + return ((IVirtualNetworkTapsOperations)operations).CreateOrUpdateAsync(resourceGroupName, tapName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a Virtual Network Tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - /// - /// Parameters supplied to the create or update virtual network tap operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a Virtual Network Tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, tapName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, tapName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates an VirtualNetworkTap tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the tap. + /// + public static VirtualNetworkTap UpdateTags(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, TagsObject tapParameters) + { + return ((IVirtualNetworkTapsOperations)operations).UpdateTagsAsync(resourceGroupName, tapName, tapParameters).GetAwaiter().GetResult(); + } - /// - /// Updates an VirtualNetworkTap tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the tap. - /// - /// - /// Parameters supplied to update VirtualNetworkTap tags. - /// - public static VirtualNetworkTap UpdateTags(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, TagsObject tapParameters) + /// + /// Updates an VirtualNetworkTap tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the tap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, TagsObject tapParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, tapName, tapParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, tapName, tapParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualNetworkTapsOperations operations) + { + return ((IVirtualNetworkTapsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Updates an VirtualNetworkTap tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the tap. - /// - /// - /// Parameters supplied to update VirtualNetworkTap tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, TagsObject tapParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IVirtualNetworkTapsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, tapName, tapParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVirtualNetworkTapsOperations operations, string resourceGroupName) + { + return ((IVirtualNetworkTapsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IVirtualNetworkTapsOperations operations) + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified virtual network tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + public static void BeginDelete(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName) + { + ((IVirtualNetworkTapsOperations)operations).BeginDeleteAsync(resourceGroupName, tapName).GetAwaiter().GetResult(); + } - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IVirtualNetworkTapsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified virtual network tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, tapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a Virtual Network Tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + public static VirtualNetworkTap BeginCreateOrUpdate(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters) + { + return ((IVirtualNetworkTapsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, tapName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IVirtualNetworkTapsOperations operations, string resourceGroupName) + /// + /// Creates or updates a Virtual Network Tap. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network tap. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, tapName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtualNetworkTapsOperations operations, string nextPageLink) + { + return ((IVirtualNetworkTapsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IVirtualNetworkTapsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVirtualNetworkTapsOperations operations, string nextPageLink) + { + return ((IVirtualNetworkTapsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified virtual network tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - public static void BeginDelete(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName) + /// + /// Gets all the VirtualNetworkTaps in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVirtualNetworkTapsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, tapName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified virtual network tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, tapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a Virtual Network Tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - /// - /// Parameters supplied to the create or update virtual network tap operation. - /// - public static VirtualNetworkTap BeginCreateOrUpdate(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, tapName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Virtual Network Tap. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network tap. - /// - /// - /// Parameters supplied to the create or update virtual network tap operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, VirtualNetworkTap parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, tapName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IVirtualNetworkTapsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IVirtualNetworkTapsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVirtualNetworkTapsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVirtualNetworkTapsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperations.cs index 10ae03bbfb5c..b215f8b490c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworksOperations operations. /// - internal partial class VirtualNetworksOperations : IServiceOperations, IVirtualNetworksOperations + internal partial class VirtualNetworksOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworksOperations { /// /// Initializes a new instance of the VirtualNetworksOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualNetworksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualNetworksOperations(NetworkManagementClient client) + internal VirtualNetworksOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +183,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +242,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +256,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a virtual network in the specified resource group. /// @@ -287,16 +292,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// Parameters supplied to the create or update virtual network operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,46 +337,57 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -381,25 +397,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -411,61 +426,62 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -475,9 +491,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -488,25 +505,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all virtual networks in a subscription. /// @@ -516,13 +537,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -531,29 +552,38 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +593,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +622,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +681,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +695,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all virtual networks in a resource group. /// @@ -695,13 +730,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -710,35 +745,45 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -748,25 +793,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -778,55 +822,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -836,9 +881,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -849,25 +895,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Checks whether a private IP address is available for use. /// @@ -886,13 +936,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -901,46 +951,58 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (ipAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ipAddress"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("ipAddress", ipAddress); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (ipAddress != null) { _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); @@ -954,25 +1016,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -984,55 +1045,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1042,9 +1104,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1055,25 +1118,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists usage stats. /// @@ -1089,13 +1156,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1104,41 +1171,52 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListUsageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsage", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1148,25 +1226,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1178,55 +1255,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1236,9 +1314,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1249,28 +1328,31 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual Network /// /// /// The name of the resource group. @@ -1285,16 +1367,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// The skipToken that is given with nextLink. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> ListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginListDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, top, skipToken, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse> _response = await BeginListDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, top, skipToken, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1312,10 +1394,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1324,41 +1406,52 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1368,25 +1461,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1398,55 +1490,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1456,20 +1549,25 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a virtual network in the specified resource group. /// @@ -1488,13 +1586,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1503,50 +1601,61 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualNetworkName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (virtualNetworkName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1556,25 +1665,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1586,61 +1694,62 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1650,9 +1759,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1663,16 +1773,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1681,25 +1791,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the Ddos Protection Status of all IP Addresses under the Virtual /// Network @@ -1722,13 +1836,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1737,46 +1851,59 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> BeginListDdosProtectionStatusWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (Client.SubscriptionId == null) + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("top", top); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListDdosProtectionStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListDdosProtectionStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (top != null) { - _queryParameters.Add(string.Format("top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (skipToken != null) { @@ -1791,25 +1918,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1821,55 +1947,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1879,9 +2006,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1892,25 +2020,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all virtual networks in a subscription. /// @@ -1923,13 +2055,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1938,51 +2070,54 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1994,55 +2129,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2052,9 +2188,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2065,25 +2202,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all virtual networks in a resource group. /// @@ -2096,13 +2237,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2111,51 +2252,54 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2167,55 +2311,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2225,9 +2370,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2238,25 +2384,29 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists usage stats. /// @@ -2269,13 +2419,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2284,51 +2434,54 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsageNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListUsageNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsageNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsageNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2340,55 +2493,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2398,9 +2552,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2411,43 +2566,46 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual Network /// /// /// The NextLink from the previous successful call to List operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> ListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginListDdosProtectionStatusNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse> _response = await BeginListDdosProtectionStatusNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2463,13 +2621,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2478,51 +2636,54 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> BeginListDdosProtectionStatusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListDdosProtectionStatusNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListDdosProtectionStatusNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2534,55 +2695,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2592,9 +2754,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2605,24 +2768,28 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs index 5f833210db8a..ab173c579a14 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs @@ -1,713 +1,669 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworksOperations. + /// Extension methods for VirtualNetworksOperations /// public static partial class VirtualNetworksOperationsExtensions { - /// - /// Deletes the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - public static void Delete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified virtual network by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Expands referenced resources. - /// - public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, virtualNetworkName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified virtual network by resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a virtual network in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a virtual network in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a virtual network tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to update virtual network tags. - /// - public static VirtualNetwork UpdateTags(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, TagsObject parameters) - { - return operations.UpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual network tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to update virtual network tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all virtual networks in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IVirtualNetworksOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual networks in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all virtual networks in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual networks in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Checks whether a private IP address is available for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The private IP address to be verified. - /// - public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress) - { - return operations.CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress).GetAwaiter().GetResult(); - } - - /// - /// Checks whether a private IP address is available for use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The private IP address to be verified. - /// - /// - /// The cancellation token. - /// - public static async Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists usage stats. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - public static IPage ListUsage(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) - { - return operations.ListUsageAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); - } - - /// - /// Lists usage stats. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task> ListUsageAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListUsageWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The max number of ip addresses to return. - /// - /// - /// The skipToken that is given with nextLink. - /// - public static IPage ListDdosProtectionStatus(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListDdosProtectionStatusAsync(resourceGroupName, virtualNetworkName, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The max number of ip addresses to return. - /// - /// - /// The skipToken that is given with nextLink. - /// - /// - /// The cancellation token. - /// - public static async Task> ListDdosProtectionStatusAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a virtual network in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a virtual network in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The max number of ip addresses to return. - /// - /// - /// The skipToken that is given with nextLink. - /// - public static IPage BeginListDdosProtectionStatus(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string)) - { - return operations.BeginListDdosProtectionStatusAsync(resourceGroupName, virtualNetworkName, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The max number of ip addresses to return. - /// - /// - /// The skipToken that is given with nextLink. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginListDdosProtectionStatusAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all virtual networks in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IVirtualNetworksOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual networks in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all virtual networks in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all virtual networks in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists usage stats. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListUsageNext(this IVirtualNetworksOperations operations, string nextPageLink) - { - return operations.ListUsageNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists usage stats. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListUsageNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListUsageNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListDdosProtectionStatusNext(this IVirtualNetworksOperations operations, string nextPageLink) - { - return operations.ListDdosProtectionStatusNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListDdosProtectionStatusNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListDdosProtectionStatusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage BeginListDdosProtectionStatusNext(this IVirtualNetworksOperations operations, string nextPageLink) - { - return operations.BeginListDdosProtectionStatusNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the Ddos Protection Status of all IP Addresses under the Virtual - /// Network - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginListDdosProtectionStatusNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListDdosProtectionStatusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Deletes the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static void Delete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) + { + ((IVirtualNetworksOperations)operations).DeleteAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified virtual network by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Expands referenced resources. + /// + public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string)) + { + return ((IVirtualNetworksOperations)operations).GetAsync(resourceGroupName, virtualNetworkName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified virtual network by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a virtual network in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) + { + return ((IVirtualNetworksOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a virtual network in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a virtual network tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static VirtualNetwork UpdateTags(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, TagsObject parameters) + { + return ((IVirtualNetworksOperations)operations).UpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual network tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, TagsObject parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all virtual networks in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualNetworksOperations operations) + { + return ((IVirtualNetworksOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual networks in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IVirtualNetworksOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all virtual networks in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) + { + return ((IVirtualNetworksOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual networks in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Checks whether a private IP address is available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// + public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress) + { + return ((IVirtualNetworksOperations)operations).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress).GetAwaiter().GetResult(); + } + + /// + /// Checks whether a private IP address is available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists usage stats. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static Microsoft.Rest.Azure.IPage ListUsage(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) + { + return ((IVirtualNetworksOperations)operations).ListUsageAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } + + /// + /// Lists usage stats. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListUsageAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListUsageWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The max number of ip addresses to return. + /// + /// + /// The skipToken that is given with nextLink. + /// + public static Microsoft.Rest.Azure.IPage ListDdosProtectionStatus(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string)) + { + return ((IVirtualNetworksOperations)operations).ListDdosProtectionStatusAsync(resourceGroupName, virtualNetworkName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The max number of ip addresses to return. + /// + /// + /// The skipToken that is given with nextLink. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListDdosProtectionStatusAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) + { + ((IVirtualNetworksOperations)operations).BeginDeleteAsync(resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a virtual network in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) + { + return ((IVirtualNetworksOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a virtual network in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The max number of ip addresses to return. + /// + /// + /// The skipToken that is given with nextLink. + /// + public static Microsoft.Rest.Azure.IPage BeginListDdosProtectionStatus(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string)) + { + return ((IVirtualNetworksOperations)operations).BeginListDdosProtectionStatusAsync(resourceGroupName, virtualNetworkName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The max number of ip addresses to return. + /// + /// + /// The skipToken that is given with nextLink. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> BeginListDdosProtectionStatusAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, int? top = default(int?), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListDdosProtectionStatusWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all virtual networks in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtualNetworksOperations operations, string nextPageLink) + { + return ((IVirtualNetworksOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual networks in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets all virtual networks in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) + { + return ((IVirtualNetworksOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual networks in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists usage stats. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListUsageNext(this IVirtualNetworksOperations operations, string nextPageLink) + { + return ((IVirtualNetworksOperations)operations).ListUsageNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists usage stats. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListUsageNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListUsageNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListDdosProtectionStatusNext(this IVirtualNetworksOperations operations, string nextPageLink) + { + return ((IVirtualNetworksOperations)operations).ListDdosProtectionStatusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListDdosProtectionStatusNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListDdosProtectionStatusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage BeginListDdosProtectionStatusNext(this IVirtualNetworksOperations operations, string nextPageLink) + { + return ((IVirtualNetworksOperations)operations).BeginListDdosProtectionStatusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the Ddos Protection Status of all IP Addresses under the Virtual + /// Network + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> BeginListDdosProtectionStatusNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListDdosProtectionStatusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperations.cs index 35796fac138e..eb92b9f6f8f8 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualRouterPeeringsOperations operations. /// - internal partial class VirtualRouterPeeringsOperations : IServiceOperations, IVirtualRouterPeeringsOperations + internal partial class VirtualRouterPeeringsOperations : Microsoft.Rest.IServiceOperations, IVirtualRouterPeeringsOperations { /// /// Initializes a new instance of the VirtualRouterPeeringsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualRouterPeeringsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualRouterPeeringsOperations(NetworkManagementClient client) + internal VirtualRouterPeeringsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// The name of the peering. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,47 +96,59 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualRouterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -158,25 +158,24 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,50 +187,51 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -241,9 +241,10 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -254,25 +255,29 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Virtual Router Peering. /// @@ -290,16 +295,16 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -317,13 +322,13 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -332,41 +337,52 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualRouterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -376,25 +392,24 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -406,50 +421,51 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -459,9 +475,10 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -472,25 +489,29 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified peering from a Virtual Router. /// @@ -509,10 +530,10 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -521,47 +542,59 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualRouterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -571,25 +604,24 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -601,50 +633,51 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -654,20 +687,25 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Virtual Router Peering. /// @@ -690,13 +728,13 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -705,56 +743,68 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualRouterName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + parameters.Validate(); } - if (peeringName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + + if (virtualRouterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } - if (parameters != null) + + if (peeringName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -764,25 +814,24 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -794,56 +843,57 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -853,9 +903,10 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -866,16 +917,16 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -884,25 +935,29 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Virtual Router Peerings in a Virtual Router resource. /// @@ -915,13 +970,13 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -930,51 +985,54 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -986,50 +1044,51 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1039,9 +1098,10 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1052,24 +1112,28 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperationsExtensions.cs index e96ba96bcdfa..d870e7f08b74 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualRouterPeeringsOperationsExtensions.cs @@ -1,339 +1,307 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualRouterPeeringsOperations. + /// Extension methods for VirtualRouterPeeringsOperations /// public static partial class VirtualRouterPeeringsOperationsExtensions { - /// - /// Deletes the specified peering from a Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the peering. - /// - public static void Delete(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName) - { - operations.DeleteAsync(resourceGroupName, virtualRouterName, peeringName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified peering from a Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering. - /// - public static VirtualRouterPeering Get(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName) - { - return operations.GetAsync(resourceGroupName, virtualRouterName, peeringName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering. - /// - /// - /// Parameters supplied to the create or update Virtual Router Peering - /// operation. - /// - public static VirtualRouterPeering CreateOrUpdate(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified peering from a Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the peering. + /// + public static void Delete(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName) + { + ((IVirtualRouterPeeringsOperations)operations).DeleteAsync(resourceGroupName, virtualRouterName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering. - /// - /// - /// Parameters supplied to the create or update Virtual Router Peering - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified peering from a Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Virtual Router Peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the Virtual Router Peering. + /// + public static VirtualRouterPeering Get(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName) + { + return ((IVirtualRouterPeeringsOperations)operations).GetAsync(resourceGroupName, virtualRouterName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Lists all Virtual Router Peerings in a Virtual Router resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - public static IPage List(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName) + /// + /// Gets the specified Virtual Router Peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the Virtual Router Peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, virtualRouterName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified Virtual Router Peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the Virtual Router Peering. + /// + public static VirtualRouterPeering CreateOrUpdate(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters) + { + return ((IVirtualRouterPeeringsOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all Virtual Router Peerings in a Virtual Router resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Virtual Router Peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the Virtual Router Peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualRouterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Virtual Router Peerings in a Virtual Router resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName) + { + return ((IVirtualRouterPeeringsOperations)operations).ListAsync(resourceGroupName, virtualRouterName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified peering from a Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the peering. - /// - public static void BeginDelete(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName) + /// + /// Lists all Virtual Router Peerings in a Virtual Router resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualRouterName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, virtualRouterName, peeringName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes the specified peering from a Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the peering. + /// + public static void BeginDelete(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName) + { + ((IVirtualRouterPeeringsOperations)operations).BeginDeleteAsync(resourceGroupName, virtualRouterName, peeringName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified peering from a Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the peering. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified peering from a Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Virtual Router Peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the Virtual Router Peering. + /// + public static VirtualRouterPeering BeginCreateOrUpdate(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters) + { + return ((IVirtualRouterPeeringsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering. - /// - /// - /// Parameters supplied to the create or update Virtual Router Peering - /// operation. - /// - public static VirtualRouterPeering BeginCreateOrUpdate(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters) + /// + /// Creates or updates the specified Virtual Router Peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The name of the Virtual Router Peering. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all Virtual Router Peerings in a Virtual Router resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualRouterPeeringsOperations operations, string nextPageLink) + { + return ((IVirtualRouterPeeringsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering. - /// - /// - /// Parameters supplied to the create or update Virtual Router Peering - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all Virtual Router Peerings in a Virtual Router resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualRouterPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all Virtual Router Peerings in a Virtual Router resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualRouterPeeringsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all Virtual Router Peerings in a Virtual Router resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualRouterPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperations.cs index 4eeaf84c11c6..eeac7379680e 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualRoutersOperations operations. /// - internal partial class VirtualRoutersOperations : IServiceOperations, IVirtualRoutersOperations + internal partial class VirtualRoutersOperations : Microsoft.Rest.IServiceOperations, IVirtualRoutersOperations { /// /// Initializes a new instance of the VirtualRoutersOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualRoutersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualRoutersOperations(NetworkManagementClient client) + internal VirtualRoutersOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,16 +48,16 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// The name of the Virtual Router. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -90,13 +78,13 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -105,42 +93,54 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualRouterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +154,24 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,50 +183,51 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -237,9 +237,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -250,25 +251,29 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Virtual Router. /// @@ -282,16 +287,16 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// Parameters supplied to the create or update Virtual Router. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -306,13 +311,13 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -321,35 +326,45 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -359,25 +374,24 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -389,50 +403,51 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -442,9 +457,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -455,25 +471,29 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Virtual Routers in a subscription. /// @@ -483,13 +503,13 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -498,29 +518,38 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -530,25 +559,24 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -560,50 +588,51 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -613,9 +642,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -626,25 +656,29 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Virtual Router. /// @@ -660,10 +694,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -672,41 +706,52 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualRouterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -716,25 +761,24 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -746,50 +790,51 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -799,20 +844,25 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates the specified Virtual Router. /// @@ -831,13 +881,13 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -846,50 +896,61 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, VirtualRouter parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (resourceGroupName == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (virtualRouterName == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); + parameters.Validate(); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + + if (virtualRouterName == null) { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualRouterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualRouterName", virtualRouterName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -899,25 +960,24 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -929,56 +989,57 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -988,9 +1049,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1001,16 +1063,16 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1019,25 +1081,29 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all Virtual Routers in a resource group. /// @@ -1050,13 +1116,13 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1065,51 +1131,54 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1121,50 +1190,51 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1174,9 +1244,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1187,25 +1258,29 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Virtual Routers in a subscription. /// @@ -1218,13 +1293,13 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1233,51 +1308,54 @@ internal VirtualRoutersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1289,50 +1367,51 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1342,9 +1421,10 @@ internal VirtualRoutersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1355,24 +1435,28 @@ internal VirtualRoutersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperationsExtensions.cs index cea3a1ff44f9..734786872af8 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualRoutersOperationsExtensions.cs @@ -1,367 +1,337 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualRoutersOperations. + /// Extension methods for VirtualRoutersOperations /// public static partial class VirtualRoutersOperationsExtensions { - /// - /// Deletes the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - public static void Delete(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName) - { - operations.DeleteAsync(resourceGroupName, virtualRouterName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// Expands referenced resources. - /// - public static VirtualRouter Get(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, virtualRouterName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// Expands referenced resources. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualRouterName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// Parameters supplied to the create or update Virtual Router. - /// - public static VirtualRouter CreateOrUpdate(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// Parameters supplied to the create or update Virtual Router. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all Virtual Routers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IVirtualRoutersOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all Virtual Routers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVirtualRoutersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + public static void Delete(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName) + { + ((IVirtualRoutersOperations)operations).DeleteAsync(resourceGroupName, virtualRouterName).GetAwaiter().GetResult(); + } - /// - /// Gets all the Virtual Routers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVirtualRoutersOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets all the Virtual Routers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualRoutersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// Expands referenced resources. + /// + public static VirtualRouter Get(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, string expand = default(string)) + { + return ((IVirtualRoutersOperations)operations).GetAsync(resourceGroupName, virtualRouterName, expand).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - public static void BeginDelete(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName) + /// + /// Gets the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualRouterName, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, virtualRouterName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates or updates the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + public static VirtualRouter CreateOrUpdate(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters) + { + return ((IVirtualRoutersOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all Virtual Routers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVirtualRoutersOperations operations, string resourceGroupName) + { + return ((IVirtualRoutersOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// Parameters supplied to the create or update Virtual Router. - /// - public static VirtualRouter BeginCreateOrUpdate(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters) + /// + /// Lists all Virtual Routers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVirtualRoutersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the Virtual Routers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualRoutersOperations operations) + { + return ((IVirtualRoutersOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Creates or updates the specified Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// Parameters supplied to the create or update Virtual Router. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the Virtual Routers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualRoutersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + public static void BeginDelete(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName) + { + ((IVirtualRoutersOperations)operations).BeginDeleteAsync(resourceGroupName, virtualRouterName).GetAwaiter().GetResult(); + } - /// - /// Lists all Virtual Routers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVirtualRoutersOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualRouterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + public static VirtualRouter BeginCreateOrUpdate(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters) + { + return ((IVirtualRoutersOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Lists all Virtual Routers in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVirtualRoutersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates the specified Virtual Router. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Virtual Router. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, VirtualRouter parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all Virtual Routers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVirtualRoutersOperations operations, string nextPageLink) + { + return ((IVirtualRoutersOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the Virtual Routers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualRoutersOperations operations, string nextPageLink) + /// + /// Lists all Virtual Routers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVirtualRoutersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the Virtual Routers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualRoutersOperations operations, string nextPageLink) + { + return ((IVirtualRoutersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the Virtual Routers in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualRoutersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the Virtual Routers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualRoutersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualWansOperations.cs b/src/Network/Network.Management.Sdk/Generated/VirtualWansOperations.cs index b670c4ea4053..653ca08a9ea4 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualWansOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualWansOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualWansOperations operations. /// - internal partial class VirtualWansOperations : IServiceOperations, IVirtualWansOperations + internal partial class VirtualWansOperations : Microsoft.Rest.IServiceOperations, IVirtualWansOperations { /// /// Initializes a new instance of the VirtualWansOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualWansOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualWansOperations(NetworkManagementClient client) + internal VirtualWansOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{VirtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal VirtualWansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,28 +225,31 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing - /// VirtualWAN. + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. /// /// /// The resource group name of the VirtualWan. @@ -254,20 +257,20 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The name of the VirtualWAN being created or updated. /// - /// + /// /// Parameters supplied to create or update VirtualWAN. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN WANParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualWANName, wANParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualWANName, WANParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -279,7 +282,7 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The name of the VirtualWAN being updated. /// - /// + /// /// Parameters supplied to Update VirtualWAN tags. /// /// @@ -288,13 +291,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -303,46 +306,57 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject WANParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (WANParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "WANParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualWANName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (wANParameters == null) + + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("wANParameters", wANParameters); + + tracingParameters.Add("WANParameters", WANParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{VirtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -352,25 +366,24 @@ internal VirtualWansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -382,61 +395,62 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; - if(wANParameters != null) + if(WANParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(wANParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(WANParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -446,9 +460,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -459,25 +474,29 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualWAN. /// @@ -488,16 +507,16 @@ internal VirtualWansOperations(NetworkManagementClient client) /// The name of the VirtualWAN being deleted. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -512,13 +531,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -527,35 +546,45 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +594,24 @@ internal VirtualWansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +623,56 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +682,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +696,29 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VirtualWANs in a subscription. /// @@ -694,13 +728,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -709,29 +743,38 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +784,24 @@ internal VirtualWansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,55 +813,56 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,9 +872,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -842,27 +886,31 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing /// VirtualWAN. /// /// @@ -871,7 +919,7 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The name of the VirtualWAN being created or updated. /// - /// + /// /// Parameters supplied to create or update VirtualWAN. /// /// @@ -880,13 +928,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,46 +943,58 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN WANParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (WANParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "WANParameters"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (virtualWANName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (wANParameters == null) + + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("wANParameters", wANParameters); + + tracingParameters.Add("WANParameters", WANParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{VirtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -944,25 +1004,24 @@ internal VirtualWansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -974,61 +1033,62 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; - if(wANParameters != null) + if(WANParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(wANParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(WANParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1038,9 +1098,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1051,16 +1112,16 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1069,25 +1130,29 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VirtualWAN. /// @@ -1103,10 +1168,10 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1115,41 +1180,52 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{VirtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1159,25 +1235,24 @@ internal VirtualWansOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1189,55 +1264,56 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1247,20 +1323,25 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VirtualWANs in a resource group. /// @@ -1273,13 +1354,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1288,51 +1369,54 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1344,55 +1428,56 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1402,9 +1487,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1415,25 +1501,29 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VirtualWANs in a subscription. /// @@ -1446,13 +1536,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1461,51 +1551,54 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1517,55 +1610,56 @@ internal VirtualWansOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1575,9 +1669,10 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1588,24 +1683,28 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VirtualWansOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VirtualWansOperationsExtensions.cs index b4c15464c9c9..3f2781e70f66 100644 --- a/src/Network/Network.Management.Sdk/Generated/VirtualWansOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VirtualWansOperationsExtensions.cs @@ -1,411 +1,374 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualWansOperations. + /// Extension methods for VirtualWansOperations /// public static partial class VirtualWansOperationsExtensions { - /// - /// Retrieves the details of a VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being retrieved. - /// - public static VirtualWAN Get(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName) - { - return operations.GetAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing - /// VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being created or updated. - /// - /// - /// Parameters supplied to create or update VirtualWAN. - /// - public static VirtualWAN CreateOrUpdate(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN wANParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualWANName, wANParameters).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being retrieved. + /// + public static VirtualWAN Get(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName) + { + return ((IVirtualWansOperations)operations).GetAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing - /// VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being created or updated. - /// - /// - /// Parameters supplied to create or update VirtualWAN. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualWANName, wANParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being created or updated. + /// + public static VirtualWAN CreateOrUpdate(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN WANParameters) + { + return ((IVirtualWansOperations)operations).CreateOrUpdateAsync(resourceGroupName, virtualWANName, WANParameters).GetAwaiter().GetResult(); + } - /// - /// Updates a VirtualWAN tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being updated. - /// - /// - /// Parameters supplied to Update VirtualWAN tags. - /// - public static VirtualWAN UpdateTags(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, TagsObject wANParameters) + /// + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being created or updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN WANParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualWANName, WANParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, virtualWANName, wANParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates a VirtualWAN tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being updated. + /// + public static VirtualWAN UpdateTags(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, TagsObject WANParameters) + { + return ((IVirtualWansOperations)operations).UpdateTagsAsync(resourceGroupName, virtualWANName, WANParameters).GetAwaiter().GetResult(); + } - /// - /// Updates a VirtualWAN tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being updated. - /// - /// - /// Parameters supplied to Update VirtualWAN tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, TagsObject wANParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates a VirtualWAN tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, TagsObject WANParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualWANName, WANParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualWANName, wANParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being deleted. + /// + public static void Delete(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName) + { + ((IVirtualWansOperations)operations).DeleteAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being deleted. - /// - public static void Delete(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName) - { - operations.DeleteAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); - } + /// + /// Deletes a VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the VirtualWANs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVirtualWansOperations operations, string resourceGroupName) + { + return ((IVirtualWansOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being deleted. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the VirtualWANs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVirtualWansOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all the VirtualWANs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualWansOperations operations) + { + return ((IVirtualWansOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all the VirtualWANs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - public static IPage ListByResourceGroup(this IVirtualWansOperations operations, string resourceGroupName) + /// + /// Lists all the VirtualWANs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualWansOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being created or updated. + /// + public static VirtualWAN BeginCreateOrUpdate(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN WANParameters) + { + return ((IVirtualWansOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, virtualWANName, WANParameters).GetAwaiter().GetResult(); + } - /// - /// Lists all the VirtualWANs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVirtualWansOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being created or updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN WANParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualWANName, WANParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being deleted. + /// + public static void BeginDelete(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName) + { + ((IVirtualWansOperations)operations).BeginDeleteAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + } - /// - /// Lists all the VirtualWANs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVirtualWansOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Deletes a VirtualWAN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the VirtualWANs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVirtualWansOperations operations, string nextPageLink) + { + return ((IVirtualWansOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the VirtualWANs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualWansOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the VirtualWANs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVirtualWansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all the VirtualWANs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualWansOperations operations, string nextPageLink) + { + return ((IVirtualWansOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing - /// VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being created or updated. - /// - /// - /// Parameters supplied to create or update VirtualWAN. - /// - public static VirtualWAN BeginCreateOrUpdate(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN wANParameters) + /// + /// Lists all the VirtualWANs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualWansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualWANName, wANParameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing - /// VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being created or updated. - /// - /// - /// Parameters supplied to create or update VirtualWAN. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualWANName, wANParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being deleted. - /// - public static void BeginDelete(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VirtualWAN. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being deleted. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the VirtualWANs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVirtualWansOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VirtualWANs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVirtualWansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VirtualWANs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualWansOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VirtualWANs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualWansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperations.cs index 97885f9d0fd2..5de5c4efbb7a 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnConnectionsOperations operations. /// - internal partial class VpnConnectionsOperations : IServiceOperations, IVpnConnectionsOperations + internal partial class VpnConnectionsOperations : Microsoft.Rest.IServiceOperations, IVpnConnectionsOperations { /// /// Initializes a new instance of the VpnConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class VpnConnectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnConnectionsOperations(NetworkManagementClient client) + internal VpnConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,28 +235,31 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - /// updates the existing connection. + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. /// /// /// The resource group name of the VpnGateway. @@ -270,16 +274,16 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// Parameters supplied to create or Update a VPN Connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -295,16 +299,16 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// The name of the connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -324,16 +328,16 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// on gateway connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -353,16 +357,16 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// gateway connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -380,13 +384,13 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -395,41 +399,52 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnGatewayWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGateway", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGateway", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -439,25 +454,24 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -469,55 +483,56 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -527,9 +542,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -540,27 +556,31 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else /// updates the existing connection. /// /// @@ -581,13 +601,13 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -596,52 +616,65 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnConnectionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnConnectionParameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); - } - if (vpnConnectionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnConnectionParameters", vpnConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -651,25 +684,24 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -681,61 +713,62 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnConnectionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnConnectionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -745,9 +778,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -758,16 +792,16 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -776,25 +810,29 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a vpn connection. /// @@ -813,10 +851,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -825,47 +863,59 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -875,25 +925,24 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -905,55 +954,56 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -963,20 +1013,25 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts packet capture on Vpn connection in the specified resource group. /// @@ -999,13 +1054,13 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1014,48 +1069,61 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (vpnConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("vpnConnectionName", vpnConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{vpnConnectionName}", System.Uri.EscapeDataString(vpnConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1065,25 +1133,24 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1095,61 +1162,62 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1159,9 +1227,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1172,25 +1241,29 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops packet capture on Vpn connection in the specified resource group. /// @@ -1213,13 +1286,13 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1228,48 +1301,61 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (vpnConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnConnectionName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("vpnConnectionName", vpnConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{vpnConnectionName}", System.Uri.EscapeDataString(vpnConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1279,25 +1365,24 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1309,61 +1394,62 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1373,9 +1459,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1386,25 +1473,29 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all vpn connections for a particular virtual wan vpn gateway. /// @@ -1417,13 +1508,13 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1432,51 +1523,54 @@ internal VpnConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnGatewayNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGatewayNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnGatewayNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1488,55 +1582,56 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1546,9 +1641,10 @@ internal VpnConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1559,24 +1655,28 @@ internal VpnConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperationsExtensions.cs index 8a4715dbd427..1a59e9dc988f 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnConnectionsOperationsExtensions.cs @@ -1,555 +1,491 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnConnectionsOperations. + /// Extension methods for VpnConnectionsOperations /// public static partial class VpnConnectionsOperationsExtensions { - /// - /// Retrieves the details of a vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - public static VpnConnection Get(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) - { - return operations.GetAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - /// updates the existing connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters supplied to create or Update a VPN Connection. - /// - public static VpnConnection CreateOrUpdate(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - /// updates the existing connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters supplied to create or Update a VPN Connection. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - public static void Delete(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) - { - operations.DeleteAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Starts packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to start packet capture - /// on gateway connection. - /// - public static string StartPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters)) - { - return operations.StartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to start packet capture - /// on gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task StartPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Retrieves the details of a vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + public static VpnConnection Get(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) + { + return ((IVpnConnectionsOperations)operations).GetAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Stops packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to stop packet capture on - /// gateway connection. - /// - public static string StopPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters)) + /// + /// Retrieves the details of a vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.StopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + public static VpnConnection CreateOrUpdate(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters) + { + return ((IVpnConnectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Stops packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to stop packet capture on - /// gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task StopPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + public static void Delete(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) + { + ((IVpnConnectionsOperations)operations).DeleteAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all vpn connections for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - public static IPage ListByVpnGateway(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName) - { - return operations.ListByVpnGatewayAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } + /// + /// Deletes a vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + public static string StartPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters)) + { + return ((IVpnConnectionsOperations)operations).StartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Retrieves all vpn connections for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnGatewayAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Starts packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByVpnGatewayWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Stops packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + public static string StopPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters)) + { + return ((IVpnConnectionsOperations)operations).StopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - /// updates the existing connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters supplied to create or Update a VPN Connection. - /// - public static VpnConnection BeginCreateOrUpdate(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters) + /// + /// Stops packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnGateway(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName) + { + return ((IVpnConnectionsOperations)operations).ListByVpnGatewayAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } - /// - /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - /// updates the existing connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - /// - /// Parameters supplied to create or Update a VPN Connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnGatewayAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnGatewayWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + public static VpnConnection BeginCreateOrUpdate(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters) + { + return ((IVpnConnectionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - public static void BeginDelete(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) + /// + /// Creates a vpn connection to a scalable vpn gateway if it doesn't exist else + /// updates the existing connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, VpnConnection vpnConnectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + public static void BeginDelete(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) + { + ((IVpnConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Deletes a vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes a vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + public static string BeginStartPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters)) + { + return ((IVpnConnectionsOperations)operations).BeginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Starts packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to start packet capture - /// on gateway connection. - /// - public static string BeginStartPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters)) + /// + /// Starts packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Stops packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + public static string BeginStopPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters)) + { + return ((IVpnConnectionsOperations)operations).BeginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// Starts packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to start packet capture - /// on gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters = default(VpnConnectionPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Stops packet capture on Vpn connection in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnGatewayNext(this IVpnConnectionsOperations operations, string nextPageLink) + { + return ((IVpnConnectionsOperations)operations).ListByVpnGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Stops packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to stop packet capture on - /// gateway connection. - /// - public static string BeginStopPacketCapture(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters)) + /// + /// Retrieves all vpn connections for a particular virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnGatewayNextAsync(this IVpnConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Stops packet capture on Vpn connection in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// Vpn Connection packet capture parameters supplied to stop packet capture on - /// gateway connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopPacketCaptureAsync(this IVpnConnectionsOperations operations, string resourceGroupName, string gatewayName, string vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters = default(VpnConnectionPacketCaptureStopParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves all vpn connections for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVpnGatewayNext(this IVpnConnectionsOperations operations, string nextPageLink) - { - return operations.ListByVpnGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all vpn connections for a particular virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnGatewayNextAsync(this IVpnConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperations.cs index 21237a385067..d66b3f4142da 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnGatewaysOperations operations. /// - internal partial class VpnGatewaysOperations : IServiceOperations, IVpnGatewaysOperations + internal partial class VpnGatewaysOperations : Microsoft.Rest.IServiceOperations, IVpnGatewaysOperations { /// /// Initializes a new instance of the VpnGatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class VpnGatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnGatewaysOperations(NetworkManagementClient client) + internal VpnGatewaysOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,28 +225,31 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the - /// existing gateway. + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. /// /// /// The resource group name of the VpnGateway. @@ -258,16 +261,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to create or Update a virtual wan vpn gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -283,16 +286,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update a virtual wan vpn gateway tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -305,16 +308,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// The name of the gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -330,16 +333,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// VpnGateway ipConfigurationId to specify the gateway instance. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, ipConfigurationId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, ipConfigurationId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -356,16 +359,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// vpn gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -382,16 +385,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// vpn gateway. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> StopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -406,13 +409,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -421,35 +424,45 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -459,25 +472,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -489,55 +501,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -547,9 +560,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -560,25 +574,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnGateways in a subscription. /// @@ -588,13 +606,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -603,29 +621,38 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -635,25 +662,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -665,55 +691,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -723,9 +750,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -736,27 +764,31 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the /// existing gateway. /// /// @@ -774,13 +806,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -789,50 +821,61 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnGatewayParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - if (resourceGroupName == null) + if (vpnGatewayParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + vpnGatewayParameters.Validate(); } - if (gatewayName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (vpnGatewayParameters == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnGatewayParameters != null) + + if (gatewayName == null) { - vpnGatewayParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnGatewayParameters", vpnGatewayParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -842,25 +885,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -872,61 +914,62 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnGatewayParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnGatewayParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnGatewayParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -936,9 +979,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -949,16 +993,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -967,25 +1011,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates virtual wan vpn gateway tags. /// @@ -1004,13 +1052,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1019,46 +1067,57 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnGatewayParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (gatewayName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnGatewayParameters == null) + + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnGatewayParameters", vpnGatewayParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1068,25 +1127,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1098,61 +1156,62 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnGatewayParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnGatewayParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnGatewayParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1162,9 +1221,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1175,25 +1235,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a virtual wan vpn gateway. /// @@ -1209,10 +1273,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1221,41 +1285,52 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1265,25 +1340,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1295,55 +1369,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1353,20 +1428,25 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the primary of the vpn gateway in the specified resource group. /// @@ -1385,13 +1465,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1400,42 +1480,54 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } - if (Client.SubscriptionId == null) + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("ipConfigurationId", ipConfigurationId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (ipConfigurationId != null) { _queryParameters.Add(string.Format("ipConfigurationId={0}", System.Uri.EscapeDataString(ipConfigurationId))); @@ -1449,25 +1541,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1479,55 +1570,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1537,9 +1629,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1550,25 +1643,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts packet capture on vpn gateway in the specified resource group. /// @@ -1588,13 +1685,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1603,42 +1700,54 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStartPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStartPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1648,25 +1757,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1678,61 +1786,62 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1742,9 +1851,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1755,25 +1865,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Stops packet capture on vpn gateway in the specified resource group. /// @@ -1793,13 +1907,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1808,42 +1922,54 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginStopPacketCaptureWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStopPacketCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1853,25 +1979,24 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1883,61 +2008,62 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1947,9 +2073,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1960,25 +2087,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnGateways in a resource group. /// @@ -1991,13 +2122,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2006,51 +2137,54 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2062,55 +2196,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2120,9 +2255,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2133,25 +2269,29 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnGateways in a subscription. /// @@ -2164,13 +2304,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2179,51 +2319,54 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2235,55 +2378,56 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2293,9 +2437,10 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2306,24 +2451,28 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperationsExtensions.cs index d0528f28d41c..84dcfb230af5 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnGatewaysOperationsExtensions.cs @@ -1,741 +1,659 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnGatewaysOperations. + /// Extension methods for VpnGatewaysOperations /// public static partial class VpnGatewaysOperationsExtensions { - /// - /// Retrieves the details of a virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - public static VpnGateway Get(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - return operations.GetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan vpn gateway. - /// - public static VpnGateway CreateOrUpdate(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway tags. - /// - public static VpnGateway UpdateTags(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters) - { - return operations.UpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - public static void Delete(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - operations.DeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Resets the primary of the vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// VpnGateway ipConfigurationId to specify the gateway instance. - /// - public static VpnGateway Reset(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string)) - { - return operations.ResetAsync(resourceGroupName, gatewayName, ipConfigurationId).GetAwaiter().GetResult(); - } - - /// - /// Resets the primary of the vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// VpnGateway ipConfigurationId to specify the gateway instance. - /// - /// - /// The cancellation token. - /// - public static async Task ResetAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, gatewayName, ipConfigurationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to start packet capture on - /// vpn gateway. - /// - public static string StartPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters)) - { - return operations.StartPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to start packet capture on - /// vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task StartPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to stop packet capture on - /// vpn gateway. - /// - public static string StopPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters)) - { - return operations.StopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Stops packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to stop packet capture on - /// vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task StopPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - public static IPage ListByResourceGroup(this IVpnGatewaysOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVpnGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVpnGatewaysOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the VpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVpnGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan vpn gateway. - /// - public static VpnGateway BeginCreateOrUpdate(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the - /// existing gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway tags. - /// - public static VpnGateway BeginUpdateTags(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - public static void BeginDelete(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) - { - operations.BeginDeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a virtual wan vpn gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Resets the primary of the vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// VpnGateway ipConfigurationId to specify the gateway instance. - /// - public static VpnGateway BeginReset(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string)) - { - return operations.BeginResetAsync(resourceGroupName, gatewayName, ipConfigurationId).GetAwaiter().GetResult(); - } - - /// - /// Resets the primary of the vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// VpnGateway ipConfigurationId to specify the gateway instance. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, ipConfigurationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to start packet capture on - /// vpn gateway. - /// - public static string BeginStartPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters)) - { - return operations.BeginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Starts packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to start packet capture on - /// vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Stops packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to stop packet capture on - /// vpn gateway. - /// - public static string BeginStopPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters)) - { - return operations.BeginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Stops packet capture on vpn gateway in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Vpn gateway packet capture parameters supplied to stop packet capture on - /// vpn gateway. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVpnGatewaysOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VpnGateways in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVpnGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVpnGatewaysOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VpnGateways in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVpnGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Retrieves the details of a virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static VpnGateway Get(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + return ((IVpnGatewaysOperations)operations).GetAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the details of a virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static VpnGateway CreateOrUpdate(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters) + { + return ((IVpnGatewaysOperations)operations).CreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates virtual wan vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static VpnGateway UpdateTags(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters) + { + return ((IVpnGatewaysOperations)operations).UpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates virtual wan vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static void Delete(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + ((IVpnGatewaysOperations)operations).DeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// VpnGateway ipConfigurationId to specify the gateway instance. + /// + public static VpnGateway Reset(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string)) + { + return ((IVpnGatewaysOperations)operations).ResetAsync(resourceGroupName, gatewayName, ipConfigurationId).GetAwaiter().GetResult(); + } + + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// VpnGateway ipConfigurationId to specify the gateway instance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, gatewayName, ipConfigurationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static string StartPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters)) + { + return ((IVpnGatewaysOperations)operations).StartPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Starts packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Stops packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static string StopPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters)) + { + return ((IVpnGatewaysOperations)operations).StopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Stops packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.StopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVpnGatewaysOperations operations, string resourceGroupName) + { + return ((IVpnGatewaysOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the VpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVpnGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVpnGatewaysOperations operations) + { + return ((IVpnGatewaysOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the VpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVpnGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static VpnGateway BeginCreateOrUpdate(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters) + { + return ((IVpnGatewaysOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates virtual wan vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static VpnGateway BeginUpdateTags(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters) + { + return ((IVpnGatewaysOperations)operations).BeginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates virtual wan vpn gateway tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateTagsAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static void BeginDelete(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName) + { + ((IVpnGatewaysOperations)operations).BeginDeleteAsync(resourceGroupName, gatewayName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a virtual wan vpn gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// VpnGateway ipConfigurationId to specify the gateway instance. + /// + public static VpnGateway BeginReset(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string)) + { + return ((IVpnGatewaysOperations)operations).BeginResetAsync(resourceGroupName, gatewayName, ipConfigurationId).GetAwaiter().GetResult(); + } + + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// VpnGateway ipConfigurationId to specify the gateway instance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, string ipConfigurationId = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, ipConfigurationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static string BeginStartPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters)) + { + return ((IVpnGatewaysOperations)operations).BeginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Starts packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStartParameters parameters = default(VpnGatewayPacketCaptureStartParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStartPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Stops packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + public static string BeginStopPacketCapture(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters)) + { + return ((IVpnGatewaysOperations)operations).BeginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Stops packet capture on vpn gateway in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopPacketCaptureAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, VpnGatewayPacketCaptureStopParameters parameters = default(VpnGatewayPacketCaptureStopParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginStopPacketCaptureWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVpnGatewaysOperations operations, string nextPageLink) + { + return ((IVpnGatewaysOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the VpnGateways in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVpnGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the VpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVpnGatewaysOperations operations, string nextPageLink) + { + return ((IVpnGatewaysOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the VpnGateways in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVpnGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperations.cs index 584976fa6331..1911401508fb 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnLinkConnectionsOperations operations. /// - internal partial class VpnLinkConnectionsOperations : IServiceOperations, IVpnLinkConnectionsOperations + internal partial class VpnLinkConnectionsOperations : Microsoft.Rest.IServiceOperations, IVpnLinkConnectionsOperations { /// /// Initializes a new instance of the VpnLinkConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class VpnLinkConnectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnLinkConnectionsOperations(NetworkManagementClient client) + internal VpnLinkConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,21 +54,20 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// The name of the vpn link connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Lists IKE Security Associations for Vpn Site Link Connection in the - /// specified resource group. + /// Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. /// /// /// The name of the resource group. @@ -95,16 +82,16 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// The name of the vpn link connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -126,13 +113,13 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -141,47 +128,59 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -191,25 +190,24 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -221,55 +219,56 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -279,9 +278,10 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -292,25 +292,29 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resets the VpnLink connection specified. /// @@ -332,10 +336,10 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -344,53 +348,66 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginResetConnectionWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + if (linkConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("linkConnectionName", linkConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{linkConnectionName}", System.Uri.EscapeDataString(linkConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -400,25 +417,24 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -430,50 +446,51 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -483,20 +500,25 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists IKE Security Associations for Vpn Site Link Connection in the /// specified resource group. @@ -519,13 +541,13 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -534,53 +556,66 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetIkeSasWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + if (linkConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("linkConnectionName", linkConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetIkeSas", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetIkeSas", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{linkConnectionName}", System.Uri.EscapeDataString(linkConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -590,25 +625,24 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -620,50 +654,51 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -673,9 +708,10 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -686,25 +722,29 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all vpn site link connections for a particular virtual wan vpn /// gateway vpn connection. @@ -718,13 +758,13 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -733,51 +773,54 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnConnectionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnConnectionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnConnectionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnConnectionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -789,55 +832,56 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -847,9 +891,10 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -860,24 +905,28 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperationsExtensions.cs index c75bfa256bf8..272c135f1986 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnLinkConnectionsOperationsExtensions.cs @@ -1,315 +1,300 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnLinkConnectionsOperations. + /// Extension methods for VpnLinkConnectionsOperations /// public static partial class VpnLinkConnectionsOperationsExtensions { - /// - /// Resets the VpnLink connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - public static void ResetConnection(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) - { - operations.ResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Resets the VpnLink connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - /// - /// The cancellation token. - /// - public static async Task ResetConnectionAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResetConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Resets the VpnLink connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + public static void ResetConnection(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) + { + ((IVpnLinkConnectionsOperations)operations).ResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); + } - /// - /// Lists IKE Security Associations for Vpn Site Link Connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - public static string GetIkeSas(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) - { - return operations.GetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); - } + /// + /// Resets the VpnLink connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetConnectionAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ResetConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists IKE Security Associations for Vpn Site Link Connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + public static string GetIkeSas(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) + { + return ((IVpnLinkConnectionsOperations)operations).GetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); + } - /// - /// Lists IKE Security Associations for Vpn Site Link Connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetIkeSasAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists IKE Security Associations for Vpn Site Link Connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetIkeSasAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetIkeSasWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetIkeSasWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the vpn gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnConnection(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) + { + return ((IVpnLinkConnectionsOperations)operations).ListByVpnConnectionAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all vpn site link connections for a particular virtual wan vpn - /// gateway vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the vpn gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - public static IPage ListByVpnConnection(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName) + /// + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the vpn gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnConnectionAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByVpnConnectionAsync(resourceGroupName, gatewayName, connectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Resets the VpnLink connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + public static void BeginResetConnection(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) + { + ((IVpnLinkConnectionsOperations)operations).BeginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all vpn site link connections for a particular virtual wan vpn - /// gateway vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the vpn gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnConnectionAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Resets the VpnLink connection specified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetConnectionAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists IKE Security Associations for Vpn Site Link Connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + public static string BeginGetIkeSas(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) + { + return ((IVpnLinkConnectionsOperations)operations).BeginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); + } - /// - /// Resets the VpnLink connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - public static void BeginResetConnection(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) + /// + /// Lists IKE Security Associations for Vpn Site Link Connection in the + /// specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn link connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetIkeSasAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnConnectionNext(this IVpnLinkConnectionsOperations operations, string nextPageLink) + { + return ((IVpnLinkConnectionsOperations)operations).ListByVpnConnectionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Resets the VpnLink connection specified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetConnectionAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all vpn site link connections for a particular virtual wan vpn + /// gateway vpn connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnConnectionNextAsync(this IVpnLinkConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnConnectionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginResetConnectionWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Lists IKE Security Associations for Vpn Site Link Connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - public static string BeginGetIkeSas(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) - { - return operations.BeginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Lists IKE Security Associations for Vpn Site Link Connection in the - /// specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn link connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetIkeSasAsync(this IVpnLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetIkeSasWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves all vpn site link connections for a particular virtual wan vpn - /// gateway vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVpnConnectionNext(this IVpnLinkConnectionsOperations operations, string nextPageLink) - { - return operations.ListByVpnConnectionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all vpn site link connections for a particular virtual wan vpn - /// gateway vpn connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnConnectionNextAsync(this IVpnLinkConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnConnectionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs index 7ae08170ff50..c5e6d5a3cc36 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnServerConfigurationsAssociatedWithVirtualWanOperations operations. /// - internal partial class VpnServerConfigurationsAssociatedWithVirtualWanOperations : IServiceOperations, IVpnServerConfigurationsAssociatedWithVirtualWanOperations + internal partial class VpnServerConfigurationsAssociatedWithVirtualWanOperations : Microsoft.Rest.IServiceOperations, IVpnServerConfigurationsAssociatedWithVirtualWanOperations { /// /// Initializes a new instance of the VpnServerConfigurationsAssociatedWithVirtualWanOperations class. @@ -36,13 +24,13 @@ internal partial class VpnServerConfigurationsAssociatedWithVirtualWanOperations /// /// Thrown when a required parameter is null /// - internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManagementClient client) + internal VpnServerConfigurationsAssociatedWithVirtualWanOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage public NetworkManagementClient Client { get; private set; } /// - /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a - /// resource group. + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. /// /// /// The resource group name. @@ -62,16 +49,16 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage /// needed. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListWithHttpMessagesAsync(resourceGroupName, virtualWANName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListWithHttpMessagesAsync(resourceGroupName, virtualWANName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -91,13 +78,13 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -106,41 +93,52 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage /// /// A response object containing the response body and response headers. /// - public async Task> BeginListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualWANName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginList", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginList", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -150,25 +148,24 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -180,55 +177,56 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -238,9 +236,10 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -251,24 +250,28 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperationsExtensions.cs index 28cfbe61b934..d45ef64647f2 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperationsExtensions.cs @@ -1,113 +1,102 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnServerConfigurationsAssociatedWithVirtualWanOperations. + /// Extension methods for VpnServerConfigurationsAssociatedWithVirtualWanOperations /// public static partial class VpnServerConfigurationsAssociatedWithVirtualWanOperationsExtensions { - /// - /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - public static VpnServerConfigurationsResponse List(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName) - { - return operations.ListAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); - } + /// + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + public static VpnServerConfigurationsResponse List(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName) + { + return ((IVpnServerConfigurationsAssociatedWithVirtualWanOperations)operations).ListAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + } - /// - /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + public static VpnServerConfigurationsResponse BeginList(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName) + { + return ((IVpnServerConfigurationsAssociatedWithVirtualWanOperations)operations).BeginListAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + } - /// - /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - public static VpnServerConfigurationsResponse BeginList(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName) + /// + /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListAsync(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginListAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gives the list of VpnServerConfigurations associated with Virtual Wan in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. - /// - /// - /// The cancellation token. - /// - public static async Task BeginListAsync(this IVpnServerConfigurationsAssociatedWithVirtualWanOperations operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperations.cs index 82f766a0024f..b5b414c855c5 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnServerConfigurationsOperations operations. /// - internal partial class VpnServerConfigurationsOperations : IServiceOperations, IVpnServerConfigurationsOperations + internal partial class VpnServerConfigurationsOperations : Microsoft.Rest.IServiceOperations, IVpnServerConfigurationsOperations { /// /// Initializes a new instance of the VpnServerConfigurationsOperations class. @@ -36,13 +24,13 @@ internal partial class VpnServerConfigurationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnServerConfigurationsOperations(NetworkManagementClient client) + internal VpnServerConfigurationsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,28 +225,31 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates - /// the existing VpnServerConfiguration. + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. /// /// /// The resource group name of the VpnServerConfiguration. @@ -258,16 +261,16 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// Parameters supplied to create or update VpnServerConfiguration. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -288,13 +291,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -303,46 +306,57 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnServerConfigurationParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (vpnServerConfigurationName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnServerConfigurationParameters == null) + + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnServerConfigurationParameters", vpnServerConfigurationParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -352,25 +366,24 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -382,61 +395,62 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnServerConfigurationParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -446,9 +460,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -459,25 +474,29 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VpnServerConfiguration. /// @@ -488,16 +507,16 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// The name of the VpnServerConfiguration being deleted. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -512,13 +531,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -527,35 +546,45 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +594,24 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +623,56 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +682,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +696,29 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnServerConfigurations in a subscription. /// @@ -694,13 +728,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -709,29 +743,38 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +784,24 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,55 +813,56 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,9 +872,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -842,27 +886,31 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates /// the existing VpnServerConfiguration. /// /// @@ -880,13 +928,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,46 +943,58 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnServerConfigurationParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (vpnServerConfigurationName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnServerConfigurationParameters == null) + + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnServerConfigurationParameters", vpnServerConfigurationParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -944,25 +1004,24 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -974,61 +1033,62 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnServerConfigurationParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1038,9 +1098,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1051,16 +1112,16 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1069,25 +1130,29 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VpnServerConfiguration. /// @@ -1103,10 +1168,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1115,41 +1180,52 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnServerConfigurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1159,25 +1235,24 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1189,55 +1264,56 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1247,20 +1323,25 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the vpnServerConfigurations in a resource group. /// @@ -1273,13 +1354,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1288,51 +1369,54 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1344,55 +1428,56 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1402,9 +1487,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1415,25 +1501,29 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnServerConfigurations in a subscription. /// @@ -1446,13 +1536,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1461,51 +1551,54 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1517,55 +1610,56 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1575,9 +1669,10 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1588,24 +1683,28 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperationsExtensions.cs index 19dacac02d10..081e12855a4a 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnServerConfigurationsOperationsExtensions.cs @@ -1,411 +1,374 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnServerConfigurationsOperations. + /// Extension methods for VpnServerConfigurationsOperations /// public static partial class VpnServerConfigurationsOperationsExtensions { - /// - /// Retrieves the details of a VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being retrieved. - /// - public static VpnServerConfiguration Get(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName) - { - return operations.GetAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates - /// the existing VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being created or updated. - /// - /// - /// Parameters supplied to create or update VpnServerConfiguration. - /// - public static VpnServerConfiguration CreateOrUpdate(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being retrieved. + /// + public static VpnServerConfiguration Get(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName) + { + return ((IVpnServerConfigurationsOperations)operations).GetAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates - /// the existing VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being created or updated. - /// - /// - /// Parameters supplied to create or update VpnServerConfiguration. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being created or updated. + /// + public static VpnServerConfiguration CreateOrUpdate(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters) + { + return ((IVpnServerConfigurationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); + } - /// - /// Updates VpnServerConfiguration tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being updated. - /// - /// - /// Parameters supplied to update VpnServerConfiguration tags. - /// - public static VpnServerConfiguration UpdateTags(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) + /// + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being created or updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates VpnServerConfiguration tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being updated. + /// + public static VpnServerConfiguration UpdateTags(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) + { + return ((IVpnServerConfigurationsOperations)operations).UpdateTagsAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); + } - /// - /// Updates VpnServerConfiguration tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being updated. - /// - /// - /// Parameters supplied to update VpnServerConfiguration tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates VpnServerConfiguration tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being deleted. + /// + public static void Delete(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName) + { + ((IVpnServerConfigurationsOperations)operations).DeleteAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being deleted. - /// - public static void Delete(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName) - { - operations.DeleteAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); - } + /// + /// Deletes a VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVpnServerConfigurationsOperations operations, string resourceGroupName) + { + return ((IVpnServerConfigurationsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being deleted. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all the VpnServerConfigurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVpnServerConfigurationsOperations operations) + { + return ((IVpnServerConfigurationsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnServerConfigurations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - public static IPage ListByResourceGroup(this IVpnServerConfigurationsOperations operations, string resourceGroupName) + /// + /// Lists all the VpnServerConfigurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVpnServerConfigurationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being created or updated. + /// + public static VpnServerConfiguration BeginCreateOrUpdate(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters) + { + return ((IVpnServerConfigurationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnServerConfigurations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being created or updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being deleted. + /// + public static void BeginDelete(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName) + { + ((IVpnServerConfigurationsOperations)operations).BeginDeleteAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); + } - /// - /// Lists all the VpnServerConfigurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVpnServerConfigurationsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Deletes a VpnServerConfiguration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVpnServerConfigurationsOperations operations, string nextPageLink) + { + return ((IVpnServerConfigurationsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the VpnServerConfigurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVpnServerConfigurationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVpnServerConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all the VpnServerConfigurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVpnServerConfigurationsOperations operations, string nextPageLink) + { + return ((IVpnServerConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates - /// the existing VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being created or updated. - /// - /// - /// Parameters supplied to create or update VpnServerConfiguration. - /// - public static VpnServerConfiguration BeginCreateOrUpdate(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters) + /// + /// Lists all the VpnServerConfigurations in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVpnServerConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates - /// the existing VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being created or updated. - /// - /// - /// Parameters supplied to create or update VpnServerConfiguration. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being deleted. - /// - public static void BeginDelete(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName) - { - operations.BeginDeleteAsync(resourceGroupName, vpnServerConfigurationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VpnServerConfiguration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being deleted. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the vpnServerConfigurations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVpnServerConfigurationsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the vpnServerConfigurations in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVpnServerConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VpnServerConfigurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVpnServerConfigurationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VpnServerConfigurations in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVpnServerConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperations.cs index d4efad18277a..c209b66b486e 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSiteLinkConnectionsOperations operations. /// - internal partial class VpnSiteLinkConnectionsOperations : IServiceOperations, IVpnSiteLinkConnectionsOperations + internal partial class VpnSiteLinkConnectionsOperations : Microsoft.Rest.IServiceOperations, IVpnSiteLinkConnectionsOperations { /// /// Initializes a new instance of the VpnSiteLinkConnectionsOperations class. @@ -36,13 +24,13 @@ internal partial class VpnSiteLinkConnectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) + internal VpnSiteLinkConnectionsOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -71,13 +59,13 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -86,53 +74,66 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayName"); } + if (connectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "connectionName"); } + if (linkConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkConnectionName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("linkConnectionName", linkConnectionName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{linkConnectionName}", System.Uri.EscapeDataString(linkConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -142,25 +143,24 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -172,55 +172,56 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -230,9 +231,10 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -243,24 +245,28 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperationsExtensions.cs index 834fd986c4ab..c754add12543 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinkConnectionsOperationsExtensions.cs @@ -1,77 +1,67 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnSiteLinkConnectionsOperations. + /// Extension methods for VpnSiteLinkConnectionsOperations /// public static partial class VpnSiteLinkConnectionsOperationsExtensions { - /// - /// Retrieves the details of a vpn site link connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn connection. - /// - public static VpnSiteLinkConnection Get(this IVpnSiteLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) - { - return operations.GetAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a vpn site link connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn connection. + /// + public static VpnSiteLinkConnection Get(this IVpnSiteLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName) + { + return ((IVpnSiteLinkConnectionsOperations)operations).GetAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves the details of a vpn site link connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The name of the vpn connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVpnSiteLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a vpn site link connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The name of the vpn connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVpnSiteLinkConnectionsOperations operations, string resourceGroupName, string gatewayName, string connectionName, string linkConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperations.cs index 7f109d56fafa..48e0c6ec7af6 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSiteLinksOperations operations. /// - internal partial class VpnSiteLinksOperations : IServiceOperations, IVpnSiteLinksOperations + internal partial class VpnSiteLinksOperations : Microsoft.Rest.IServiceOperations, IVpnSiteLinksOperations { /// /// Initializes a new instance of the VpnSiteLinksOperations class. @@ -36,13 +24,13 @@ internal partial class VpnSiteLinksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnSiteLinksOperations(NetworkManagementClient client) + internal VpnSiteLinksOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,47 +71,59 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, string vpnSiteLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, string vpnSiteLinkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteName"); } + if (vpnSiteLinkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteLinkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteLinkName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("vpnSiteLinkName", vpnSiteLinkName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); _url = _url.Replace("{vpnSiteLinkName}", System.Uri.EscapeDataString(vpnSiteLinkName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +133,24 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,55 +162,56 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,9 +221,10 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -234,25 +235,29 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the vpnSiteLinks in a resource group for a vpn site. /// @@ -268,13 +273,13 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -283,41 +288,52 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnSiteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnSiteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnSite", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnSite", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -327,25 +343,24 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,55 +372,56 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,9 +431,10 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -428,25 +445,29 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the vpnSiteLinks in a resource group for a vpn site. /// @@ -459,13 +480,13 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -474,51 +495,54 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVpnSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVpnSiteNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVpnSiteNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVpnSiteNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -530,55 +554,56 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -588,9 +613,10 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -601,24 +627,28 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperationsExtensions.cs index cdb09422514f..25899b0a6de4 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSiteLinksOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnSiteLinksOperations. + /// Extension methods for VpnSiteLinksOperations /// public static partial class VpnSiteLinksOperationsExtensions { - /// - /// Retrieves the details of a VPN site link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite. - /// - /// - /// The name of the VpnSiteLink being retrieved. - /// - public static VpnSiteLink Get(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName, string vpnSiteLinkName) - { - return operations.GetAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a VPN site link. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite. - /// - /// - /// The name of the VpnSiteLink being retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName, string vpnSiteLinkName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Retrieves the details of a VPN site link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite. + /// + /// + /// The name of the VpnSiteLink being retrieved. + /// + public static VpnSiteLink Get(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName, string vpnSiteLinkName) + { + return ((IVpnSiteLinksOperations)operations).GetAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName).GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnSiteLinks in a resource group for a vpn site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite. - /// - public static IPage ListByVpnSite(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName) + /// + /// Retrieves the details of a VPN site link. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite. + /// + /// + /// The name of the VpnSiteLink being retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName, string vpnSiteLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByVpnSiteAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all the vpnSiteLinks in a resource group for a vpn site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnSite(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName) + { + return ((IVpnSiteLinksOperations)operations).ListByVpnSiteAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnSiteLinks in a resource group for a vpn site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnSiteAsync(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the vpnSiteLinks in a resource group for a vpn site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnSiteAsync(this IVpnSiteLinksOperations operations, string resourceGroupName, string vpnSiteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnSiteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByVpnSiteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all the vpnSiteLinks in a resource group for a vpn site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVpnSiteNext(this IVpnSiteLinksOperations operations, string nextPageLink) + { + return ((IVpnSiteLinksOperations)operations).ListByVpnSiteNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnSiteLinks in a resource group for a vpn site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVpnSiteNext(this IVpnSiteLinksOperations operations, string nextPageLink) + /// + /// Lists all the vpnSiteLinks in a resource group for a vpn site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVpnSiteNextAsync(this IVpnSiteLinksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVpnSiteNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByVpnSiteNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all the vpnSiteLinks in a resource group for a vpn site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVpnSiteNextAsync(this IVpnSiteLinksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVpnSiteNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperations.cs index 6ede48ee9a60..012f403232e4 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSitesConfigurationOperations operations. /// - internal partial class VpnSitesConfigurationOperations : IServiceOperations, IVpnSitesConfigurationOperations + internal partial class VpnSitesConfigurationOperations : Microsoft.Rest.IServiceOperations, IVpnSitesConfigurationOperations { /// /// Initializes a new instance of the VpnSitesConfigurationOperations class. @@ -36,13 +24,13 @@ internal partial class VpnSitesConfigurationOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnSitesConfigurationOperations(NetworkManagementClient client) + internal VpnSitesConfigurationOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Gives the sas-url to download the configurations for vpn-sites in a - /// resource group. + /// Gives the sas-url to download the configurations for vpn-sites in a resource group. /// /// /// The resource group name. @@ -65,16 +52,16 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) /// Parameters supplied to download vpn-sites configuration. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(resourceGroupName, virtualWANName, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(resourceGroupName, virtualWANName, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -97,10 +84,10 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -109,50 +96,61 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDownloadWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request"); } - if (resourceGroupName == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + request.Validate(); } - if (virtualWANName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (request == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (request != null) + + if (virtualWANName == null) { - request.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualWANName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualWANName", virtualWANName); - tracingParameters.Add("request", request); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDownload", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDownload", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualWANName}", System.Uri.EscapeDataString(virtualWANName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -162,25 +160,24 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -192,61 +189,62 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -256,19 +254,24 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperationsExtensions.cs index 47233f61d0a6..1f7acc0b1968 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSitesConfigurationOperationsExtensions.cs @@ -1,119 +1,96 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnSitesConfigurationOperations. + /// Extension methods for VpnSitesConfigurationOperations /// public static partial class VpnSitesConfigurationOperationsExtensions { - /// - /// Gives the sas-url to download the configurations for vpn-sites in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN for which configuration of all vpn-sites is - /// needed. - /// - /// - /// Parameters supplied to download vpn-sites configuration. - /// - public static void Download(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request) - { - operations.DownloadAsync(resourceGroupName, virtualWANName, request).GetAwaiter().GetResult(); - } - - /// - /// Gives the sas-url to download the configurations for vpn-sites in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN for which configuration of all vpn-sites is - /// needed. - /// - /// - /// Parameters supplied to download vpn-sites configuration. - /// - /// - /// The cancellation token. - /// - public static async Task DownloadAsync(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DownloadWithHttpMessagesAsync(resourceGroupName, virtualWANName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gives the sas-url to download the configurations for vpn-sites in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN for which configuration of all vpn-sites is - /// needed. - /// - /// - /// Parameters supplied to download vpn-sites configuration. - /// - public static void BeginDownload(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request) - { - operations.BeginDownloadAsync(resourceGroupName, virtualWANName, request).GetAwaiter().GetResult(); - } + /// + /// Gives the sas-url to download the configurations for vpn-sites in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which configuration of all vpn-sites is + /// needed. + /// + public static void Download(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request) + { + ((IVpnSitesConfigurationOperations)operations).DownloadAsync(resourceGroupName, virtualWANName, request).GetAwaiter().GetResult(); + } - /// - /// Gives the sas-url to download the configurations for vpn-sites in a - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The name of the VirtualWAN for which configuration of all vpn-sites is - /// needed. - /// - /// - /// Parameters supplied to download vpn-sites configuration. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDownloadAsync(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDownloadWithHttpMessagesAsync(resourceGroupName, virtualWANName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Gives the sas-url to download the configurations for vpn-sites in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which configuration of all vpn-sites is + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DownloadAsync(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DownloadWithHttpMessagesAsync(resourceGroupName, virtualWANName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gives the sas-url to download the configurations for vpn-sites in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which configuration of all vpn-sites is + /// needed. + /// + public static void BeginDownload(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request) + { + ((IVpnSitesConfigurationOperations)operations).BeginDownloadAsync(resourceGroupName, virtualWANName, request).GetAwaiter().GetResult(); + } + /// + /// Gives the sas-url to download the configurations for vpn-sites in a + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which configuration of all vpn-sites is + /// needed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDownloadAsync(this IVpnSitesConfigurationOperations operations, string resourceGroupName, string virtualWANName, GetVpnSitesConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDownloadWithHttpMessagesAsync(resourceGroupName, virtualWANName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSitesOperations.cs b/src/Network/Network.Management.Sdk/Generated/VpnSitesOperations.cs index c7b616f8c0bd..0ce69e28bd86 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSitesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSitesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VpnSitesOperations operations. /// - internal partial class VpnSitesOperations : IServiceOperations, IVpnSitesOperations + internal partial class VpnSitesOperations : Microsoft.Rest.IServiceOperations, IVpnSitesOperations { /// /// Initializes a new instance of the VpnSitesOperations class. @@ -36,13 +24,13 @@ internal partial class VpnSitesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VpnSitesOperations(NetworkManagementClient client) + internal VpnSitesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,41 +68,52 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +123,24 @@ internal VpnSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +152,56 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +211,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,28 +225,31 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing - /// VpnSite. + /// Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. /// /// /// The resource group name of the VpnSite. @@ -258,16 +261,16 @@ internal VpnSitesOperations(NetworkManagementClient client) /// Parameters supplied to create or update VpnSite. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -288,13 +291,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -303,46 +306,57 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnSiteParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteParameters"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (vpnSiteName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnSiteParameters == null) + + if (vpnSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnSiteParameters", vpnSiteParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -352,25 +366,24 @@ internal VpnSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -382,61 +395,62 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnSiteParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnSiteParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnSiteParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -446,9 +460,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -459,25 +474,29 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VpnSite. /// @@ -488,16 +507,16 @@ internal VpnSitesOperations(NetworkManagementClient client) /// The name of the VpnSite being deleted. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -512,13 +531,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -527,35 +546,45 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +594,24 @@ internal VpnSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +623,56 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +682,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +696,29 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnSites in a subscription. /// @@ -694,13 +728,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -709,29 +743,38 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +784,24 @@ internal VpnSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,55 +813,56 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -829,9 +872,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -842,27 +886,31 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// Creates a VpnSite resource if it doesn't exist else updates the existing /// VpnSite. /// /// @@ -880,13 +928,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -895,50 +943,61 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (vpnSiteParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteParameters"); } - if (resourceGroupName == null) + if (vpnSiteParameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + vpnSiteParameters.Validate(); } - if (vpnSiteName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (vpnSiteParameters == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vpnSiteParameters != null) + + if (vpnSiteName == null) { - vpnSiteParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnSiteParameters", vpnSiteParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -948,25 +1007,24 @@ internal VpnSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -978,61 +1036,62 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vpnSiteParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnSiteParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vpnSiteParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1042,9 +1101,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1055,16 +1115,16 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1073,25 +1133,29 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VpnSite. /// @@ -1107,10 +1171,10 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1119,41 +1183,52 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (vpnSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vpnSiteName"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1163,25 +1238,24 @@ internal VpnSitesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1193,55 +1267,56 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1251,20 +1326,25 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the vpnSites in a resource group. /// @@ -1277,13 +1357,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1292,51 +1372,54 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1348,55 +1431,56 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1406,9 +1490,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1419,25 +1504,29 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the VpnSites in a subscription. /// @@ -1450,13 +1539,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1465,51 +1554,54 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1521,55 +1613,56 @@ internal VpnSitesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1579,9 +1672,10 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1592,24 +1686,28 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/VpnSitesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/VpnSitesOperationsExtensions.cs index 6095241dfd50..b5e0b34c4c9b 100644 --- a/src/Network/Network.Management.Sdk/Generated/VpnSitesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/VpnSitesOperationsExtensions.cs @@ -1,411 +1,374 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VpnSitesOperations. + /// Extension methods for VpnSitesOperations /// public static partial class VpnSitesOperationsExtensions { - /// - /// Retrieves the details of a VPN site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being retrieved. - /// - public static VpnSite Get(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName) - { - return operations.GetAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a VPN site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing - /// VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being created or updated. - /// - /// - /// Parameters supplied to create or update VpnSite. - /// - public static VpnSite CreateOrUpdate(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); - } + /// + /// Retrieves the details of a VPN site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being retrieved. + /// + public static VpnSite Get(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName) + { + return ((IVpnSitesOperations)operations).GetAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); + } - /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing - /// VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being created or updated. - /// - /// - /// Parameters supplied to create or update VpnSite. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves the details of a VPN site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being created or updated. + /// + public static VpnSite CreateOrUpdate(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters) + { + return ((IVpnSitesOperations)operations).CreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); + } - /// - /// Updates VpnSite tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being updated. - /// - /// - /// Parameters supplied to update VpnSite tags. - /// - public static VpnSite UpdateTags(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters) + /// + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being created or updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates VpnSite tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being updated. + /// + public static VpnSite UpdateTags(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters) + { + return ((IVpnSitesOperations)operations).UpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); + } - /// - /// Updates VpnSite tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being updated. - /// - /// - /// Parameters supplied to update VpnSite tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates VpnSite tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateTagsAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being deleted. + /// + public static void Delete(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName) + { + ((IVpnSitesOperations)operations).DeleteAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being deleted. - /// - public static void Delete(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName) - { - operations.DeleteAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); - } + /// + /// Deletes a VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the vpnSites in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVpnSitesOperations operations, string resourceGroupName) + { + return ((IVpnSitesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes a VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being deleted. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the vpnSites in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IVpnSitesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all the VpnSites in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IVpnSitesOperations operations) + { + return ((IVpnSitesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnSites in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - public static IPage ListByResourceGroup(this IVpnSitesOperations operations, string resourceGroupName) + /// + /// Lists all the VpnSites in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVpnSitesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being created or updated. + /// + public static VpnSite BeginCreateOrUpdate(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters) + { + return ((IVpnSitesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); + } - /// - /// Lists all the vpnSites in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVpnSitesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being created or updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being deleted. + /// + public static void BeginDelete(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName) + { + ((IVpnSitesOperations)operations).BeginDeleteAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); + } - /// - /// Lists all the VpnSites in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IVpnSitesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Deletes a VpnSite. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the vpnSites in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVpnSitesOperations operations, string nextPageLink) + { + return ((IVpnSitesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the VpnSites in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVpnSitesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the vpnSites in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IVpnSitesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all the VpnSites in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVpnSitesOperations operations, string nextPageLink) + { + return ((IVpnSitesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing - /// VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being created or updated. - /// - /// - /// Parameters supplied to create or update VpnSite. - /// - public static VpnSite BeginCreateOrUpdate(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters) + /// + /// Lists all the VpnSites in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVpnSitesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing - /// VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being created or updated. - /// - /// - /// Parameters supplied to create or update VpnSite. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being deleted. - /// - public static void BeginDelete(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName) - { - operations.BeginDeleteAsync(resourceGroupName, vpnSiteName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VpnSite. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being deleted. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the vpnSites in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IVpnSitesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the vpnSites in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IVpnSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the VpnSites in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVpnSitesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the VpnSites in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVpnSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperations.cs b/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperations.cs index c7ad7a977fec..9952f6661dc8 100644 --- a/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// WebApplicationFirewallPoliciesOperations operations. /// - internal partial class WebApplicationFirewallPoliciesOperations : IServiceOperations, IWebApplicationFirewallPoliciesOperations + internal partial class WebApplicationFirewallPoliciesOperations : Microsoft.Rest.IServiceOperations, IWebApplicationFirewallPoliciesOperations { /// /// Initializes a new instance of the WebApplicationFirewallPoliciesOperations class. @@ -36,13 +24,13 @@ internal partial class WebApplicationFirewallPoliciesOperations : IServiceOperat /// /// Thrown when a required parameter is null /// - internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client) + internal WebApplicationFirewallPoliciesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,35 +65,45 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,25 +215,29 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the WAF policies in a subscription. /// @@ -244,13 +247,13 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -259,29 +262,38 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -291,25 +303,24 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -321,55 +332,56 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -379,9 +391,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -392,25 +405,29 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieve protection policy with specified name within a resource group. /// @@ -426,13 +443,13 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -441,48 +458,58 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (policyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policyName"); } if (policyName != null) { if (policyName.Length > 128) { - throw new ValidationException(ValidationRules.MaxLength, "policyName", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "policyName", 128); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -492,25 +519,24 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -522,55 +548,56 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -580,9 +607,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -593,25 +621,29 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or update policy with specified rule set name within a resource /// group. @@ -631,13 +663,13 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -646,57 +678,67 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (policyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policyName"); } if (policyName != null) { if (policyName.Length > 128) { - throw new ValidationException(ValidationRules.MaxLength, "policyName", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "policyName", 128); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -706,25 +748,24 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -736,61 +777,62 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -800,9 +842,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -813,16 +856,16 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -831,25 +874,29 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes Policy. /// @@ -860,16 +907,16 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// The name of the policy. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -887,10 +934,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -899,48 +946,58 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (policyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policyName"); } if (policyName != null) { if (policyName.Length > 128) { - throw new ValidationException(ValidationRules.MaxLength, "policyName", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "policyName", 128); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -950,25 +1007,24 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -980,55 +1036,56 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1038,20 +1095,25 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the protection policies within a resource group. /// @@ -1064,13 +1126,13 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1079,51 +1141,54 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1135,55 +1200,56 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1193,9 +1259,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1206,25 +1273,29 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the WAF policies in a subscription. /// @@ -1237,13 +1308,13 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1252,51 +1323,54 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1308,55 +1382,56 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1366,9 +1441,10 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1379,24 +1455,28 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperationsExtensions.cs index 45c7d5263cf7..3fcdd58044e5 100644 --- a/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/WebApplicationFirewallPoliciesOperationsExtensions.cs @@ -1,317 +1,294 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for WebApplicationFirewallPoliciesOperations. + /// Extension methods for WebApplicationFirewallPoliciesOperations /// public static partial class WebApplicationFirewallPoliciesOperationsExtensions { - /// - /// Lists all of the protection policies within a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage List(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } + /// + /// Lists all of the protection policies within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static Microsoft.Rest.Azure.IPage List(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName) + { + return ((IWebApplicationFirewallPoliciesOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Lists all of the protection policies within a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the protection policies within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the WAF policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IWebApplicationFirewallPoliciesOperations operations) + { + return ((IWebApplicationFirewallPoliciesOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all the WAF policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IWebApplicationFirewallPoliciesOperations operations) + /// + /// Gets all the WAF policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IWebApplicationFirewallPoliciesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAllAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + public static WebApplicationFirewallPolicy Get(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName) + { + return ((IWebApplicationFirewallPoliciesOperations)operations).GetAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); + } - /// - /// Gets all the WAF policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IWebApplicationFirewallPoliciesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or update policy with specified rule set name within a resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + public static WebApplicationFirewallPolicy CreateOrUpdate(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters) + { + return ((IWebApplicationFirewallPoliciesOperations)operations).CreateOrUpdateAsync(resourceGroupName, policyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Retrieve protection policy with specified name within a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - public static WebApplicationFirewallPolicy Get(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName) + /// + /// Creates or update policy with specified rule set name within a resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, policyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + public static void Delete(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName) + { + ((IWebApplicationFirewallPoliciesOperations)operations).DeleteAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); + } - /// - /// Retrieve protection policy with specified name within a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deletes Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + public static void BeginDelete(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName) + { + ((IWebApplicationFirewallPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); + } - /// - /// Creates or update policy with specified rule set name within a resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - /// - /// Policy to be created. - /// - public static WebApplicationFirewallPolicy CreateOrUpdate(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, policyName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all of the protection policies within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink) + { + return ((IWebApplicationFirewallPoliciesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Creates or update policy with specified rule set name within a resource - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - /// - /// Policy to be created. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the protection policies within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, policyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the WAF policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink) + { + return ((IWebApplicationFirewallPoliciesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - public static void Delete(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName) + /// + /// Gets all the WAF policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - public static void BeginDelete(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName) - { - operations.BeginDeleteAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); - } - - /// - /// Deletes Policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the policy. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IWebApplicationFirewallPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the protection policies within a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the protection policies within a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the WAF policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the WAF policies in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IWebApplicationFirewallPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperations.cs b/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperations.cs index dd9e449e7ba1..e80f65f02fb8 100644 --- a/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperations.cs +++ b/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// WebCategoriesOperations operations. /// - internal partial class WebCategoriesOperations : IServiceOperations, IWebCategoriesOperations + internal partial class WebCategoriesOperations : Microsoft.Rest.IServiceOperations, IWebCategoriesOperations { /// /// Initializes a new instance of the WebCategoriesOperations class. @@ -36,13 +24,13 @@ internal partial class WebCategoriesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WebCategoriesOperations(NetworkManagementClient client) + internal WebCategoriesOperations (NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal WebCategoriesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,36 +68,47 @@ internal WebCategoriesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("name", name); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}").ToString(); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -123,25 +122,24 @@ internal WebCategoriesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,55 +151,56 @@ internal WebCategoriesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,9 +210,10 @@ internal WebCategoriesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -224,25 +224,29 @@ internal WebCategoriesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Azure Web Categories in a subscription. /// @@ -252,13 +256,13 @@ internal WebCategoriesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -267,29 +271,38 @@ internal WebCategoriesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2023-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -299,25 +312,24 @@ internal WebCategoriesOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -329,55 +341,56 @@ internal WebCategoriesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -387,9 +400,10 @@ internal WebCategoriesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -400,25 +414,29 @@ internal WebCategoriesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the Azure Web Categories in a subscription. /// @@ -431,13 +449,13 @@ internal WebCategoriesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -446,51 +464,54 @@ internal WebCategoriesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -502,55 +523,56 @@ internal WebCategoriesOperations(NetworkManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -560,9 +582,10 @@ internal WebCategoriesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -573,24 +596,28 @@ internal WebCategoriesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperationsExtensions.cs b/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperationsExtensions.cs index 03e13706bdec..bd93bddd3c45 100644 --- a/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperationsExtensions.cs +++ b/src/Network/Network.Management.Sdk/Generated/WebCategoriesOperationsExtensions.cs @@ -1,127 +1,115 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for WebCategoriesOperations. + /// Extension methods for WebCategoriesOperations /// public static partial class WebCategoriesOperationsExtensions { - /// - /// Gets the specified Azure Web Category. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the azureWebCategory. - /// - /// - /// Expands resourceIds back referenced by the azureWebCategory resource. - /// - public static AzureWebCategory Get(this IWebCategoriesOperations operations, string name, string expand = default(string)) - { - return operations.GetAsync(name, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified Azure Web Category. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the azureWebCategory. - /// - /// - /// Expands resourceIds back referenced by the azureWebCategory resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IWebCategoriesOperations operations, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets the specified Azure Web Category. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the azureWebCategory. + /// + /// + /// Expands resourceIds back referenced by the azureWebCategory resource. + /// + public static AzureWebCategory Get(this IWebCategoriesOperations operations, string name, string expand = default(string)) + { + return ((IWebCategoriesOperations)operations).GetAsync(name, expand).GetAwaiter().GetResult(); + } - /// - /// Gets all the Azure Web Categories in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IWebCategoriesOperations operations) + /// + /// Gets the specified Azure Web Category. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the azureWebCategory. + /// + /// + /// Expands resourceIds back referenced by the azureWebCategory resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IWebCategoriesOperations operations, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all the Azure Web Categories in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IWebCategoriesOperations operations) + { + return ((IWebCategoriesOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Gets all the Azure Web Categories in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IWebCategoriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all the Azure Web Categories in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IWebCategoriesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets all the Azure Web Categories in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IWebCategoriesOperations operations, string nextPageLink) + { + return ((IWebCategoriesOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets all the Azure Web Categories in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IWebCategoriesOperations operations, string nextPageLink) + /// + /// Gets all the Azure Web Categories in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IWebCategoriesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets all the Azure Web Categories in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IWebCategoriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Network/Network.Management.Sdk/README.md b/src/Network/Network.Management.Sdk/README.md index 2005b7e89d58..5541b4b3dab8 100644 --- a/src/Network/Network.Management.Sdk/README.md +++ b/src/Network/Network.Management.Sdk/README.md @@ -5,20 +5,22 @@ This directory contains management plane service clients of Az.Network module. In this directory, run AutoRest: ``` autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml title: NetworkManagementClient -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true openapi-type: arm azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION +use-extension: + "@autorest/powershell": "4.x" ``` @@ -92,4 +94,13 @@ input-file: output-folder: Generated namespace: Microsoft.Azure.Management.Network + +directive: + - from: swagger-document + where: $.definitions.EffectiveNetworkSecurityGroup.properties.tagMap + transform: $.type = "object" + - where: + model-name: Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + set: + model-name: ManagedServiceIdentityUserAssignedIdentitiesValue ``` diff --git a/src/Network/Network/AzureFirewall/AzureFirewallNetworkRuleProtocolHelper.cs b/src/Network/Network/AzureFirewall/AzureFirewallNetworkRuleProtocolHelper.cs index 57546f261aa0..8317f06d9899 100644 --- a/src/Network/Network/AzureFirewall/AzureFirewallNetworkRuleProtocolHelper.cs +++ b/src/Network/Network/AzureFirewall/AzureFirewallNetworkRuleProtocolHelper.cs @@ -25,7 +25,7 @@ public static class AzureFirewallNetworkRuleProtocolHelper MNM.AzureFirewallNetworkRuleProtocol.Any, MNM.AzureFirewallNetworkRuleProtocol.TCP, MNM.AzureFirewallNetworkRuleProtocol.UDP, - MNM.AzureFirewallNetworkRuleProtocol.ICMP + MNM.AzureFirewallNetworkRuleProtocol.Icmp }).ToDictionary(item => item.ToUpper()); private static readonly IDictionary SupportedNatRuleProtocols = (new string[]{ diff --git a/src/Network/Network/AzureFirewall/NetworkRule/NewAzureFirewallNetworkRuleCommand.cs b/src/Network/Network/AzureFirewall/NetworkRule/NewAzureFirewallNetworkRuleCommand.cs index d59ebe8d53b7..8eff33d65db5 100644 --- a/src/Network/Network/AzureFirewall/NetworkRule/NewAzureFirewallNetworkRuleCommand.cs +++ b/src/Network/Network/AzureFirewall/NetworkRule/NewAzureFirewallNetworkRuleCommand.cs @@ -77,7 +77,7 @@ public class NewAzureFirewallNetworkRuleCommand : AzureFirewallBaseCmdlet MNM.AzureFirewallNetworkRuleProtocol.Any, MNM.AzureFirewallNetworkRuleProtocol.TCP, MNM.AzureFirewallNetworkRuleProtocol.UDP, - MNM.AzureFirewallNetworkRuleProtocol.ICMP, + MNM.AzureFirewallNetworkRuleProtocol.Icmp, IgnoreCase = false)] public string[] Protocol { get; set; } diff --git a/src/Network/Network/AzureFirewall/NewAzureFirewallCommand.cs b/src/Network/Network/AzureFirewall/NewAzureFirewallCommand.cs index 7fd04111a6cf..3adbfba8ac59 100644 --- a/src/Network/Network/AzureFirewall/NewAzureFirewallCommand.cs +++ b/src/Network/Network/AzureFirewall/NewAzureFirewallCommand.cs @@ -175,8 +175,8 @@ public class NewAzureFirewallCommand : AzureFirewallBaseCmdlet ValueFromPipelineByPropertyName = true, HelpMessage = "The sku name for firewall")] [ValidateSet( - MNM.AzureFirewallSkuName.AZFWHub, - MNM.AzureFirewallSkuName.AZFWVNet, + MNM.AzureFirewallSkuName.AzfwHub, + MNM.AzureFirewallSkuName.AzfwVnet, IgnoreCase = false)] public string SkuName { get; set; } @@ -268,7 +268,7 @@ private PSAzureFirewall CreateAzureFirewall() { var firewall = new PSAzureFirewall(); var sku = new PSAzureFirewallSku(); - sku.Name = !string.IsNullOrEmpty(this.SkuName) ? this.SkuName : MNM.AzureFirewallSkuName.AZFWVNet; + sku.Name = !string.IsNullOrEmpty(this.SkuName) ? this.SkuName : MNM.AzureFirewallSkuName.AzfwVnet; sku.Tier = !string.IsNullOrEmpty(this.SkuTier) ? this.SkuTier : MNM.AzureFirewallSkuTier.Standard; if (sku.Tier.Equals(MNM.AzureFirewallSkuTier.Basic) && !string.IsNullOrEmpty(this.Location)) @@ -278,7 +278,7 @@ private PSAzureFirewall CreateAzureFirewall() throw new ArgumentException("Basic Sku Firewall is not supported in this region yet - " + this.Location, nameof(this.Location)); } } - if (this.SkuName == MNM.AzureFirewallSkuName.AZFWHub) + if (this.SkuName == MNM.AzureFirewallSkuName.AzfwHub) { if (VirtualHubId != null && this.Location != null) diff --git a/src/Network/Network/AzureFirewallPolicy/AzureFirewallPolicyNetworkRuleProtocolHelper.cs b/src/Network/Network/AzureFirewallPolicy/AzureFirewallPolicyNetworkRuleProtocolHelper.cs index 8f116e9f10ca..862daf790d67 100644 --- a/src/Network/Network/AzureFirewallPolicy/AzureFirewallPolicyNetworkRuleProtocolHelper.cs +++ b/src/Network/Network/AzureFirewallPolicy/AzureFirewallPolicyNetworkRuleProtocolHelper.cs @@ -25,7 +25,7 @@ public static class AzureFirewallPolicyNetworkRuleProtocolHelper MNM.AzureFirewallNetworkRuleProtocol.Any, MNM.AzureFirewallNetworkRuleProtocol.TCP, MNM.AzureFirewallNetworkRuleProtocol.UDP, - MNM.AzureFirewallNetworkRuleProtocol.ICMP + MNM.AzureFirewallNetworkRuleProtocol.Icmp }).ToDictionary(item => item.ToUpper()); private static readonly IDictionary SupportedNatRuleProtocols = (new string[]{ diff --git a/src/Network/Network/AzureFirewallPolicy/IntrusionDetection/NewAzureFirewallPolicyIntrusionDetectionBypassTrafficSettingCommand.cs b/src/Network/Network/AzureFirewallPolicy/IntrusionDetection/NewAzureFirewallPolicyIntrusionDetectionBypassTrafficSettingCommand.cs index 7b252f7dc75d..e53864986e57 100644 --- a/src/Network/Network/AzureFirewallPolicy/IntrusionDetection/NewAzureFirewallPolicyIntrusionDetectionBypassTrafficSettingCommand.cs +++ b/src/Network/Network/AzureFirewallPolicy/IntrusionDetection/NewAzureFirewallPolicyIntrusionDetectionBypassTrafficSettingCommand.cs @@ -49,7 +49,7 @@ public class NewAzureFirewallPolicyIntrusionDetectionBypassTrafficCommand : Netw [ValidateSet( MNM.FirewallPolicyIntrusionDetectionProtocol.TCP, MNM.FirewallPolicyIntrusionDetectionProtocol.UDP, - MNM.FirewallPolicyIntrusionDetectionProtocol.ICMP, + MNM.FirewallPolicyIntrusionDetectionProtocol.Icmp, MNM.FirewallPolicyIntrusionDetectionProtocol.ANY, IgnoreCase = false)] [ValidateNotNullOrEmpty] diff --git a/src/Network/Network/AzureFirewallPolicy/NetworkRuleCondition/NewAzureFirewallPolicyNetworkRuleCommand.cs b/src/Network/Network/AzureFirewallPolicy/NetworkRuleCondition/NewAzureFirewallPolicyNetworkRuleCommand.cs index 09c02241a952..21ca0c462bcd 100644 --- a/src/Network/Network/AzureFirewallPolicy/NetworkRuleCondition/NewAzureFirewallPolicyNetworkRuleCommand.cs +++ b/src/Network/Network/AzureFirewallPolicy/NetworkRuleCondition/NewAzureFirewallPolicyNetworkRuleCommand.cs @@ -81,7 +81,7 @@ public class NewAzureFirewallPolicyNetworkRuleCommand : NetworkBaseCmdlet MNM.AzureFirewallNetworkRuleProtocol.Any, MNM.AzureFirewallNetworkRuleProtocol.TCP, MNM.AzureFirewallNetworkRuleProtocol.UDP, - MNM.AzureFirewallNetworkRuleProtocol.ICMP, + MNM.AzureFirewallNetworkRuleProtocol.Icmp, IgnoreCase = false)] public string[] Protocol { get; set; } diff --git a/src/Network/Network/BYOIP/CustomIpPrefix/NewAzureCustomIpPrefixCommand.cs b/src/Network/Network/BYOIP/CustomIpPrefix/NewAzureCustomIpPrefixCommand.cs index 152a633ccdee..bad89e825f33 100644 --- a/src/Network/Network/BYOIP/CustomIpPrefix/NewAzureCustomIpPrefixCommand.cs +++ b/src/Network/Network/BYOIP/CustomIpPrefix/NewAzureCustomIpPrefixCommand.cs @@ -69,14 +69,14 @@ public class NewAzureCustomIpPrefixCommand : CustomIpPrefixBaseCmdlet ValueFromPipelineByPropertyName = true, HelpMessage = "The customIpPrefix GEO code.")] [ValidateSet( - MNM.Geo.AFRI, - MNM.Geo.APAC, + MNM.Geo.Afri, + MNM.Geo.Apac, MNM.Geo.AQ, - MNM.Geo.EURO, - MNM.Geo.LATAM, + MNM.Geo.Euro, + MNM.Geo.Latam, MNM.Geo.ME, MNM.Geo.NAM, - MNM.Geo.OCEANIA, + MNM.Geo.Oceania, IgnoreCase = true)] public string Geo { get; set; } diff --git a/src/Network/Network/Bastion/BastionBaseCmdlet.cs b/src/Network/Network/Bastion/BastionBaseCmdlet.cs index 022a8b48404a..bd677ccd1a98 100644 --- a/src/Network/Network/Bastion/BastionBaseCmdlet.cs +++ b/src/Network/Network/Bastion/BastionBaseCmdlet.cs @@ -100,7 +100,7 @@ public PSBastion GetBastion(string resourceGroupName, string name) psBastion.EnableKerberos = bastion.EnableKerberos; psBastion.DisableCopyPaste = bastion.DisableCopyPaste; psBastion.EnableTunneling = bastion.EnableTunneling; - psBastion.EnableIpConnect = bastion.EnableIpConnect; + psBastion.EnableIpConnect = bastion.EnableIPConnect; psBastion.EnableShareableLink = bastion.EnableShareableLink; return psBastion; @@ -115,7 +115,7 @@ public PSBastion ToPsBastion(MNM.BastionHost host) bastion.EnableKerberos = bastion.EnableKerberos; bastion.DisableCopyPaste = host.DisableCopyPaste; bastion.EnableTunneling = host.EnableTunneling; - bastion.EnableIpConnect = host.EnableIpConnect; + bastion.EnableIpConnect = host.EnableIPConnect; bastion.EnableShareableLink = host.EnableShareableLink; return bastion; diff --git a/src/Network/Network/ChangeLog.md b/src/Network/Network/ChangeLog.md index c5c3879c7e5f..9c94d6b551c9 100644 --- a/src/Network/Network/ChangeLog.md +++ b/src/Network/Network/ChangeLog.md @@ -19,6 +19,7 @@ ---> ## Upcoming Release +* Fixed a few minor issues ## Version 7.1.0 * Added DefaultOutboundAccess parameter on subnet creation diff --git a/src/Network/Network/Common/NetworkClient.cs b/src/Network/Network/Common/NetworkClient.cs index ef37d05eafd9..ba6bd76735d8 100644 --- a/src/Network/Network/Common/NetworkClient.cs +++ b/src/Network/Network/Common/NetworkClient.cs @@ -151,7 +151,7 @@ public async Task> GeneratevpnclientpackageWithHt // Create HTTP transport objects HttpRequestMessage httpRequest = new HttpRequestMessage(); - httpRequest.Method = new HttpMethod("POST"); + httpRequest.Method = new System.Net.Http.HttpMethod("POST"); httpRequest.RequestUri = new Uri(url); // Set Headers httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); @@ -216,7 +216,7 @@ public async Task> GeneratevpnclientpackageWithHt while (true) { HttpRequestMessage newHttpRequest = new HttpRequestMessage(); - newHttpRequest.Method = new HttpMethod("GET"); + newHttpRequest.Method = new System.Net.Http.HttpMethod("GET"); newHttpRequest.RequestUri = new Uri(locationResultsUrl); if (NetworkManagementClient.Credentials != null) @@ -305,7 +305,7 @@ public async Task> GenerateVpnProfileWithHttpMess // Create HTTP transport objects HttpRequestMessage httpRequest = new HttpRequestMessage(); - httpRequest.Method = new HttpMethod("POST"); + httpRequest.Method = new System.Net.Http.HttpMethod("POST"); httpRequest.RequestUri = new Uri(url); // Set Headers httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); @@ -368,7 +368,7 @@ public async Task> GenerateVpnProfileWithHttpMess while (true) { HttpRequestMessage newHttpRequest = new HttpRequestMessage(); - newHttpRequest.Method = new HttpMethod("GET"); + newHttpRequest.Method = new System.Net.Http.HttpMethod("GET"); newHttpRequest.RequestUri = new Uri(locationResultsUrl); if (NetworkManagementClient.Credentials != null) @@ -448,7 +448,7 @@ public async Task> GetVpnProfilePackageUrlWithHtt // Create HTTP transport objects HttpRequestMessage httpRequest = new HttpRequestMessage(); - httpRequest.Method = new HttpMethod("POST"); + httpRequest.Method = new System.Net.Http.HttpMethod("POST"); httpRequest.RequestUri = new Uri(url); // Set Headers @@ -507,7 +507,7 @@ public async Task> GetVpnProfilePackageUrlWithHtt while (true) { HttpRequestMessage newHttpRequest = new HttpRequestMessage(); - newHttpRequest.Method = new HttpMethod("GET"); + newHttpRequest.Method = new System.Net.Http.HttpMethod("GET"); newHttpRequest.RequestUri = new Uri(locationResultsUrl); if (NetworkManagementClient.Credentials != null) @@ -725,7 +725,7 @@ public async Task> ExecuteOperationWithHttpMessag // Create HTTP transport objects HttpRequestMessage httpRequest = new HttpRequestMessage(); - httpRequest.Method = new HttpMethod("POST"); + httpRequest.Method = new System.Net.Http.HttpMethod("POST"); httpRequest.RequestUri = new Uri(apiUrl); // Set Headers httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); @@ -789,7 +789,7 @@ public async Task> ExecuteOperationWithHttpMessag while (true) { HttpRequestMessage newHttpRequest = new HttpRequestMessage(); - newHttpRequest.Method = new HttpMethod("GET"); + newHttpRequest.Method = new System.Net.Http.HttpMethod("GET"); newHttpRequest.RequestUri = new Uri(locationResultsUrl); if (NetworkManagementClient.Credentials != null) diff --git a/src/Network/Network/Common/NetworkResourceManagerProfile.cs b/src/Network/Network/Common/NetworkResourceManagerProfile.cs index 2b5723ced434..10b441a0f1e7 100644 --- a/src/Network/Network/Common/NetworkResourceManagerProfile.cs +++ b/src/Network/Network/Common/NetworkResourceManagerProfile.cs @@ -130,13 +130,13 @@ private static void MapSecurityRuleCommandToManagement(CnmType private static void MapRouteTableV2sToRouteTables(MnmType mnmObj, CnmType cnmObj) { /* - * MNM type Virtual Hub contains the property VirtualHubRouteTableV2s which + * MNM type Virtual Hub contains the property VirtualHubRouteTableV2S which * maps to the RouteTables property of the CNM type VirtualHub * So, we get the value of RouteTableV2s from the MNM obj and * set it to the RouteTables property of the CNM obj. */ string psRouteTablesPropName = "RouteTables"; - string mnmRouteTableV2sPropName = "VirtualHubRouteTableV2s"; + string mnmRouteTableV2sPropName = "VirtualHubRouteTableV2S"; var cnmRouteTablesProp = typeof(CnmType).GetProperty(psRouteTablesPropName); @@ -181,7 +181,7 @@ private static void MapRouteTableV2sToRouteTables(MnmType mnmO private static void MapRouteTablesToRouteTableV2s(CnmType cnmObj, MnmType mnmObj) { string psRouteTablesPropName = "RouteTables"; - string mnmRouteTableV2sPropName = "VirtualHubRouteTableV2s"; + string mnmRouteTableV2sPropName = "VirtualHubRouteTableV2S"; var mnmRouteTableV2sProp = typeof(MnmType).GetProperty(mnmRouteTableV2sPropName); @@ -254,8 +254,24 @@ private static void Initialize() cfg.CreateMap(); // Nat Gateway - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIPAddresses, + opt => opt.MapFrom(src => src.PublicIpAddresses) + ) + .ForMember( + dest => dest.PublicIPPrefixes, + opt => opt.MapFrom(src => src.PublicIpPrefixes) + ); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIpAddresses, + opt => opt.MapFrom(src => src.PublicIPAddresses) + ) + .ForMember( + dest => dest.PublicIpPrefixes, + opt => opt.MapFrom(src => src.PublicIPPrefixes) + ); cfg.CreateMap(); cfg.CreateMap(); @@ -276,6 +292,14 @@ private static void Initialize() cfg.CreateMap() .ForMember(dest => dest.AddressPrefix, opt => opt.Ignore()) .ForMember(dest => dest.AddressPrefixes, opt => opt.Ignore()) + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ) + .ForMember( + dest => dest.IPAllocations, + opt => opt.MapFrom(src => src.IpAllocations) + ) .AfterMap((src, dest) => { if (GeneralUtilities.HasMoreThanOneElement(src.AddressPrefix)) @@ -298,6 +322,14 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap() .ForMember(dest => dest.AddressPrefix, opt => opt.Ignore()) + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ) + .ForMember( + dest => dest.IpAllocations, + opt => opt.MapFrom(src => src.IPAllocations) + ) .AfterMap((src, dest) => { if (src.AddressPrefixes != null && src.AddressPrefixes.Any()) @@ -378,7 +410,11 @@ private static void Initialize() // CNM to MNM cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPAllocations, + opt => opt.MapFrom(src => src.IpAllocations) + ); cfg.CreateMap(); cfg.CreateMap(); @@ -386,6 +422,10 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap() + .ForMember( + dest => dest.IpAllocations, + opt => opt.MapFrom(src => src.IPAllocations) + ) .ForMember( dest => dest.ExtendedLocation, opt => opt.MapFrom(src => @@ -396,14 +436,42 @@ private static void Initialize() // PublicIpAddress // CNM to MNM - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfiguration, + opt => opt.MapFrom(src => src.IpConfiguration) + ) + .ForMember( + dest => dest.IPTags, + opt => opt.MapFrom(src => src.IpTags) + ) + .ForMember( + dest => dest.IPAddress, + opt => opt.MapFrom(src => src.IpAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IPTagType, + opt => opt.MapFrom(src => src.IpTagType) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); // MNM to CNM cfg.CreateMap() + .ForMember( + dest => dest.IpConfiguration, + opt => opt.MapFrom(src => src.IPConfiguration) + ) + .ForMember( + dest => dest.IpTags, + opt => opt.MapFrom(src => src.IPTags) + ) + .ForMember( + dest => dest.IpAddress, + opt => opt.MapFrom(src => src.IPAddress) + ) .ForMember( dest => dest.ExtendedLocation, opt => opt.MapFrom(src => @@ -413,34 +481,82 @@ private static void Initialize() opt => opt.MapFrom(src => (src.DdosSettings ?? new MNM.DdosSettings())) ); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpTagType, + opt => opt.MapFrom(src => src.IPTagType) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); // PublicIpPrefix // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPTags, + opt => opt.MapFrom(src => src.IpTags) + ); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPTagType, + opt => opt.MapFrom(src => src.IpTagType) + ); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpTags, + opt => opt.MapFrom(src => src.IPTags) + ); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpTagType, + opt => opt.MapFrom(src => src.IPTagType) + ); cfg.CreateMap(); // CustomIpPrefix // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.CustomIPPrefixParent, + opt => opt.MapFrom(src => src.CustomIpPrefixParent) + ) + .ForMember( + dest => dest.ChildCustomIPPrefixes, + opt => opt.MapFrom(src => src.ChildCustomIpPrefixes) + ) + .ForMember( + dest => dest.PublicIPPrefixes, + opt => opt.MapFrom(src => src.PublicIpPrefixes) + ); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.CustomIpPrefixParent, + opt => opt.MapFrom(src => src.CustomIPPrefixParent) + ) + .ForMember( + dest => dest.ChildCustomIpPrefixes, + opt => opt.MapFrom(src => src.ChildCustomIPPrefixes) + ) + .ForMember( + dest => dest.PublicIpPrefixes, + opt => opt.MapFrom(src => src.PublicIPPrefixes) + ); // NetworkInterface // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -448,6 +564,10 @@ private static void Initialize() // MNM to CNM cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ) .ForMember( dest => dest.ExtendedLocation, opt => opt.MapFrom(src => @@ -521,10 +641,18 @@ private static void Initialize() // NextHop // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIPAddress, + opt => opt.MapFrom(src => src.NextHopIpAddress) + ); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIpAddress, + opt => opt.MapFrom(src => src.NextHopIPAddress) + ); // Troubleshoot // CNM to MNM @@ -556,12 +684,36 @@ private static void Initialize() // CheckConnectivity // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AvgLatencyInMS, + opt => opt.MapFrom(src => src.AvgLatencyInMs) + ) + .ForMember( + dest => dest.MinLatencyInMS, + opt => opt.MapFrom(src => src.MinLatencyInMs) + ) + .ForMember( + dest => dest.MaxLatencyInMS, + opt => opt.MapFrom(src => src.MaxLatencyInMs) + ); cfg.CreateMap(); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AvgLatencyInMs, + opt => opt.MapFrom(src => src.AvgLatencyInMS) + ) + .ForMember( + dest => dest.MinLatencyInMs, + opt => opt.MapFrom(src => src.MinLatencyInMS) + ) + .ForMember( + dest => dest.MaxLatencyInMs, + opt => opt.MapFrom(src => src.MaxLatencyInMS) + ); cfg.CreateMap(); cfg.CreateMap(); @@ -605,9 +757,17 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PreferHttps, + opt => opt.MapFrom(src => src.PreferHTTPS) + ); + cfg.CreateMap() + .ForMember( + dest => dest.RoundTripTimeMS, + opt => opt.MapFrom(src => src.RoundTripTimeMs) + ); + cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -624,9 +784,17 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PreferHTTPS, + opt => opt.MapFrom(src => src.PreferHttps) + ); + cfg.CreateMap() + .ForMember( + dest => dest.RoundTripTimeMs, + opt => opt.MapFrom(src => src.RoundTripTimeMS) + ); + cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -671,11 +839,19 @@ private static void Initialize() // LoadBalancerBackendAddress // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPAddress, + opt => opt.MapFrom(src => src.IpAddress) + ); // LoadBalancerBackendAddress // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpAddress, + opt => opt.MapFrom(src => src.IPAddress) + ); // InboundNatRulePortMapping // CNM to MNM @@ -761,17 +937,33 @@ private static void Initialize() // Route // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIPAddress, + opt => opt.MapFrom(src => src.NextHopIpAddress) + ); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIpAddress, + opt => opt.MapFrom(src => src.NextHopIPAddress) + ); // EffectiveRouteTable // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIPAddress, + opt => opt.MapFrom(src => src.NextHopIpAddress) + ); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIpAddress, + opt => opt.MapFrom(src => src.NextHopIPAddress) + ); // EffectiveNetworkSecurityGroup // CNM to MNM @@ -817,7 +1009,16 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AzureAsn, + opt => opt.MapFrom(src => src.AzureASN) + ) + .ForMember( + dest => dest.PeerAsn, + opt => opt.MapFrom(src => src.PeerASN) + ); + cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -826,10 +1027,22 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AzureASN, + opt => opt.MapFrom(src => src.AzureAsn) + ) + .ForMember( + dest => dest.PeerASN, + opt => opt.MapFrom(src => src.PeerAsn) + ); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPAddress, + opt => opt.MapFrom(src => src.IpAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -837,13 +1050,19 @@ private static void Initialize() // ExpressRouteCircuitPeering // CNM to MNM - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.CustomerAsn, + opt => opt.MapFrom(src => src.CustomerASN) + ); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.CustomerASN, + opt => opt.MapFrom(src => src.CustomerAsn) + ); cfg.CreateMap(); // Express Route Circuit Connection @@ -869,7 +1088,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpAddress, + opt => opt.MapFrom(src => src.IPAddress) + ); cfg.CreateMap(); cfg.CreateMap(); @@ -884,37 +1107,71 @@ private static void Initialize() // CNM to MNM cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AzureAsn, + opt => opt.MapFrom(src => src.AzureASN) + ) + .ForMember( + dest => dest.PeerAsn, + opt => opt.MapFrom(src => src.PeerASN) + ); cfg.CreateMap(); cfg.CreateMap(); // MNM to CNM cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AzureASN, + opt => opt.MapFrom(src => src.AzureAsn) + ) + .ForMember( + dest => dest.PeerASN, + opt => opt.MapFrom(src => src.PeerAsn) + ); // ExpressRouteCrossConnectionPeering // CNM to MNM - cfg.CreateMap(); - cfg.CreateMap(); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap(); - cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); // Gateways // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ) + .ForMember( + dest => dest.EnablePrivateIPAddress, + opt => opt.MapFrom(src => src.EnablePrivateIpAddress) + ) + .ForMember( + dest => dest.Active, + opt => opt.MapFrom(src => src.ActiveActive) + ); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.GatewayIPAddress, + opt => opt.MapFrom(src => src.GatewayIpAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.GatewayCustomBgpIPAddresses, + opt => opt.MapFrom(src => src.GatewayCustomBgpIpAddresses) + ) + .ForMember( + dest => dest.UseLocalAzureIPAddress, + opt => opt.MapFrom(src => src.UseLocalAzureIpAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -932,21 +1189,81 @@ private static void Initialize() }); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIPAddress, + opt => opt.MapFrom(src => src.PublicIpAddress) + ) + .ForMember( + dest => dest.PrivateIPAddress, + opt => opt.MapFrom(src => src.PrivateIpAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.DefaultBgpIPAddresses, + opt => opt.MapFrom(src => src.DefaultBgpIpAddresses) + ) + .ForMember( + dest => dest.CustomBgpIPAddresses, + opt => opt.MapFrom(src => src.CustomBgpIpAddresses) + ) + .ForMember( + dest => dest.TunnelIPAddresses, + opt => opt.MapFrom(src => src.TunnelIpAddresses) + ); + cfg.CreateMap() + .ForMember( + dest => dest.PropertiesType, + opt => opt.MapFrom(src => src.VirtualNetworkGatewayNatRulePropertiesType) + ) + .ForMember( + dest => dest.IPConfigurationId, + opt => opt.MapFrom(src => src.IpConfigurationId) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurationId, + opt => opt.MapFrom(src => src.IpconfigurationId) + ) + .ForMember( + dest => dest.CustomBgpIPAddress, + opt => opt.MapFrom(src => src.CustomBgpIpAddress) + ); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ) + .ForMember( + dest => dest.EnablePrivateIpAddress, + opt => opt.MapFrom(src => src.EnablePrivateIPAddress) + ) + .ForMember( + dest => dest.ActiveActive, + opt => opt.MapFrom(src => src.Active) + ); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.GatewayIpAddress, + opt => opt.MapFrom(src => src.GatewayIPAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.GatewayCustomBgpIpAddresses, + opt => opt.MapFrom(src => src.GatewayCustomBgpIPAddresses) + ) + .ForMember( + dest => dest.UseLocalAzureIpAddress, + opt => opt.MapFrom(src => src.UseLocalAzureIPAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -960,14 +1277,50 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIpAddress, + opt => opt.MapFrom(src => src.PublicIPAddress) + ) + .ForMember( + dest => dest.PrivateIpAddress, + opt => opt.MapFrom(src => src.PrivateIPAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.DefaultBgpIpAddresses, + opt => opt.MapFrom(src => src.DefaultBgpIPAddresses) + ) + .ForMember( + dest => dest.CustomBgpIpAddresses, + opt => opt.MapFrom(src => src.CustomBgpIPAddresses) + ) + .ForMember( + dest => dest.TunnelIpAddresses, + opt => opt.MapFrom(src => src.TunnelIPAddresses) + ); + cfg.CreateMap() + .ForMember( + dest => dest.VirtualNetworkGatewayNatRulePropertiesType, + opt => opt.MapFrom(src => src.PropertiesType) + ) + .ForMember( + dest => dest.IpConfigurationId, + opt => opt.MapFrom(src => src.IPConfigurationId) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpconfigurationId, + opt => opt.MapFrom(src => src.IPConfigurationId) + ) + .ForMember( + dest => dest.CustomBgpIpAddress, + opt => opt.MapFrom(src => src.CustomBgpIPAddress) + ); // Application Gateways // CNM to MNM @@ -979,13 +1332,21 @@ private static void Initialize() dest.CipherSuites = src.CipherSuites == null ? null : dest.CipherSuites; dest.DisabledSslProtocols = src.DisabledSslProtocols == null ? null : dest.DisabledSslProtocols; }); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.VerifyClientCertIssuerDn, + opt => opt.MapFrom(src => src.VerifyClientCertIssuerDN) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap() .AfterMap((src, dest) => dest.StatusCodes = (src.StatusCodes == null) ? null : dest.StatusCodes); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPAddress, + opt => opt.MapFrom(src => src.IpAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1009,12 +1370,20 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.ClientCertIssuerDn, + opt => opt.MapFrom(src => src.ClientCertIssuerDN) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfiguration, + opt => opt.MapFrom(src => src.IpConfiguration) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1022,7 +1391,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.RequestBodyInspectLimitInKb, + opt => opt.MapFrom(src => src.RequestBodyInspectLimitInKB) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1045,7 +1418,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1059,13 +1436,21 @@ private static void Initialize() dest.CipherSuites = src.CipherSuites == null ? null : dest.CipherSuites; dest.DisabledSslProtocols = src.DisabledSslProtocols == null ? null : dest.DisabledSslProtocols; }); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.VerifyClientCertIssuerDN, + opt => opt.MapFrom(src => src.VerifyClientCertIssuerDn) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap() .AfterMap((src, dest) => dest.StatusCodes = (src.StatusCodes == null) ? null : dest.StatusCodes); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpAddress, + opt => opt.MapFrom(src => src.IPAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1089,12 +1474,20 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.ClientCertIssuerDN, + opt => opt.MapFrom(src => src.ClientCertIssuerDn) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfiguration, + opt => opt.MapFrom(src => src.IPConfiguration) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1102,7 +1495,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.RequestBodyInspectLimitInKB, + opt => opt.MapFrom(src => src.RequestBodyInspectLimitInKb) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1125,7 +1522,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1165,7 +1566,12 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ); + cfg.CreateMap(); cfg.CreateMap(); @@ -1174,40 +1580,89 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ); cfg.CreateMap(); cfg.CreateMap(); //// VirtualWan cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ) .AfterMap((src, dest) => { MapRouteTablesToRouteTableV2s(src, dest); }); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PropertiesType, + opt => opt.MapFrom(src => src.VirtualWANType) + ); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIPAddress, + opt => opt.MapFrom(src => src.NextHopIpAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ); + cfg.CreateMap() + .ForMember( + dest => dest.PropertiesType, + opt => opt.MapFrom(src => src.VpnGatewayNatRulePropertiesType) + ); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIPAddress, + opt => opt.MapFrom(src => src.PublicIpAddress) + ) + .ForMember( + dest => dest.PrivateIPAddress, + opt => opt.MapFrom(src => src.PrivateIpAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.UseLocalAzureIPAddress, + opt => opt.MapFrom(src => src.UseLocalAzureIpAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IPAddress, + opt => opt.MapFrom(src => src.IpAddress) + ); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap().AfterMap((src, dest) => - { - if (src.BgpSettings != null) + cfg.CreateMap() + .ForMember( + dest => dest.UseLocalAzureIPAddress, + opt => opt.MapFrom(src => src.UseLocalAzureIpAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IPAddress, + opt => opt.MapFrom(src => src.IpAddress) + ) + .AfterMap((src, dest) => { - dest.BgpProperties = new MNM.BgpSettings(src.BgpSettings.Asn, src.BgpSettings.BgpPeeringAddress, src.BgpSettings.PeerWeight); - } - }); + if (src.BgpSettings != null) + { + dest.BgpProperties = new MNM.BgpSettings(src.BgpSettings.Asn, src.BgpSettings.BgpPeeringAddress, src.BgpSettings.PeerWeight); + } + }); cfg.CreateMap(); cfg.CreateMap(); @@ -1216,8 +1671,16 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.VirtualWANType, + opt => opt.MapFrom(src => src.PropertiesType) + ); cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ) .AfterMap((src, dest) => { MapRouteTableV2sToRouteTables(src, dest); @@ -1225,31 +1688,68 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIpAddress, + opt => opt.MapFrom(src => src.NextHopIPAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ); + cfg.CreateMap() + .ForMember( + dest => dest.VpnGatewayNatRulePropertiesType, + opt => opt.MapFrom(src => src.PropertiesType) + ); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap().AfterMap((src, dest) => - { - if (src.BgpProperties != null) + cfg.CreateMap() + .ForMember( + dest => dest.PublicIpAddress, + opt => opt.MapFrom(src => src.PublicIPAddress) + ) + .ForMember( + dest => dest.PrivateIpAddress, + opt => opt.MapFrom(src => src.PrivateIPAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.UseLocalAzureIpAddress, + opt => opt.MapFrom(src => src.UseLocalAzureIPAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IpAddress, + opt => opt.MapFrom(src => src.IPAddress) + ) + .AfterMap((src, dest) => { - dest.BgpSettings = new CNM.PSBgpSettings() + if (src.BgpProperties != null) { - Asn = src.BgpProperties.Asn, - BgpPeeringAddress = src.BgpProperties.BgpPeeringAddress, - PeerWeight = src.BgpProperties.PeerWeight - }; - } - }); + dest.BgpSettings = new CNM.PSBgpSettings() + { + Asn = src.BgpProperties.Asn, + BgpPeeringAddress = src.BgpProperties.BgpPeeringAddress, + PeerWeight = src.BgpProperties.PeerWeight + }; + } + }); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.UseLocalAzureIpAddress, + opt => opt.MapFrom(src => src.UseLocalAzureIPAddress) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IpAddress, + opt => opt.MapFrom(src => src.IPAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1265,7 +1765,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIPAddress, + opt => opt.MapFrom(src => src.NextHopIpAddress) + ); cfg.CreateMap(); // MNM to CNM @@ -1273,7 +1777,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.NextHopIpAddress, + opt => opt.MapFrom(src => src.NextHopIPAddress) + ); cfg.CreateMap(); //// Virtual Hub Routing Intent @@ -1314,7 +1822,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AllocatedIpAddresses, + opt => opt.MapFrom(src => src.AllocatedIPAddresses) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1332,7 +1844,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.AllocatedIPAddresses, + opt => opt.MapFrom(src => src.AllocatedIpAddresses) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1352,37 +1868,75 @@ private static void Initialize() // Azure Firewalls // CNM to MNM - cfg.CreateMap().AfterMap((src, dest) => - { - dest.AdditionalProperties = new Dictionary() + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ) + .ForMember( + dest => dest.ManagementIPConfiguration, + opt => opt.MapFrom(src => src.ManagementIpConfiguration) + ) + .AfterMap((src, dest) => { - { "ThreatIntel.Whitelist.FQDNs", src.ThreatIntelWhitelist?.FQDNs?.Aggregate((result, item) => result + "," + item) }, - { "ThreatIntel.Whitelist.IpAddresses", src.ThreatIntelWhitelist?.IpAddresses?.Aggregate((result, item) => result + "," + item) }, - { "Network.SNAT.PrivateRanges", src.PrivateRange?.Aggregate((result, item) => result + "," + item) }, - { "Network.FTP.AllowActiveFTP", src.AllowActiveFTP }, - { "Network.DNS.EnableProxy", src.DNSEnableProxy }, - { "Network.DNS.Servers", src.DNSServer?.Aggregate((result, item) => result + "," + item) }, - { "Network.AdditionalLogs.EnableFatFlowLogging", src.EnableFatFlowLogging }, - { "Network.Logging.EnableUDPLogOptimization", src.EnableUDPLogOptimization }, - { "Network.RouteServerInfo.RouteServerID", src.RouteServerId }, - }.Where(kvp => kvp.Value != null).ToDictionary(key => key.Key, val => val.Value); // TODO: remove after backend code is refactored - }); + dest.AdditionalProperties = new Dictionary() + { + { "ThreatIntel.Whitelist.FQDNs", src.ThreatIntelWhitelist?.FQDNs?.Aggregate((result, item) => result + "," + item) }, + { "ThreatIntel.Whitelist.IpAddresses", src.ThreatIntelWhitelist?.IpAddresses?.Aggregate((result, item) => result + "," + item) }, + { "Network.SNAT.PrivateRanges", src.PrivateRange?.Aggregate((result, item) => result + "," + item) }, + { "Network.FTP.AllowActiveFTP", src.AllowActiveFTP }, + { "Network.DNS.EnableProxy", src.DNSEnableProxy }, + { "Network.DNS.Servers", src.DNSServer?.Aggregate((result, item) => result + "," + item) }, + { "Network.AdditionalLogs.EnableFatFlowLogging", src.EnableFatFlowLogging }, + { "Network.Logging.EnableUDPLogOptimization", src.EnableUDPLogOptimization }, + { "Network.RouteServerInfo.RouteServerID", src.RouteServerId }, + }.Where(kvp => kvp.Value != null).ToDictionary(key => key.Key, val => val.Value); // TODO: remove after backend code is refactored + }); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPPrefixes, + opt => opt.MapFrom(src => src.IpPrefixes) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.SourceIPGroups, + opt => opt.MapFrom(src => src.SourceIpGroups) + ); + cfg.CreateMap() + .ForMember( + dest => dest.SourceIPGroups, + opt => opt.MapFrom(src => src.SourceIpGroups) + ); + cfg.CreateMap() + .ForMember( + dest => dest.SourceIPGroups, + opt => opt.MapFrom(src => src.SourceIpGroups) + ) + .ForMember( + dest => dest.DestinationIPGroups, + opt => opt.MapFrom(src => src.DestinationIpGroups) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap().AfterMap((src, dest) => + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ) + .ForMember( + dest => dest.ManagementIpConfiguration, + opt => opt.MapFrom(src => src.ManagementIPConfiguration) + ) + .AfterMap((src, dest) => { // TODO: refactor after backend is refactored dest.ThreatIntelWhitelist = new CNM.PSAzureFirewallThreatIntelWhitelist(); @@ -1425,14 +1979,34 @@ private static void Initialize() } }); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpPrefixes, + opt => opt.MapFrom(src => src.IPPrefixes) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.SourceIpGroups, + opt => opt.MapFrom(src => src.SourceIPGroups) + ); + cfg.CreateMap() + .ForMember( + dest => dest.SourceIpGroups, + opt => opt.MapFrom(src => src.SourceIPGroups) + ); + cfg.CreateMap() + .ForMember( + dest => dest.SourceIpGroups, + opt => opt.MapFrom(src => src.SourceIPGroups) + ) + .ForMember( + dest => dest.DestinationIpGroups, + opt => opt.MapFrom(src => src.DestinationIPGroups) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1448,7 +2022,7 @@ private static void Initialize() // Azure Firewall Policies // CNM to MNM cfg.CreateMap(); - cfg.CreateMap().AfterMap((src, dst) => + cfg.CreateMap().AfterMap((src, dst) => { dst.AutoLearnPrivateRanges = string.IsNullOrEmpty(src.AutoLearnPrivateRanges) ? "Disabled" : src.AutoLearnPrivateRanges; }); @@ -1463,7 +2037,7 @@ private static void Initialize() // MNM to CNM cfg.CreateMap(); - cfg.CreateMap().AfterMap((src, dst) => + cfg.CreateMap().AfterMap((src, dst) => { dst.AutoLearnPrivateRanges = string.IsNullOrEmpty(src.AutoLearnPrivateRanges) ? "Disabled" : src.AutoLearnPrivateRanges; }); @@ -1480,8 +2054,16 @@ private static void Initialize() // MNM to CNM cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1501,8 +2083,24 @@ private static void Initialize() dest.ActionRequired = src.ActionsRequired; }); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.LoadBalancerFrontendIPConfigurations, + opt => opt.MapFrom(src => src.LoadBalancerFrontendIpConfigurations) + ) + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ); + cfg.CreateMap() + .ForMember( + dest => dest.LoadBalancerFrontendIpConfigurations, + opt => opt.MapFrom(src => src.LoadBalancerFrontendIPConfigurations) + ) + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ); cfg.CreateMap(); cfg.CreateMap().AfterMap((src, dest) => @@ -1522,35 +2120,81 @@ private static void Initialize() // Bastion // CNM to MNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPConfigurations, + opt => opt.MapFrom(src => src.IpConfigurations) + ).ForMember( + dest => dest.EnableIPConnect, + opt => opt.MapFrom(src => src.EnableIpConnect) + ); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IpConfigurations, + opt => opt.MapFrom(src => src.IPConfigurations) + ).ForMember( + dest => dest.EnableIpConnect, + opt => opt.MapFrom(src => src.EnableIPConnect) + ); cfg.CreateMap(); // Virtual Router // CNM to MNM cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PeerIP, + opt => opt.MapFrom(src => src.PeerIp) + ); + cfg.CreateMap() + .ForMember( + dest => dest.PeerIP, + opt => opt.MapFrom(src => src.PeerIp) + ); cfg.CreateMap(); cfg.CreateMap(); // MNM to CNM - cfg.CreateMap(); - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PeerIp, + opt => opt.MapFrom(src => src.PeerIP) + ); + cfg.CreateMap() + .ForMember( + dest => dest.PeerIp, + opt => opt.MapFrom(src => src.PeerIP) + ); + cfg.CreateMap() + .ForMember( + dest => dest.PeerIp, + opt => opt.MapFrom(src => src.PeerIP) + ); cfg.CreateMap(); cfg.CreateMap(); // IpGroup - cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.IPAddresses, + opt => opt.MapFrom(src => src.IpAddresses) + ); + cfg.CreateMap() + .ForMember( + dest => dest.IpAddresses, + opt => opt.MapFrom(src => src.IPAddresses) + ); // IpAllocation - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PropertiesType, + opt => opt.MapFrom(src => src.IpAllocationType) + ); cfg.CreateMap(); // Network Virtual Appliance & Sites @@ -1560,7 +2204,15 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIPAddress, + opt => opt.MapFrom(src => src.PublicIpAddress) + ) + .ForMember( + dest => dest.PrivateIPAddress, + opt => opt.MapFrom(src => src.PrivateIpAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -1574,7 +2226,15 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap() + .ForMember( + dest => dest.PublicIpAddress, + opt => opt.MapFrom(src => src.PublicIPAddress) + ) + .ForMember( + dest => dest.PrivateIpAddress, + opt => opt.MapFrom(src => src.PrivateIPAddress) + ); cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); diff --git a/src/Network/Network/Cortex/HubBgpConnection/NewAzVirtualHubBgpConnectionCommand.cs b/src/Network/Network/Cortex/HubBgpConnection/NewAzVirtualHubBgpConnectionCommand.cs index 17d77381edaa..d7e1f11b96cf 100644 --- a/src/Network/Network/Cortex/HubBgpConnection/NewAzVirtualHubBgpConnectionCommand.cs +++ b/src/Network/Network/Cortex/HubBgpConnection/NewAzVirtualHubBgpConnectionCommand.cs @@ -144,7 +144,7 @@ public override void Execute() { Name = this.Name, PeerAsn = this.PeerAsn, - PeerIp = this.PeerIp, + PeerIP = this.PeerIp, HubVirtualNetworkConnection = hubVnetConnection }; diff --git a/src/Network/Network/Cortex/HubBgpConnection/UpdateAzVirtualHubBgpConnectionCommand.cs b/src/Network/Network/Cortex/HubBgpConnection/UpdateAzVirtualHubBgpConnectionCommand.cs index 65f39bc6ecdf..3366b16df19b 100644 --- a/src/Network/Network/Cortex/HubBgpConnection/UpdateAzVirtualHubBgpConnectionCommand.cs +++ b/src/Network/Network/Cortex/HubBgpConnection/UpdateAzVirtualHubBgpConnectionCommand.cs @@ -231,7 +231,7 @@ public override void Execute() { Name = this.Name, PeerAsn = this.PeerAsn, - PeerIp = this.PeerIp, + PeerIP = this.PeerIp, HubVirtualNetworkConnection = hubVnetConnection }; diff --git a/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs b/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs index d14941cba5c3..8c37d2e7cde4 100644 --- a/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs +++ b/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs @@ -108,7 +108,7 @@ public override void Execute() } var req = new P2SVpnConnectionRequest(new List(VpnConnectionId)); - this.P2SVpnGatewayClient.DisconnectP2sVpnConnections(ResourceGroupName, Name, req); + this.P2SVpnGatewayClient.DisconnectP2SVpnConnections(ResourceGroupName, Name, req); WriteObject(existingP2SVpnGateway); } diff --git a/src/Network/Network/Cortex/P2SVpnGateway/GetAzureRmP2SVpnGatewayVpnProfileCommand.cs b/src/Network/Network/Cortex/P2SVpnGateway/GetAzureRmP2SVpnGatewayVpnProfileCommand.cs index e11e57b18c06..159e6a43904a 100644 --- a/src/Network/Network/Cortex/P2SVpnGateway/GetAzureRmP2SVpnGatewayVpnProfileCommand.cs +++ b/src/Network/Network/Cortex/P2SVpnGateway/GetAzureRmP2SVpnGatewayVpnProfileCommand.cs @@ -70,8 +70,8 @@ public class GetAzureRmP2SVpnGatewayVpnProfileCommand : P2SVpnGatewayBaseCmdlet Mandatory = false, HelpMessage = "Authentication Method")] [ValidateSet( - MNM.AuthenticationMethod.EAPTLS, - MNM.AuthenticationMethod.EAPMSCHAPv2, + MNM.AuthenticationMethod.Eaptls, + MNM.AuthenticationMethod.EapmschaPv2, IgnoreCase = true)] public string AuthenticationMethod { get; set; } @@ -106,7 +106,7 @@ public override void Execute() PSP2SVpnProfileParameters p2sVpnProfileParams = new PSP2SVpnProfileParameters(); p2sVpnProfileParams.AuthenticationMethod = string.IsNullOrWhiteSpace(this.AuthenticationMethod) - ? MNM.AuthenticationMethod.EAPTLS.ToString() + ? MNM.AuthenticationMethod.Eaptls.ToString() : this.AuthenticationMethod; var p2sVpnProfileParametersModel = NetworkResourceManagerProfile.Mapper.Map(p2sVpnProfileParams); diff --git a/src/Network/Network/Cortex/P2SVpnGateway/P2SVpnGatewayBaseCmdlet.cs b/src/Network/Network/Cortex/P2SVpnGateway/P2SVpnGatewayBaseCmdlet.cs index 6830088d98b3..adb85e66322d 100644 --- a/src/Network/Network/Cortex/P2SVpnGateway/P2SVpnGatewayBaseCmdlet.cs +++ b/src/Network/Network/Cortex/P2SVpnGateway/P2SVpnGatewayBaseCmdlet.cs @@ -29,11 +29,11 @@ public class P2SVpnGatewayBaseCmdlet : NetworkBaseCmdlet { public const string P2SConnectionConfigurationName = "P2SConnectionConfigDefault"; - public IP2sVpnGatewaysOperations P2SVpnGatewayClient + public IP2SVpnGatewaysOperations P2SVpnGatewayClient { get { - return NetworkClient.NetworkManagementClient.P2sVpnGateways; + return NetworkClient.NetworkManagementClient.P2SVpnGateways; } } diff --git a/src/Network/Network/Cortex/VirtualHubRouteTable/VirtualHubRouteTableBaseCmdlet.cs b/src/Network/Network/Cortex/VirtualHubRouteTable/VirtualHubRouteTableBaseCmdlet.cs index d5ef7633b6bb..8b03e86d21c3 100644 --- a/src/Network/Network/Cortex/VirtualHubRouteTable/VirtualHubRouteTableBaseCmdlet.cs +++ b/src/Network/Network/Cortex/VirtualHubRouteTable/VirtualHubRouteTableBaseCmdlet.cs @@ -22,11 +22,11 @@ namespace Microsoft.Azure.Commands.Network public class VirtualHubRouteTableBaseCmdlet : VirtualHubBaseCmdlet { - public IVirtualHubRouteTableV2sOperations VirtualHubRouteTablesClient + public IVirtualHubRouteTableV2SOperations VirtualHubRouteTablesClient { get { - return NetworkClient.NetworkManagementClient.VirtualHubRouteTableV2s; + return NetworkClient.NetworkManagementClient.VirtualHubRouteTableV2S; } } diff --git a/src/Network/Network/Cortex/VirtualWan/GetAzureRmVirtualWanVpnServerConfigurationVpnProfileCommand.cs b/src/Network/Network/Cortex/VirtualWan/GetAzureRmVirtualWanVpnServerConfigurationVpnProfileCommand.cs index b3945c43d075..ea4827df70a5 100644 --- a/src/Network/Network/Cortex/VirtualWan/GetAzureRmVirtualWanVpnServerConfigurationVpnProfileCommand.cs +++ b/src/Network/Network/Cortex/VirtualWan/GetAzureRmVirtualWanVpnServerConfigurationVpnProfileCommand.cs @@ -126,8 +126,8 @@ public class GetAzureRmVirtualWanVpnServerConfigurationVpnProfileCommand : Virtu Mandatory = false, HelpMessage = "Authentication Method")] [ValidateSet( - MNM.AuthenticationMethod.EAPTLS, - MNM.AuthenticationMethod.EAPMSCHAPv2, + MNM.AuthenticationMethod.Eaptls, + MNM.AuthenticationMethod.EapmschaPv2, IgnoreCase = true)] public string AuthenticationMethod { get; set; } @@ -162,7 +162,7 @@ public override void Execute() PSVirtualWanVpnProfileParameters virtualWanVpnProfileParams = new PSVirtualWanVpnProfileParameters(); virtualWanVpnProfileParams.AuthenticationMethod = string.IsNullOrWhiteSpace(this.AuthenticationMethod) - ? MNM.AuthenticationMethod.EAPTLS.ToString() + ? MNM.AuthenticationMethod.Eaptls.ToString() : this.AuthenticationMethod; if (this.VpnServerConfiguration != null) diff --git a/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs b/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs index 40d3cd08d93e..795f3a041844 100644 --- a/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs +++ b/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs @@ -23,11 +23,11 @@ namespace Microsoft.Azure.Commands.Network { public abstract class IpAllocationBaseCmdlet : NetworkBaseCmdlet { - public IIpAllocationsOperations IpAllocationClient + public IIPAllocationsOperations IpAllocationClient { get { - return NetworkClient.NetworkManagementClient.IpAllocations; + return NetworkClient.NetworkManagementClient.IPAllocations; } } diff --git a/src/Network/Network/IpGroup/IpGroupBaseCmdlet.cs b/src/Network/Network/IpGroup/IpGroupBaseCmdlet.cs index db8334da9baa..e5d381d6b4b5 100644 --- a/src/Network/Network/IpGroup/IpGroupBaseCmdlet.cs +++ b/src/Network/Network/IpGroup/IpGroupBaseCmdlet.cs @@ -24,11 +24,11 @@ namespace Microsoft.Azure.Commands.Network { public abstract class IpGroupBaseCmdlet : NetworkBaseCmdlet { - public IIpGroupsOperations IpGroupsClient + public IIPGroupsOperations IpGroupsClient { get { - return NetworkClient.NetworkManagementClient.IpGroups; + return NetworkClient.NetworkManagementClient.IPGroups; } } diff --git a/src/Network/Network/LoadBalancer/GetAzureLoadBalancerBackendAddressInboundNatRulePortMapping.cs b/src/Network/Network/LoadBalancer/GetAzureLoadBalancerBackendAddressInboundNatRulePortMapping.cs index 0439b665315c..753e1a808a03 100644 --- a/src/Network/Network/LoadBalancer/GetAzureLoadBalancerBackendAddressInboundNatRulePortMapping.cs +++ b/src/Network/Network/LoadBalancer/GetAzureLoadBalancerBackendAddressInboundNatRulePortMapping.cs @@ -104,13 +104,13 @@ public override void Execute() MNM.QueryInboundNatRulePortMappingRequest parameters = new MNM.QueryInboundNatRulePortMappingRequest(); if (!string.IsNullOrEmpty(this.IpAddress)) { - parameters.IpAddress = this.IpAddress; + parameters.IPAddress = this.IpAddress; } if (!string.IsNullOrEmpty(this.NetworkInterfaceIpConfigurationId)) { SubResource nic = new SubResource(this.NetworkInterfaceIpConfigurationId); - parameters.IpConfiguration = nic; + parameters.IPConfiguration = nic; } // Response diff --git a/src/Network/Network/NetworkInterface/NetworkInterfaceBaseCmdlet.cs b/src/Network/Network/NetworkInterface/NetworkInterfaceBaseCmdlet.cs index caff3ac86af4..4647853f42e4 100644 --- a/src/Network/Network/NetworkInterface/NetworkInterfaceBaseCmdlet.cs +++ b/src/Network/Network/NetworkInterface/NetworkInterfaceBaseCmdlet.cs @@ -79,13 +79,13 @@ public PSNetworkInterface GetScaleSetNetworkInterface(string resourceGroupName, public void NullifyApplicationSecurityGroupIfAbsent(NetworkInterface nic) { - if (nic == null || nic.IpConfigurations == null) + if (nic == null || nic.IPConfigurations == null) { return; } // Temporary - to be removed - foreach (var ipconfigModel in nic.IpConfigurations) + foreach (var ipconfigModel in nic.IPConfigurations) { if (ipconfigModel.ApplicationSecurityGroups != null && ipconfigModel.ApplicationSecurityGroups.Count == 0) { diff --git a/src/Network/Network/NetworkManager/GetAzNetworkManagerDeploymentStatusListCommand.cs b/src/Network/Network/NetworkManager/GetAzNetworkManagerDeploymentStatusListCommand.cs index e180b2ef5bfc..023e0c55c890 100644 --- a/src/Network/Network/NetworkManager/GetAzNetworkManagerDeploymentStatusListCommand.cs +++ b/src/Network/Network/NetworkManager/GetAzNetworkManagerDeploymentStatusListCommand.cs @@ -82,7 +82,7 @@ public override void Execute() parameter.SkipToken = this.SkipToken; } - var networkManagerDeploymentStatusResult = this.NetworkClient.NetworkManagementClient.NetworkManagerDeploymentStatus.List(parameter, this.ResourceGroupName, this.NetworkManagerName); + var networkManagerDeploymentStatusResult = this.NetworkClient.NetworkManagementClient.NetworkManagerDeploymentStatus.List(this.ResourceGroupName, this.NetworkManagerName, parameter); var pSNetworkManagerDeploymentStatusResult = NetworkResourceManagerProfile.Mapper.Map(networkManagerDeploymentStatusResult); WriteObject(pSNetworkManagerDeploymentStatusResult); } diff --git a/src/Network/Network/NetworkManager/NetworkGroup/NetworkManagerStaticMember/NewAzNetworkManagerStaticMemberCommand.cs b/src/Network/Network/NetworkManager/NetworkGroup/NetworkManagerStaticMember/NewAzNetworkManagerStaticMemberCommand.cs index 5aef588499db..9bfef68f8f16 100644 --- a/src/Network/Network/NetworkManager/NetworkGroup/NetworkManagerStaticMember/NewAzNetworkManagerStaticMemberCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkGroup/NetworkManagerStaticMember/NewAzNetworkManagerStaticMemberCommand.cs @@ -102,7 +102,7 @@ private PSNetworkManagerStaticMember CreateNetworkManagerStaticMember() // Map to the sdk object var networkManagerStaticMemberModel = NetworkResourceManagerProfile.Mapper.Map(psNetworkStaticMember); - this.NetworkManagerStaticMemberClient.CreateOrUpdate(networkManagerStaticMemberModel, this.ResourceGroupName, this.NetworkManagerName, this.NetworkGroupName, this.Name); + this.NetworkManagerStaticMemberClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.NetworkGroupName, this.Name, networkManagerStaticMemberModel); var networkManagerStaticMember = this.GetNetworkManagerStaticMember(this.ResourceGroupName, this.NetworkManagerName, this.NetworkGroupName, this.Name); return networkManagerStaticMember; diff --git a/src/Network/Network/NetworkManager/NetworkGroup/NewAzNetworkGroupCommand.cs b/src/Network/Network/NetworkManager/NetworkGroup/NewAzNetworkGroupCommand.cs index a9eb819cd4cd..ec43c22c6f00 100644 --- a/src/Network/Network/NetworkManager/NetworkGroup/NewAzNetworkGroupCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkGroup/NewAzNetworkGroupCommand.cs @@ -110,7 +110,7 @@ private PSNetworkManagerGroup CreateNetworkGroup() this.IfMatch = null; } - this.NetworkGroupClient.CreateOrUpdate(networkGroupModel, this.ResourceGroupName, this.NetworkManagerName, this.Name, this.IfMatch); + this.NetworkGroupClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.Name, networkGroupModel, this.IfMatch); var psNetworkManager = this.GetNetworkGroup(this.ResourceGroupName, this.NetworkManagerName, this.Name); return psNetworkManager; diff --git a/src/Network/Network/NetworkManager/NetworkGroup/SetAzNetworkGroupCommand.cs b/src/Network/Network/NetworkManager/NetworkGroup/SetAzNetworkGroupCommand.cs index b5611924929c..00358034cdf5 100644 --- a/src/Network/Network/NetworkManager/NetworkGroup/SetAzNetworkGroupCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkGroup/SetAzNetworkGroupCommand.cs @@ -51,7 +51,7 @@ public override void Execute() var groupModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); // Execute the PUT NetworkManagerGroup call - this.NetworkGroupClient.CreateOrUpdate(groupModel, this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); + this.NetworkGroupClient.CreateOrUpdate( this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name, groupModel); var psNetworGroup = this.GetNetworkGroup(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); WriteObject(psNetworGroup); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveConnectivityConfigurationCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveConnectivityConfigurationCommand.cs index 2f97800ee9ac..7c7b46423654 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveConnectivityConfigurationCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveConnectivityConfigurationCommand.cs @@ -71,7 +71,7 @@ public override void Execute() parameter.SkipToken = this.SkipToken; } - var networkManagerActiveConnectivityConfiguration = this.NetworkClient.NetworkManagementClient.ListActiveConnectivityConfigurations(parameter, this.ResourceGroupName, this.NetworkManagerName); + var networkManagerActiveConnectivityConfiguration = this.NetworkClient.NetworkManagementClient.ListActiveConnectivityConfigurations(this.ResourceGroupName, this.NetworkManagerName, parameter); var psActiveConnectivityConfiguration = NetworkResourceManagerProfile.Mapper.Map(networkManagerActiveConnectivityConfiguration); WriteObject(psActiveConnectivityConfiguration); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveSecurityAdminRuleCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveSecurityAdminRuleCommand.cs index 3c2fa261f3b2..467eb1ed1590 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveSecurityAdminRuleCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerActiveConfiguration/GetAzNetworkManagerActiveSecurityAdminRuleCommand.cs @@ -70,7 +70,7 @@ public override void Execute() parameter.SkipToken = this.SkipToken; } - var networkManagerActiveAdminRuleResult = this.NetworkClient.NetworkManagementClient.ListActiveSecurityAdminRules(parameter, this.ResourceGroupName, this.NetworkManagerName); + var networkManagerActiveAdminRuleResult = this.NetworkClient.NetworkManagementClient.ListActiveSecurityAdminRules(this.ResourceGroupName, this.NetworkManagerName, parameter); var pSNetworkManagerActiveSecurityAdminRules = new List(); foreach (var rule in networkManagerActiveAdminRuleResult.Value) diff --git a/src/Network/Network/NetworkManager/NetworkManagerBaseCmdlet.cs b/src/Network/Network/NetworkManager/NetworkManagerBaseCmdlet.cs index 1576fd022270..a500d46fc502 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerBaseCmdlet.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerBaseCmdlet.cs @@ -66,7 +66,7 @@ public PSNetworkManagerCommit PostNetworkManagerCommit(string resourceGroupName, commit.CommitType = commitType; commit.ConfigurationIds = configurationIds; commit.TargetLocations = targetLocations; - var commitResponse = this.NetworkManagerCommitClient.Post(commit, resourceGroupName, name); + var commitResponse = this.NetworkManagerCommitClient.Post(resourceGroupName, name, commit); var psNetworkManagerCommit = NetworkResourceManagerProfile.Mapper.Map(commitResponse); return psNetworkManagerCommit; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/NewAzNetworkManagerConnectivityConfigurationCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/NewAzNetworkManagerConnectivityConfigurationCommand.cs index 81cf839076c1..84fa87f99caa 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/NewAzNetworkManagerConnectivityConfigurationCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/NewAzNetworkManagerConnectivityConfigurationCommand.cs @@ -166,7 +166,7 @@ private PSNetworkManagerConnectivityConfiguration CreateNetworkManagerConnectivi this.NullifyNetworkManagerConnectivityConfigurationIfAbsent(mnccModel); // Execute the Create NetworkConnectivityGroup call - this.NetworkManagerConnectivityConfigurationClient.CreateOrUpdate(mnccModel, this.ResourceGroupName, this.NetworkManagerName, this.Name); + this.NetworkManagerConnectivityConfigurationClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.Name, mnccModel); var psNetworkManagerConnectivityConfiguration = this.GetNetworkManagerConnectivityConfiguration(this.ResourceGroupName, this.NetworkManagerName, this.Name); return psNetworkManagerConnectivityConfiguration; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/SetAzNetworkManagerConnectivityConfigurationCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/SetAzNetworkManagerConnectivityConfigurationCommand.cs index 96990777f631..4b155c7938a1 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/SetAzNetworkManagerConnectivityConfigurationCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerConnectivityConfiguration/SetAzNetworkManagerConnectivityConfigurationCommand.cs @@ -52,7 +52,7 @@ public override void Execute() // Execute the PUT NetworkManagerConnectivityConfiguration call - this.NetworkManagerConnectivityConfigurationClient.CreateOrUpdate(mnccModel, this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); + this.NetworkManagerConnectivityConfigurationClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name, mnccModel); var psNetworkManagerConnectivityConfiguration = this.GetNetworkManagerConnectivityConfiguration(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); WriteObject(psNetworkManagerConnectivityConfiguration); diff --git a/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveConnectivityConfigurationCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveConnectivityConfigurationCommand.cs index 1c350ee404fb..171f5165843c 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveConnectivityConfigurationCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveConnectivityConfigurationCommand.cs @@ -60,7 +60,7 @@ public override void Execute() parameter.SkipToken = this.SkipToken; } - var networkManagerEffectiveConnectivityConfiguration = this.NetworkClient.NetworkManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations(parameter, this.VirtualNetworkResourceGroupName, this.VirtualNetworkName); + var networkManagerEffectiveConnectivityConfiguration = this.NetworkClient.NetworkManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations(this.VirtualNetworkResourceGroupName, this.VirtualNetworkName, parameter); var psEffectiveConnectivityConfiguration = NetworkResourceManagerProfile.Mapper.Map(networkManagerEffectiveConnectivityConfiguration); WriteObject(psEffectiveConnectivityConfiguration); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveSecurityAdminRuleCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveSecurityAdminRuleCommand.cs index 33f5ced02ad2..060aca858c20 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveSecurityAdminRuleCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerEffectiveConfiguration/GetAzNetworkManagerEffectiveSecurityAdminRuleCommand.cs @@ -60,7 +60,7 @@ public override void Execute() parameter.SkipToken = this.SkipToken; } - var networkManagerEffectiveAdminRuleResult = this.NetworkClient.NetworkManagementClient.ListNetworkManagerEffectiveSecurityAdminRules(parameter, this.VirtualNetworkResourceGroupName, this.VirtualNetworkName); + var networkManagerEffectiveAdminRuleResult = this.NetworkClient.NetworkManagementClient.ListNetworkManagerEffectiveSecurityAdminRules(this.VirtualNetworkResourceGroupName, this.VirtualNetworkName, parameter); var pSNetworkManagerEffectiveSecurityAdminRules = new List(); foreach (var rule in networkManagerEffectiveAdminRuleResult.Value) diff --git a/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/NewAzNetworkManagerManagementGroupConnectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/NewAzNetworkManagerManagementGroupConnectionCommand.cs index 9e4b88db86c4..ac0b7ced7403 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/NewAzNetworkManagerManagementGroupConnectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/NewAzNetworkManagerManagementGroupConnectionCommand.cs @@ -97,7 +97,7 @@ private PSNetworkManagerConnection CreateNetworkManagerManagementGroupConnection this.NullifyNetworkManagerManagementGroupConnectionIfAbsent(mnccModel); // Execute the Create NetworkManagerManagementGroupConnection call - this.NetworkManagerManagementGroupConnectionClient.CreateOrUpdate(mnccModel, this.ManagementGroupId, this.Name); + this.NetworkManagerManagementGroupConnectionClient.CreateOrUpdate(this.ManagementGroupId, this.Name, mnccModel); var psNetworkManagerManagementGroupConnection = this.GetNetworkManagerManagementGroupConnection(this.ManagementGroupId, this.Name); return psNetworkManagerManagementGroupConnection; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/SetAzNetworkManagerManagementGroupConnectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/SetAzNetworkManagerManagementGroupConnectionCommand.cs index d20aa70e5a4a..4330154c6ce5 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/SetAzNetworkManagerManagementGroupConnectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerManagementGroupConnection/SetAzNetworkManagerManagementGroupConnectionCommand.cs @@ -51,7 +51,7 @@ public override void Execute() var networkManagerManagementGroupConnectionModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); // Execute the PUT NetworkManagerManagementGroupConnection call - this.NetworkManagerManagementGroupConnectionClient.CreateOrUpdate(networkManagerManagementGroupConnectionModel, this.InputObject.ScopeId, this.InputObject.Name); + this.NetworkManagerManagementGroupConnectionClient.CreateOrUpdate(this.InputObject.ScopeId, this.InputObject.Name, networkManagerManagementGroupConnectionModel); var psNetworkManagerConnection = this.GetNetworkManagerManagementGroupConnection(this.InputObject.ScopeId, this.InputObject.Name); WriteObject(psNetworkManagerConnection); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/NewAzNetworkManagerScopeConnectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/NewAzNetworkManagerScopeConnectionCommand.cs index ed44660ca8b8..1bc84c5d5080 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/NewAzNetworkManagerScopeConnectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/NewAzNetworkManagerScopeConnectionCommand.cs @@ -114,7 +114,7 @@ private PSNetworkManagerScopeConnection CreateNetworkManagerScopeConnection() this.NullifyNetworkManagerScopeConnectionIfAbsent(mnccModel); // Execute the Create NetworkManagerScopeConnection call - this.NetworkManagerScopeConnectionClient.CreateOrUpdate(mnccModel, this.ResourceGroupName, this.NetworkManagerName, this.Name); + this.NetworkManagerScopeConnectionClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.Name, mnccModel); var psNetworkManagerScopeConnection = this.GetNetworkManagerScopeConnection(this.ResourceGroupName, this.NetworkManagerName, this.Name); return psNetworkManagerScopeConnection; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/SetAzNetworkManagerScopeConnectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/SetAzNetworkManagerScopeConnectionCommand.cs index 6e86477de746..98fba8bbcf13 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/SetAzNetworkManagerScopeConnectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerScopeConnection/SetAzNetworkManagerScopeConnectionCommand.cs @@ -59,7 +59,7 @@ public override void Execute() // Map to the sdk object var scopeConnectionModel = NetworkResourceManagerProfile.Mapper.Map(psScopeConnectionModel); // Execute the PUT NetworkManagerScopeConnection call - this.NetworkManagerScopeConnectionClient.CreateOrUpdate(scopeConnectionModel, this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); + this.NetworkManagerScopeConnectionClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name, scopeConnectionModel); var psScopeConnection = this.GetNetworkManagerScopeConnection(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); WriteObject(psScopeConnection); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/NewAzNetworkManagerSecurityAdminRuleCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/NewAzNetworkManagerSecurityAdminRuleCommand.cs index b3fca8efafaa..198cfe42e2b0 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/NewAzNetworkManagerSecurityAdminRuleCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/NewAzNetworkManagerSecurityAdminRuleCommand.cs @@ -178,7 +178,7 @@ private PSNetworkManagerSecurityBaseAdminRule CreateNetworkManagerSecurityAdminR securityDefaultAdminRule.Flag = this.Flag; var securityDefaultAdminRuleModel = NetworkResourceManagerProfile.Mapper.Map(securityDefaultAdminRule); this.NullifySecurityAdminRuleIfAbsent(securityDefaultAdminRuleModel); - this.NetworkManagerSecurityAdminRuleOperationClient.CreateOrUpdate(securityDefaultAdminRuleModel, this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.RuleCollectionName, this.Name); + this.NetworkManagerSecurityAdminRuleOperationClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.RuleCollectionName, this.Name, securityDefaultAdminRuleModel); var psDefaultAdminRule = this.GetNetworkManagerSecurityAdminRule(this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.RuleCollectionName, this.Name); return psDefaultAdminRule; } @@ -212,7 +212,7 @@ private PSNetworkManagerSecurityBaseAdminRule CreateNetworkManagerSecurityAdminR } // Map to the sdk object var adminRuleModel = NetworkResourceManagerProfile.Mapper.Map(securityAdminRule); - var adminRuleResponse = this.NetworkManagerSecurityAdminRuleOperationClient.CreateOrUpdate(adminRuleModel, this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.RuleCollectionName, this.Name); + var adminRuleResponse = this.NetworkManagerSecurityAdminRuleOperationClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.RuleCollectionName, this.Name, adminRuleModel); var psAdminRule = this.ToPSSecurityAdminRule(adminRuleResponse); psAdminRule.ResourceGroupName = this.ResourceGroupName; psAdminRule.NetworkManagerName = this.NetworkManagerName; diff --git a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/SetAzNetworkManagerSecurityAdminRuleCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/SetAzNetworkManagerSecurityAdminRuleCommand.cs index ffef8607cc52..3fb13657b644 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/SetAzNetworkManagerSecurityAdminRuleCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NetworkManagerSecurityAdminRule/SetAzNetworkManagerSecurityAdminRuleCommand.cs @@ -59,7 +59,7 @@ public override void Execute() } // Execute the PUT NetworkManagerSecurityAdminRule call - var adminRuleResponse = this.NetworkManagerSecurityAdminRuleOperationClient.CreateOrUpdate(adminRuleModel, this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.SecurityAdminConfigurationName, this.InputObject.RuleCollectionName, this.InputObject.Name); + var adminRuleResponse = this.NetworkManagerSecurityAdminRuleOperationClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.SecurityAdminConfigurationName, this.InputObject.RuleCollectionName, this.InputObject.Name, adminRuleModel); var psAdminRule = this.ToPSSecurityAdminRule(adminRuleResponse); WriteObject(psAdminRule); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NewAzNetworkManagerSecurityAdminRuleCollectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NewAzNetworkManagerSecurityAdminRuleCollectionCommand.cs index 1cef8313d0cf..4c144f0c9f49 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NewAzNetworkManagerSecurityAdminRuleCollectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/NewAzNetworkManagerSecurityAdminRuleCollectionCommand.cs @@ -119,7 +119,7 @@ private PSNetworkManagerSecurityAdminRuleCollection CreateNetworkManagerSecurity // Execute the Create Security Rule Collection call - this.NetworkManagerSecurityAdminRuleCollectionClient.CreateOrUpdate(ruleCollectionModel, this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.Name); + this.NetworkManagerSecurityAdminRuleCollectionClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.Name, ruleCollectionModel); var psSecuirtyRuleCollection = this.GetNetworkManagerSecurityAdminRuleCollection(this.ResourceGroupName, this.NetworkManagerName, this.SecurityAdminConfigurationName, this.Name); return psSecuirtyRuleCollection; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/SetAzNetworkManagerSecurityAdminRuleCollectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/SetAzNetworkManagerSecurityAdminRuleCollectionCommand.cs index b6150a00df3c..0fea8334be95 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/SetAzNetworkManagerSecurityAdminRuleCollectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NetworkManagerSecurityAdminRuleCollection/SetAzNetworkManagerSecurityAdminRuleCollectionCommand.cs @@ -51,7 +51,7 @@ public override void Execute() var securityRuleCollectionModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); // Execute the PUT NetworkManagerSecurityAdminRuleCollection call - this.NetworkManagerSecurityAdminRuleCollectionClient.CreateOrUpdate(securityRuleCollectionModel, this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.SecurityAdminConfigurationName, this.InputObject.Name); + this.NetworkManagerSecurityAdminRuleCollectionClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.SecurityAdminConfigurationName, this.InputObject.Name, securityRuleCollectionModel); var psSecurityRuleCollection = this.GetNetworkManagerSecurityAdminRuleCollection(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.SecurityAdminConfigurationName, this.InputObject.Name); WriteObject(psSecurityRuleCollection); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NewAzNetworkManagerSecurityAdminConfigurationCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NewAzNetworkManagerSecurityAdminConfigurationCommand.cs index 592c4124f304..71aedcfdec61 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NewAzNetworkManagerSecurityAdminConfigurationCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/NewAzNetworkManagerSecurityAdminConfigurationCommand.cs @@ -141,7 +141,7 @@ private PSNetworkManagerSecurityAdminConfiguration CreateNetworkManagerSecurityA // Execute the Create Security Config call - this.NetworkManagerSecurityAdminConfigurationClient.CreateOrUpdate(securityConfigModel, this.ResourceGroupName, this.NetworkManagerName, this.Name); + this.NetworkManagerSecurityAdminConfigurationClient.CreateOrUpdate(this.ResourceGroupName, this.NetworkManagerName, this.Name, securityConfigModel); var psSecuirtyConfig = this.GetNetworkManagerSecurityAdminConfiguration(this.ResourceGroupName, this.NetworkManagerName, this.Name); return psSecuirtyConfig; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/SetAzNetworkManagerSecurityAdminConfigurationCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/SetAzNetworkManagerSecurityAdminConfigurationCommand.cs index 453b59f415bf..fba15f6c71a7 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/SetAzNetworkManagerSecurityAdminConfigurationCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSecurityAdminConfiguration/SetAzNetworkManagerSecurityAdminConfigurationCommand.cs @@ -51,7 +51,7 @@ public override void Execute() var securityConfigModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); // Execute the PUT NetworkManagerSecurityAdminConfiguration call - this.NetworkManagerSecurityAdminConfigurationClient.CreateOrUpdate(securityConfigModel, this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); + this.NetworkManagerSecurityAdminConfigurationClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name, securityConfigModel); var psSecurityConfig = this.GetNetworkManagerSecurityAdminConfiguration(this.InputObject.ResourceGroupName, this.InputObject.NetworkManagerName, this.InputObject.Name); WriteObject(psSecurityConfig); } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/NewAzNetworkManagerSubscriptionConnectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/NewAzNetworkManagerSubscriptionConnectionCommand.cs index 4c10bffcbe0a..85cec023ab63 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/NewAzNetworkManagerSubscriptionConnectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/NewAzNetworkManagerSubscriptionConnectionCommand.cs @@ -91,7 +91,7 @@ private PSNetworkManagerConnection CreateNetworkManagerSubscriptionConnection() this.NullifyNetworkManagerSubscriptionConnectionIfAbsent(mnccModel); // Execute the Create NetworkManagerSubscriptionConnection call - this.NetworkManagerSubscriptionConnectionClient.CreateOrUpdate(mnccModel, this.Name); + this.NetworkManagerSubscriptionConnectionClient.CreateOrUpdate(this.Name, mnccModel); var psNetworkManagerSubscriptionConnection = this.GetNetworkManagerSubscriptionConnection(this.Name); return psNetworkManagerSubscriptionConnection; } diff --git a/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/SetAzNetworkManagerSubscriptionConnectionCommand.cs b/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/SetAzNetworkManagerSubscriptionConnectionCommand.cs index f99ff84c3b9f..5b0ce00d807e 100644 --- a/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/SetAzNetworkManagerSubscriptionConnectionCommand.cs +++ b/src/Network/Network/NetworkManager/NetworkManagerSubscriptionConnection/SetAzNetworkManagerSubscriptionConnectionCommand.cs @@ -51,7 +51,7 @@ public override void Execute() var networkManagerSubscriptionConnectionModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); // Execute the PUT NetworkManagerSubscriptionConnection call - this.NetworkManagerSubscriptionConnectionClient.CreateOrUpdate(networkManagerSubscriptionConnectionModel, this.InputObject.Name); + this.NetworkManagerSubscriptionConnectionClient.CreateOrUpdate(this.InputObject.Name, networkManagerSubscriptionConnectionModel); var psNetworkManagerConnection = this.GetNetworkManagerSubscriptionConnection(this.InputObject.Name); WriteObject(psNetworkManagerConnection); } diff --git a/src/Network/Network/NetworkManager/NewAzNetworkManagerCommand.cs b/src/Network/Network/NetworkManager/NewAzNetworkManagerCommand.cs index 4ad9111baf9d..7e3a547746e0 100644 --- a/src/Network/Network/NetworkManager/NewAzNetworkManagerCommand.cs +++ b/src/Network/Network/NetworkManager/NewAzNetworkManagerCommand.cs @@ -132,7 +132,7 @@ private PSNetworkManager CreateNetworkManager() networkManagerModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true); // Execute the Create Network call - this.NetworkManagerClient.CreateOrUpdate(networkManagerModel, this.ResourceGroupName, this.Name); + this.NetworkManagerClient.CreateOrUpdate(this.ResourceGroupName, this.Name, networkManagerModel); var psNetworkManager = this.GetNetworkManager(this.ResourceGroupName, this.Name); return psNetworkManager; } diff --git a/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs b/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs index 7472295ab0f1..e8d290ffe9ba 100644 --- a/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs +++ b/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs @@ -51,7 +51,7 @@ public override void Execute() var networkManagerModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); // Execute the PUT NetworkManagerGroup call - this.NetworkManagerClient.CreateOrUpdate(networkManagerModel, this.InputObject.ResourceGroupName, this.InputObject.Name); + this.NetworkManagerClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.Name, networkManagerModel); var psNetworkManager = this.GetNetworkManager(this.InputObject.ResourceGroupName, this.InputObject.Name); WriteObject(psNetworkManager); } diff --git a/src/Network/Network/NetworkWatcher/ConnectionMonitor/ConnectionMonitorBaseCmdlet.cs b/src/Network/Network/NetworkWatcher/ConnectionMonitor/ConnectionMonitorBaseCmdlet.cs index 74afeedb4ee7..f7362fe911e2 100644 --- a/src/Network/Network/NetworkWatcher/ConnectionMonitor/ConnectionMonitorBaseCmdlet.cs +++ b/src/Network/Network/NetworkWatcher/ConnectionMonitor/ConnectionMonitorBaseCmdlet.cs @@ -199,7 +199,7 @@ public PSConnectionMonitorResultV2 MapConnectionMonitorResultToPSConnectionMonit new PSNetworkWatcherConnectionMonitorSuccessThreshold() { ChecksFailedPercent = testConfiguration.SuccessThreshold.ChecksFailedPercent, - RoundTripTimeMs = testConfiguration.SuccessThreshold.RoundTripTimeMs + RoundTripTimeMs = testConfiguration.SuccessThreshold.RoundTripTimeMS }, ProtocolConfiguration = this.GetPSProtocolConfiguration(testConfiguration) }; @@ -633,7 +633,7 @@ private void AddTestConfigurationsToConnectionMonitorTestGroup( Port = httpConfiguration.Port, Method = httpConfiguration.Method, Path = httpConfiguration.Path, - PreferHTTPS = httpConfiguration.PreferHTTPS, + PreferHttps = httpConfiguration.PreferHTTPS, ValidStatusCodeRanges = httpConfiguration.ValidStatusCodeRanges, RequestHeaders = this.GetRequestHeaders(httpConfiguration) }; @@ -690,7 +690,7 @@ private ConnectionMonitorSuccessThreshold GetSuccessThreshold(PSNetworkWatcherCo return new ConnectionMonitorSuccessThreshold() { ChecksFailedPercent = testConfiguration.SuccessThreshold.ChecksFailedPercent, - RoundTripTimeMs = testConfiguration.SuccessThreshold.RoundTripTimeMs + RoundTripTimeMS = testConfiguration.SuccessThreshold.RoundTripTimeMs }; } @@ -896,7 +896,7 @@ private PSNetworkWatcherConnectionMonitorProtocolConfiguration GetPSProtocolConf Port = testConfiguration.HttpConfiguration.Port, Method = testConfiguration.HttpConfiguration.Method, Path = testConfiguration.HttpConfiguration.Path, - PreferHTTPS = testConfiguration.HttpConfiguration.PreferHTTPS, + PreferHTTPS = testConfiguration.HttpConfiguration.PreferHttps, ValidStatusCodeRanges = testConfiguration.HttpConfiguration.ValidStatusCodeRanges?.ToList(), RequestHeaders = this.GetPSRequestHeaders(testConfiguration.HttpConfiguration.RequestHeaders?.ToList()) }; @@ -913,7 +913,7 @@ private PSNetworkWatcherConnectionMonitorProtocolConfiguration GetPSProtocolConf return null; } - private List GetPSRequestHeaders(List headers) + private List GetPSRequestHeaders(List headers) { if (headers == null) { @@ -921,7 +921,7 @@ private List GetPSRequestHeaders(List headers) } List psHeaders = new List(); - foreach (HTTPHeader header in headers) + foreach (HttpHeader header in headers) { psHeaders.Add( new PSHTTPHeader() @@ -991,18 +991,18 @@ private void AddSourceEndpointsToConnectionMonitorTestGroup( } } - private List GetRequestHeaders(PSNetworkWatcherConnectionMonitorHttpConfiguration httpConfiguration) + private List GetRequestHeaders(PSNetworkWatcherConnectionMonitorHttpConfiguration httpConfiguration) { if (httpConfiguration.RequestHeaders == null) { return null; } - var requestHeaders = new List(); + var requestHeaders = new List(); foreach (PSHTTPHeader header in httpConfiguration.RequestHeaders) { requestHeaders.Add( - new HTTPHeader() + new HttpHeader() { Name = header.Name, Value = header.Value diff --git a/src/Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs b/src/Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs index 21e5dec2ab38..c73e0dd0ffb4 100644 --- a/src/Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs +++ b/src/Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs @@ -219,7 +219,7 @@ private PSPacketCaptureResult CreatePacketCapture(string resourceGroupName, stri { if (this.TargetType.ToLower() == "vmss" || this.TargetType.ToLower() == "azurevmss") { - packetCaptureProperties.TargetType = MNM.PacketCaptureTargetType.AzureVMSS; + packetCaptureProperties.TargetType = MNM.PacketCaptureTargetType.AzureVmss; } } diff --git a/src/Network/Network/NetworkWatcher/TestAzureNetworkWatcherConnectivityCommand.cs b/src/Network/Network/NetworkWatcher/TestAzureNetworkWatcherConnectivityCommand.cs index 477908824de1..4feedc3d4df5 100644 --- a/src/Network/Network/NetworkWatcher/TestAzureNetworkWatcherConnectivityCommand.cs +++ b/src/Network/Network/NetworkWatcher/TestAzureNetworkWatcherConnectivityCommand.cs @@ -149,16 +149,16 @@ public override void Execute() parameters.Protocol = this.ProtocolConfiguration.Protocol; if (string.Equals(this.ProtocolConfiguration.Protocol, "Http", StringComparison.OrdinalIgnoreCase)) { - IList headers = new List(); + IList headers = new List(); if (this.ProtocolConfiguration.Header != null) { foreach (DictionaryEntry entry in this.ProtocolConfiguration.Header) { - headers.Add(new MNM.HTTPHeader((string)entry.Key, (string)entry.Value)); + headers.Add(new MNM.HttpHeader((string)entry.Key, (string)entry.Value)); } } - MNM.HTTPConfiguration httpConfiguration = new MNM.HTTPConfiguration(this.ProtocolConfiguration.Method, headers, this.ProtocolConfiguration.ValidStatusCode.OfType().ToList()); + MNM.HttpConfiguration httpConfiguration = new MNM.HttpConfiguration(this.ProtocolConfiguration.Method, headers, this.ProtocolConfiguration.ValidStatusCode.OfType().ToList()); parameters.ProtocolConfiguration = new MNM.ProtocolConfiguration(httpConfiguration); } } diff --git a/src/Network/Network/RouteServer/NewAzureRMRouteServerCommand.cs b/src/Network/Network/RouteServer/NewAzureRMRouteServerCommand.cs index f71bf09c6782..29094d75ef86 100644 --- a/src/Network/Network/RouteServer/NewAzureRMRouteServerCommand.cs +++ b/src/Network/Network/RouteServer/NewAzureRMRouteServerCommand.cs @@ -161,7 +161,7 @@ public override void Execute() virtualHubModel.Sku = "Standard"; this.NetworkClient.NetworkManagementClient.VirtualHubs.CreateOrUpdate(this.ResourceGroupName, this.RouteServerName, virtualHubModel); - this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.CreateOrUpdate(this.ResourceGroupName, this.RouteServerName, ipConfigName, ipconfig); + this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.CreateOrUpdate(this.ResourceGroupName, this.RouteServerName, ipConfigName, ipconfig); virtualHubModel = this.NetworkClient.NetworkManagementClient.VirtualHubs.Get(this.ResourceGroupName, this.RouteServerName); virtualHub = NetworkResourceManagerProfile.Mapper.Map(virtualHubModel); diff --git a/src/Network/Network/RouteServer/RemoveAzureRMRouteServerCommand.cs b/src/Network/Network/RouteServer/RemoveAzureRMRouteServerCommand.cs index a71775200bd5..6264d8ce20e8 100644 --- a/src/Network/Network/RouteServer/RemoveAzureRMRouteServerCommand.cs +++ b/src/Network/Network/RouteServer/RemoveAzureRMRouteServerCommand.cs @@ -96,7 +96,7 @@ public override void Execute() { string ipConfigName = "ipconfig1"; - this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.Delete(ResourceGroupName, RouteServerName, ipConfigName); + this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.Delete(ResourceGroupName, RouteServerName, ipConfigName); this.NetworkClient.NetworkManagementClient.VirtualHubs.Delete(ResourceGroupName, RouteServerName); if (PassThru) { diff --git a/src/Network/Network/RouteServerPeer/UpdateAzureRMRouteServerPeerCommand.cs b/src/Network/Network/RouteServerPeer/UpdateAzureRMRouteServerPeerCommand.cs index 8e79dc59d996..6216934f77c2 100644 --- a/src/Network/Network/RouteServerPeer/UpdateAzureRMRouteServerPeerCommand.cs +++ b/src/Network/Network/RouteServerPeer/UpdateAzureRMRouteServerPeerCommand.cs @@ -139,7 +139,7 @@ public override void Execute() { var parsedResourceId = new ResourceIdentifier(ResourceId); PeerAsn = (uint)existingBgpConnection.PeerAsn; - PeerIp = existingBgpConnection.PeerIp; + PeerIp = existingBgpConnection.PeerIP; } ConfirmAction( diff --git a/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs b/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs index 54da3c3211c4..2b76503a83d5 100644 --- a/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs +++ b/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs @@ -202,7 +202,7 @@ private PSVirtualNetwork CreateVirtualNetwork() foreach (var ipAllocation in this.IpAllocation) { var ipAllocationReference = new MNM.SubResource(ipAllocation.Id); - vnetModel.IpAllocations.Add(ipAllocationReference); + vnetModel.IPAllocations.Add(ipAllocationReference); } } diff --git a/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecParametersCommand.cs b/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecParametersCommand.cs index 0079c2026bd0..e396daeffabc 100644 --- a/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecParametersCommand.cs +++ b/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecParametersCommand.cs @@ -39,8 +39,8 @@ public class NewAzureRmVpnClientIpsecParametersCommand : NetworkBaseCmdlet HelpMessage = "The VpnClient IPSec encryption algorithm (IKE Phase 1)")] [ValidateNotNullOrEmpty] [ValidateSet( - MNM.IpsecEncryption.GCMAES256, - MNM.IpsecEncryption.GCMAES128, + MNM.IpsecEncryption.Gcmaes256, + MNM.IpsecEncryption.Gcmaes128, MNM.IpsecEncryption.AES256, MNM.IpsecEncryption.AES128)] public string IpsecEncryption { get; set; } @@ -50,8 +50,8 @@ public class NewAzureRmVpnClientIpsecParametersCommand : NetworkBaseCmdlet HelpMessage = "The VpnClient IPSec integrity algorithm (IKE Phase 1)")] [ValidateNotNullOrEmpty] [ValidateSet( - MNM.IpsecIntegrity.GCMAES256, - MNM.IpsecIntegrity.GCMAES128, + MNM.IpsecIntegrity.Gcmaes256, + MNM.IpsecIntegrity.Gcmaes128, MNM.IpsecIntegrity.SHA256)] public string IpsecIntegrity { get; set; } @@ -60,8 +60,8 @@ public class NewAzureRmVpnClientIpsecParametersCommand : NetworkBaseCmdlet HelpMessage = "The VpnClient IKE encryption algorithm (IKE Phase 2)")] [ValidateNotNullOrEmpty] [ValidateSet( - MNM.IkeEncryption.GCMAES256, - MNM.IkeEncryption.GCMAES128, + MNM.IkeEncryption.Gcmaes256, + MNM.IkeEncryption.Gcmaes128, MNM.IkeEncryption.AES256, MNM.IkeEncryption.AES128)] public string IkeEncryption { get; set; } @@ -93,7 +93,7 @@ public class NewAzureRmVpnClientIpsecParametersCommand : NetworkBaseCmdlet [ValidateNotNullOrEmpty] [ValidateSet( MNM.PfsGroup.PFS24, - MNM.PfsGroup.PFSMM, + MNM.PfsGroup.Pfsmm, MNM.PfsGroup.ECP384, MNM.PfsGroup.ECP256, MNM.PfsGroup.PFS14, @@ -111,8 +111,8 @@ public override void Execute() vpnclientIPsecParameters.SaLifeTimeSeconds = (!this.MyInvocation.BoundParameters.ContainsKey("SaLifeTime")) ? 7200 : this.SALifeTime; vpnclientIPsecParameters.SaDataSizeKilobytes = (!this.MyInvocation.BoundParameters.ContainsKey("SaDataSize")) ? 104857600 : this.SADataSize; - vpnclientIPsecParameters.IpsecEncryption = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecEncryption")) ? MNM.IpsecEncryption.GCMAES256 : this.IpsecEncryption; - vpnclientIPsecParameters.IpsecIntegrity = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecIntegrity")) ? MNM.IpsecIntegrity.GCMAES256 : this.IpsecIntegrity; + vpnclientIPsecParameters.IpsecEncryption = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecEncryption")) ? MNM.IpsecEncryption.Gcmaes256 : this.IpsecEncryption; + vpnclientIPsecParameters.IpsecIntegrity = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecIntegrity")) ? MNM.IpsecIntegrity.Gcmaes256 : this.IpsecIntegrity; // GCM matching check if ((vpnclientIPsecParameters.IpsecEncryption.Contains("GCM") || vpnclientIPsecParameters.IpsecIntegrity.Contains("GCM")) diff --git a/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecPolicyCommand.cs b/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecPolicyCommand.cs index 0cc275c1ea9c..f688d38c923d 100644 --- a/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecPolicyCommand.cs +++ b/src/Network/Network/VirtualNetworkGateway/NewAzureRmVpnClientIpsecPolicyCommand.cs @@ -39,8 +39,8 @@ public class NewAzureRmVpnClientIpsecPolicyCommand : NetworkBaseCmdlet HelpMessage = "The VpnClient IPSec encryption algorithm (IKE Phase 1)")] [ValidateNotNullOrEmpty] [ValidateSet( - MNM.IpsecEncryption.GCMAES256, - MNM.IpsecEncryption.GCMAES128, + MNM.IpsecEncryption.Gcmaes256, + MNM.IpsecEncryption.Gcmaes128, MNM.IpsecEncryption.AES256, MNM.IpsecEncryption.AES128)] public string IpsecEncryption { get; set; } @@ -50,8 +50,8 @@ public class NewAzureRmVpnClientIpsecPolicyCommand : NetworkBaseCmdlet HelpMessage = "The VpnClient IPSec integrity algorithm (IKE Phase 1)")] [ValidateNotNullOrEmpty] [ValidateSet( - MNM.IpsecIntegrity.GCMAES256, - MNM.IpsecIntegrity.GCMAES128, + MNM.IpsecIntegrity.Gcmaes256, + MNM.IpsecIntegrity.Gcmaes128, MNM.IpsecIntegrity.SHA256)] public string IpsecIntegrity { get; set; } @@ -60,8 +60,8 @@ public class NewAzureRmVpnClientIpsecPolicyCommand : NetworkBaseCmdlet HelpMessage = "The VpnClient IKE encryption algorithm (IKE Phase 2)")] [ValidateNotNullOrEmpty] [ValidateSet( - MNM.IkeEncryption.GCMAES256, - MNM.IkeEncryption.GCMAES128, + MNM.IkeEncryption.Gcmaes256, + MNM.IkeEncryption.Gcmaes128, MNM.IkeEncryption.AES256, MNM.IkeEncryption.AES128)] public string IkeEncryption { get; set; } @@ -93,7 +93,7 @@ public class NewAzureRmVpnClientIpsecPolicyCommand : NetworkBaseCmdlet [ValidateNotNullOrEmpty] [ValidateSet( MNM.PfsGroup.PFS24, - MNM.PfsGroup.PFSMM, + MNM.PfsGroup.Pfsmm, MNM.PfsGroup.ECP384, MNM.PfsGroup.ECP256, MNM.PfsGroup.PFS14, @@ -111,8 +111,8 @@ public override void Execute() vpnclientIpsecPolicy.SALifeTimeSeconds = (!this.MyInvocation.BoundParameters.ContainsKey("SALifeTime")) ? 7200 : this.SALifeTime; vpnclientIpsecPolicy.SADataSizeKilobytes = (!this.MyInvocation.BoundParameters.ContainsKey("SADataSize")) ? 104857600 : this.SADataSize; - vpnclientIpsecPolicy.IpsecEncryption = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecEncryption")) ? MNM.IpsecEncryption.GCMAES256 : this.IpsecEncryption; - vpnclientIpsecPolicy.IpsecIntegrity = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecIntegrity")) ? MNM.IpsecIntegrity.GCMAES256 : this.IpsecIntegrity; + vpnclientIpsecPolicy.IpsecEncryption = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecEncryption")) ? MNM.IpsecEncryption.Gcmaes256 : this.IpsecEncryption; + vpnclientIpsecPolicy.IpsecIntegrity = (!this.MyInvocation.BoundParameters.ContainsKey("IpsecIntegrity")) ? MNM.IpsecIntegrity.Gcmaes256 : this.IpsecIntegrity; // GCM matching check if ((vpnclientIpsecPolicy.IpsecEncryption.Contains("GCM") || vpnclientIpsecPolicy.IpsecIntegrity.Contains("GCM")) diff --git a/src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs b/src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs index 662305814f57..018107f74bb6 100644 --- a/src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs +++ b/src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs @@ -166,7 +166,7 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd ValueFromPipelineByPropertyName = true, HelpMessage = "The list of P2S VPN client tunneling protocols")] [ValidateSet( - MNM.VpnClientProtocol.SSTP, + MNM.VpnClientProtocol.Sstp, MNM.VpnClientProtocol.IkeV2, MNM.VpnClientProtocol.OpenVPN)] [ValidateNotNullOrEmpty] diff --git a/src/Network/Network/VirtualNetworkGateway/NewAzureVpnClientConfigurationCommand.cs b/src/Network/Network/VirtualNetworkGateway/NewAzureVpnClientConfigurationCommand.cs index 0087ae4394c2..f672a511e63d 100644 --- a/src/Network/Network/VirtualNetworkGateway/NewAzureVpnClientConfigurationCommand.cs +++ b/src/Network/Network/VirtualNetworkGateway/NewAzureVpnClientConfigurationCommand.cs @@ -59,8 +59,8 @@ public class NewAzureVpnClientConfigurationCommand : VirtualNetworkGatewayBaseCm ValueFromPipelineByPropertyName = true, HelpMessage = "Authentication Method")] [ValidateSet( - MNM.AuthenticationMethod.EAPTLS, - MNM.AuthenticationMethod.EAPMSCHAPv2, + MNM.AuthenticationMethod.Eaptls, + MNM.AuthenticationMethod.EapmschaPv2, IgnoreCase = true)] public string AuthenticationMethod { get; set; } @@ -89,7 +89,7 @@ public override void Execute() this.ProcessorArchitecture; vpnClientParams.AuthenticationMethod = string.IsNullOrWhiteSpace(this.AuthenticationMethod) - ? MNM.AuthenticationMethod.EAPTLS.ToString() + ? MNM.AuthenticationMethod.Eaptls.ToString() : this.AuthenticationMethod; // Read the radius server root certificate if present diff --git a/src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs b/src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs index 55d30557573e..e87a0677d19d 100644 --- a/src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs +++ b/src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs @@ -82,7 +82,7 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd ValueFromPipelineByPropertyName = true, HelpMessage = "A list of P2S VPN client tunneling protocols")] [ValidateSet( - MNM.VpnClientProtocol.SSTP, + MNM.VpnClientProtocol.Sstp, MNM.VpnClientProtocol.IkeV2, MNM.VpnClientProtocol.OpenVPN)] [ValidateNotNullOrEmpty] diff --git a/src/Network/Network/VirtualNetworkGatewayConnection/NewAzureRmIpsecPolicyCommand.cs b/src/Network/Network/VirtualNetworkGatewayConnection/NewAzureRmIpsecPolicyCommand.cs index 435df2edeef6..d2d25c322f37 100644 --- a/src/Network/Network/VirtualNetworkGatewayConnection/NewAzureRmIpsecPolicyCommand.cs +++ b/src/Network/Network/VirtualNetworkGatewayConnection/NewAzureRmIpsecPolicyCommand.cs @@ -45,9 +45,9 @@ public class NewAzureRmIpsecPolicyCommand : NetworkBaseCmdlet MNM.IpsecEncryption.AES128, MNM.IpsecEncryption.AES192, MNM.IpsecEncryption.AES256, - MNM.IpsecEncryption.GCMAES128, - MNM.IpsecEncryption.GCMAES192, - MNM.IpsecEncryption.GCMAES256, + MNM.IpsecEncryption.Gcmaes128, + MNM.IpsecEncryption.Gcmaes192, + MNM.IpsecEncryption.Gcmaes256, IgnoreCase = false)] public string IpsecEncryption { get; set; } @@ -59,9 +59,9 @@ public class NewAzureRmIpsecPolicyCommand : NetworkBaseCmdlet MNM.IpsecIntegrity.MD5, MNM.IpsecIntegrity.SHA1, MNM.IpsecIntegrity.SHA256, - MNM.IpsecEncryption.GCMAES128, - MNM.IpsecEncryption.GCMAES192, - MNM.IpsecEncryption.GCMAES256, + MNM.IpsecEncryption.Gcmaes128, + MNM.IpsecEncryption.Gcmaes192, + MNM.IpsecEncryption.Gcmaes256, IgnoreCase = false)] public string IpsecIntegrity { get; set; } diff --git a/src/Network/Network/VirtualRouter/NewAzureRMVirtualRouterCommand.cs b/src/Network/Network/VirtualRouter/NewAzureRMVirtualRouterCommand.cs index 16f97394c580..1e44483e1ada 100644 --- a/src/Network/Network/VirtualRouter/NewAzureRMVirtualRouterCommand.cs +++ b/src/Network/Network/VirtualRouter/NewAzureRMVirtualRouterCommand.cs @@ -129,7 +129,7 @@ public override void Execute() virtualHubModel.Sku = "Standard"; this.NetworkClient.NetworkManagementClient.VirtualHubs.CreateOrUpdate(this.ResourceGroupName, this.Name, virtualHubModel); - this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.CreateOrUpdate(this.ResourceGroupName, this.Name, ipConfigName, ipconfig); + this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.CreateOrUpdate(this.ResourceGroupName, this.Name, ipConfigName, ipconfig); virtualHubModel = this.NetworkClient.NetworkManagementClient.VirtualHubs.Get(this.ResourceGroupName, this.Name); virtualHub = NetworkResourceManagerProfile.Mapper.Map(virtualHubModel); diff --git a/src/Network/Network/VirtualRouter/RemoveAzureRMVirtualRouterCommand.cs b/src/Network/Network/VirtualRouter/RemoveAzureRMVirtualRouterCommand.cs index c663a3c6d04f..2665b5567bc5 100644 --- a/src/Network/Network/VirtualRouter/RemoveAzureRMVirtualRouterCommand.cs +++ b/src/Network/Network/VirtualRouter/RemoveAzureRMVirtualRouterCommand.cs @@ -100,7 +100,7 @@ public override void Execute() { string ipConfigName = "ipconfig1"; - this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.Delete(ResourceGroupName, RouterName, ipConfigName); + this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.Delete(ResourceGroupName, RouterName, ipConfigName); this.NetworkClient.NetworkManagementClient.VirtualHubs.Delete(ResourceGroupName, RouterName); if (PassThru) { diff --git a/src/Network/Network/VirtualRouter/RouteServerBaseCmdlet.cs b/src/Network/Network/VirtualRouter/RouteServerBaseCmdlet.cs index ff53578560db..db51ee9e7a50 100644 --- a/src/Network/Network/VirtualRouter/RouteServerBaseCmdlet.cs +++ b/src/Network/Network/VirtualRouter/RouteServerBaseCmdlet.cs @@ -26,8 +26,8 @@ public void AddIpConfigurtaionToPSVirtualHub(CNM.PSVirtualHub virtualHubModel, string resourceGroupName, string routerName) { - var ipConfigModels = this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.List(resourceGroupName, routerName); - var ipConfigList = ListNextLink.GetAllResourcesByPollingNextLink(ipConfigModels, this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.ListNext); + var ipConfigModels = this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.List(resourceGroupName, routerName); + var ipConfigList = ListNextLink.GetAllResourcesByPollingNextLink(ipConfigModels, this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.ListNext); HubIpConfiguration ipConfigModel = null; if (ipConfigList.Count > 0) { diff --git a/src/Network/Network/VirtualRouter/VirtualRouterBaseCmdlet.cs b/src/Network/Network/VirtualRouter/VirtualRouterBaseCmdlet.cs index 20dd45f43a49..e1a62e6f9f0d 100644 --- a/src/Network/Network/VirtualRouter/VirtualRouterBaseCmdlet.cs +++ b/src/Network/Network/VirtualRouter/VirtualRouterBaseCmdlet.cs @@ -43,7 +43,7 @@ public void AddIpConfigurtaionToPSVirtualHub(CNM.PSVirtualHub virtualHubModel, string routerName, string ipConfigName) { - var ipConfigModel = this.NetworkClient.NetworkManagementClient.VirtualHubIpConfiguration.Get(resourceGroupName, routerName, ipConfigName); + var ipConfigModel = this.NetworkClient.NetworkManagementClient.VirtualHubIPConfiguration.Get(resourceGroupName, routerName, ipConfigName); var ipconfig = NetworkResourceManagerProfile.Mapper.Map(ipConfigModel); virtualHubModel.IpConfigurations = new List(); virtualHubModel.IpConfigurations.Add(ipconfig); diff --git a/src/Network/Network/VirtualRouterPeer/UpdateAzureRMVirtualRouterPeerCommand.cs b/src/Network/Network/VirtualRouterPeer/UpdateAzureRMVirtualRouterPeerCommand.cs index 310eb1377ca4..7e71ece00962 100644 --- a/src/Network/Network/VirtualRouterPeer/UpdateAzureRMVirtualRouterPeerCommand.cs +++ b/src/Network/Network/VirtualRouterPeer/UpdateAzureRMVirtualRouterPeerCommand.cs @@ -143,7 +143,7 @@ public override void Execute() { var parsedResourceId = new ResourceIdentifier(ResourceId); PeerAsn = (uint)existingBgpConnection.PeerAsn; - PeerIp = existingBgpConnection.PeerIp; + PeerIp = existingBgpConnection.PeerIP; } ConfirmAction(